summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bzrignore21
-rwxr-xr-xBUILD/compile-solaris-amd6455
-rwxr-xr-xBitKeeper/triggers/pre-commit.check-case.pl26
-rwxr-xr-xCMakeLists.txt19
-rw-r--r--Docs/INSTALL-BINARY8
-rw-r--r--Docs/Makefile.am35
-rwxr-xr-xDocs/Support/generate-text-files.pl58
-rw-r--r--Docs/manual.chm14
-rw-r--r--Docs/mysql.info29
-rw-r--r--INSTALL-SOURCE8
-rw-r--r--INSTALL-WIN-SOURCE9
-rw-r--r--Makefile.am2
-rw-r--r--client/client_priv.h2
-rw-r--r--client/mysql.cc189
-rw-r--r--client/mysql_upgrade.c13
-rw-r--r--client/mysqladmin.cc8
-rw-r--r--client/mysqlbinlog.cc11
-rw-r--r--client/mysqlcheck.c60
-rw-r--r--client/mysqldump.c46
-rw-r--r--client/mysqlimport.c8
-rw-r--r--client/mysqlmanagerc.c7
-rw-r--r--client/mysqlshow.c8
-rw-r--r--client/mysqltest.c29
-rw-r--r--cmd-line-utils/libedit/Makefile.am12
-rw-r--r--cmd-line-utils/readline/INSTALL16
-rw-r--r--cmd-line-utils/readline/README18
-rw-r--r--cmd-line-utils/readline/bind.c310
-rw-r--r--cmd-line-utils/readline/callback.c132
-rw-r--r--cmd-line-utils/readline/chardefs.h6
-rw-r--r--cmd-line-utils/readline/compat.c4
-rw-r--r--cmd-line-utils/readline/complete.c140
-rw-r--r--cmd-line-utils/readline/configure.in99
-rw-r--r--cmd-line-utils/readline/display.c528
-rw-r--r--cmd-line-utils/readline/funmap.c5
-rw-r--r--cmd-line-utils/readline/histexpand.c54
-rw-r--r--cmd-line-utils/readline/histfile.c16
-rw-r--r--cmd-line-utils/readline/history.c113
-rw-r--r--cmd-line-utils/readline/histsearch.c4
-rw-r--r--cmd-line-utils/readline/input.c45
-rw-r--r--cmd-line-utils/readline/isearch.c784
-rw-r--r--cmd-line-utils/readline/keymaps.c4
-rw-r--r--cmd-line-utils/readline/kill.c36
-rw-r--r--cmd-line-utils/readline/macro.c23
-rw-r--r--cmd-line-utils/readline/mbutil.c48
-rw-r--r--cmd-line-utils/readline/misc.c302
-rw-r--r--cmd-line-utils/readline/nls.c6
-rw-r--r--cmd-line-utils/readline/parens.c4
-rw-r--r--cmd-line-utils/readline/readline.c384
-rw-r--r--cmd-line-utils/readline/readline.h69
-rw-r--r--cmd-line-utils/readline/rlconf.h5
-rw-r--r--cmd-line-utils/readline/rldefs.h8
-rw-r--r--cmd-line-utils/readline/rlmbutil.h38
-rw-r--r--cmd-line-utils/readline/rlprivate.h141
-rw-r--r--cmd-line-utils/readline/rltty.c89
-rw-r--r--cmd-line-utils/readline/savestring.c3
-rw-r--r--cmd-line-utils/readline/search.c314
-rw-r--r--cmd-line-utils/readline/shell.c40
-rw-r--r--cmd-line-utils/readline/signals.c78
-rw-r--r--cmd-line-utils/readline/terminal.c141
-rw-r--r--cmd-line-utils/readline/text.c373
-rw-r--r--cmd-line-utils/readline/tilde.c62
-rw-r--r--cmd-line-utils/readline/tilde.h3
-rw-r--r--cmd-line-utils/readline/undo.c91
-rw-r--r--cmd-line-utils/readline/util.c34
-rw-r--r--cmd-line-utils/readline/vi_keymap.c2
-rw-r--r--cmd-line-utils/readline/vi_mode.c534
-rw-r--r--cmd-line-utils/readline/xmalloc.c11
-rw-r--r--config/ac-macros/large_file.m411
-rw-r--r--configure.in41
-rw-r--r--debian/Makefile.am118
-rw-r--r--debian/README.Maintainer99
-rw-r--r--debian/additions/my.cnf134
-rw-r--r--debian/additions/mysql-server.lintian-overrides2
-rw-r--r--debian/additions/ndb_mgmd.cnf35
-rw-r--r--debian/changelog3275
-rw-r--r--debian/compat1
-rw-r--r--debian/control.in353
-rw-r--r--debian/copyright139
-rw-r--r--debian/copyright.more60
-rw-r--r--debian/defs.mk.in14
-rw-r--r--debian/libmysqlclientSLIB-dev.README.Maintainer.in4
-rw-r--r--debian/libmysqlclientSLIB-dev.dirs.in2
-rw-r--r--debian/libmysqlclientSLIB-dev.docs.in1
-rw-r--r--debian/libmysqlclientSLIB-dev.examples.in1
-rw-r--r--debian/libmysqlclientSLIB-dev.files.in7
-rw-r--r--debian/libmysqlclientSLIB-dev.links.in2
-rw-r--r--debian/libmysqlclientSLIBoff.README.Debian.in30
-rw-r--r--debian/libmysqlclientSLIBoff.dirs.in1
-rw-r--r--debian/libmysqlclientSLIBoff.docs.in1
-rw-r--r--debian/libmysqlclientSLIBoff.files.in1
-rw-r--r--debian/libmysqlclientSLIBoff.postinst.in12
-rw-r--r--debian/libndbclientNLIB-dev.dirs.in3
-rw-r--r--debian/libndbclientNLIB-dev.files.in3
-rw-r--r--debian/libndbclientNLIB-dev.links.in1
-rw-r--r--debian/libndbclientNLIB.README.Debian.in30
-rw-r--r--debian/libndbclientNLIB.dirs.in1
-rw-r--r--debian/libndbclientNLIB.files.in1
-rw-r--r--debian/libndbclientNLIB.postinst.in12
-rw-r--r--debian/mysql-client-BASE.NEWS.in6
-rw-r--r--debian/mysql-client-BASE.README.Debian.in4
-rw-r--r--debian/mysql-client-BASE.dirs.in2
-rw-r--r--debian/mysql-client-BASE.docs.in2
-rw-r--r--debian/mysql-client-BASE.files.in18
-rw-r--r--debian/mysql-client-BASE.lintian-overrides.in1
-rw-r--r--debian/mysql-common.README.Debian.in20
-rw-r--r--debian/mysql-common.dirs.in1
-rw-r--r--debian/mysql-common.files.in2
-rw-r--r--debian/mysql-common.postrm.in7
-rw-r--r--debian/mysql-common.preinst.in215
-rw-r--r--debian/mysql-extra-BASE.dirs.in1
-rw-r--r--debian/mysql-extra-BASE.files.in3
-rw-r--r--debian/mysql-management-BASE.dirs.in1
-rw-r--r--debian/mysql-management-BASE.files.in1
-rw-r--r--debian/mysql-management-BASE.mysql-management.init.in86
-rw-r--r--debian/mysql-server-BASE.NEWS.in10
-rw-r--r--debian/mysql-server-BASE.README.Debian.in125
-rw-r--r--debian/mysql-server-BASE.config.in39
-rw-r--r--debian/mysql-server-BASE.dirs.in13
-rw-r--r--debian/mysql-server-BASE.docs.in2
-rw-r--r--debian/mysql-server-BASE.files.in50
-rw-r--r--debian/mysql-server-BASE.links.in1
-rw-r--r--debian/mysql-server-BASE.lintian-overrides.in4
-rw-r--r--debian/mysql-server-BASE.logcheck.ignore.paranoid.in10
-rw-r--r--debian/mysql-server-BASE.logcheck.ignore.server.in31
-rw-r--r--debian/mysql-server-BASE.logcheck.ignore.workstation.in31
-rw-r--r--debian/mysql-server-BASE.mysql-server.logrotate.in28
-rw-r--r--debian/mysql-server-BASE.postinst.in276
-rw-r--r--debian/mysql-server-BASE.postrm.in92
-rw-r--r--debian/mysql-server-BASE.preinst.in167
-rw-r--r--debian/mysql-server-BASE.prerm.in8
-rw-r--r--debian/mysql-server-BASE.templates.in71
-rw-r--r--debian/mysql-server-PREV.preinst.in191
-rw-r--r--debian/mysql-server.preinst.in191
-rw-r--r--debian/mysql-storage-BASE.dirs.in1
-rw-r--r--debian/mysql-storage-BASE.files.in1
-rw-r--r--debian/mysql-storage-BASE.mysql-storage.init.in85
-rw-r--r--debian/mysql-test-BASE.dirs.in2
-rw-r--r--debian/mysql-test-BASE.files.in6
-rw-r--r--debian/mysql-tools-BASE.dirs.in2
-rw-r--r--debian/mysql-tools-BASE.files.in13
-rw-r--r--debian/po/POTFILES.in.in1
-rw-r--r--debian/po/ca.po290
-rw-r--r--debian/po/cs.po259
-rw-r--r--debian/po/da.po283
-rw-r--r--debian/po/de.po195
-rw-r--r--debian/po/es.po288
-rw-r--r--debian/po/eu.po163
-rw-r--r--debian/po/fr.po204
-rw-r--r--debian/po/gl.po279
-rw-r--r--debian/po/it.po184
-rw-r--r--debian/po/ja.po278
-rw-r--r--debian/po/nb.po179
-rw-r--r--debian/po/nl.po187
-rw-r--r--debian/po/pt.po198
-rw-r--r--debian/po/pt_BR.po339
-rw-r--r--debian/po/ro.po193
-rw-r--r--debian/po/ru.po172
-rw-r--r--debian/po/sv.po225
-rw-r--r--debian/po/templates.pot155
-rw-r--r--debian/po/tr.po290
-rwxr-xr-xdebian/rules405
-rw-r--r--debian/source.lintian-overrides.in6
-rw-r--r--debian/watch3
-rw-r--r--extra/comp_err.c1
-rw-r--r--heap/hp_delete.c3
-rw-r--r--heap/hp_hash.c6
-rw-r--r--heap/hp_rfirst.c11
-rw-r--r--heap/hp_rnext.c29
-rw-r--r--include/config-win.h4
-rw-r--r--include/keycache.h10
-rw-r--r--include/my_base.h2
-rw-r--r--include/my_global.h8
-rw-r--r--include/my_pthread.h9
-rw-r--r--include/my_sys.h36
-rw-r--r--include/mysql.h10
-rw-r--r--include/mysql_h.ic468
-rw-r--r--include/mysql_version.h.in1
-rw-r--r--innobase/include/db0err.h12
-rw-r--r--innobase/include/os0sync.h38
-rw-r--r--innobase/include/page0cur.h1
-rw-r--r--innobase/include/sync0rw.h11
-rw-r--r--innobase/include/sync0rw.ic6
-rw-r--r--innobase/include/sync0sync.ic2
-rw-r--r--innobase/os/os0sync.c56
-rw-r--r--innobase/srv/srv0srv.c16
-rw-r--r--innobase/sync/sync0arr.c71
-rw-r--r--innobase/sync/sync0rw.c18
-rw-r--r--innobase/sync/sync0sync.c40
-rwxr-xr-xlibmysql/CMakeLists.txt4
-rw-r--r--libmysql/Makefile.shared4
-rw-r--r--libmysql/libmysql.c118
-rw-r--r--libmysql/libmysql.def1
-rw-r--r--libmysqld/libmysqld.def1
-rw-r--r--myisam/ft_boolean_search.c4
-rw-r--r--myisam/ft_nlq_search.c3
-rw-r--r--myisam/ft_parser.c2
-rw-r--r--myisam/mi_check.c263
-rw-r--r--myisam/mi_dynrec.c68
-rw-r--r--myisam/mi_open.c7
-rw-r--r--myisam/mi_packrec.c3
-rw-r--r--myisam/mi_write.c2
-rw-r--r--myisam/myisamchk.c7
-rw-r--r--myisam/myisampack.c2
-rw-r--r--myisam/rt_index.c18
-rw-r--r--myisam/rt_mbr.c5
-rw-r--r--myisam/sort.c22
-rw-r--r--mysql-test/Makefile.am1
-rw-r--r--mysql-test/include/ctype_common.inc9
-rw-r--r--mysql-test/include/ctype_regex.inc42
-rw-r--r--mysql-test/include/gis_keys.inc46
-rw-r--r--mysql-test/include/windows.inc9
-rw-r--r--mysql-test/lib/mtr_cases.pl26
-rw-r--r--mysql-test/lib/mtr_misc.pl21
-rw-r--r--mysql-test/lib/mtr_report.pl2
-rw-r--r--mysql-test/mysql-test-run-shell.sh13
-rwxr-xr-xmysql-test/mysql-test-run.pl116
-rw-r--r--mysql-test/r/almost_full.result29
-rw-r--r--mysql-test/r/analyze.result8
-rw-r--r--mysql-test/r/archive.result11
-rw-r--r--mysql-test/r/bdb_gis.result39
-rw-r--r--mysql-test/r/bigint.result6
-rw-r--r--mysql-test/r/binlog_killed.result44
-rw-r--r--mysql-test/r/binlog_killed_simulate.result33
-rw-r--r--mysql-test/r/case.result20
-rw-r--r--mysql-test/r/cast.result24
-rw-r--r--mysql-test/r/create.result2
-rw-r--r--mysql-test/r/csv.result42
-rw-r--r--mysql-test/r/ctype_big5.result13
-rw-r--r--mysql-test/r/ctype_euckr.result54
-rw-r--r--mysql-test/r/ctype_gb2312.result13
-rw-r--r--mysql-test/r/ctype_gbk.result13
-rw-r--r--mysql-test/r/ctype_uca.result58
-rw-r--r--mysql-test/r/ctype_ucs.result62
-rw-r--r--mysql-test/r/ctype_utf8.result87
-rw-r--r--mysql-test/r/date_formats.result2
-rw-r--r--mysql-test/r/delayed.result16
-rw-r--r--mysql-test/r/delete.result8
-rw-r--r--mysql-test/r/flush.result17
-rw-r--r--mysql-test/r/fulltext.result6
-rw-r--r--mysql-test/r/func_gconcat.result51
-rw-r--r--mysql-test/r/func_group.result30
-rw-r--r--mysql-test/r/func_math.result38
-rw-r--r--mysql-test/r/func_misc.result28
-rw-r--r--mysql-test/r/func_regexp.result19
-rw-r--r--mysql-test/r/func_sapdb.result5
-rw-r--r--mysql-test/r/func_set.result30
-rw-r--r--mysql-test/r/func_str.result30
-rw-r--r--mysql-test/r/func_time.result9
-rw-r--r--mysql-test/r/gis-rtree.result35
-rw-r--r--mysql-test/r/gis.result45
-rw-r--r--mysql-test/r/grant.result5
-rw-r--r--mysql-test/r/grant2.result18
-rw-r--r--mysql-test/r/grant3.result122
-rw-r--r--mysql-test/r/group_by.result65
-rw-r--r--mysql-test/r/heap_btree.result15
-rw-r--r--mysql-test/r/information_schema.result36
-rw-r--r--mysql-test/r/information_schema_db.result6
-rw-r--r--mysql-test/r/innodb.result17
-rw-r--r--mysql-test/r/innodb_gis.result39
-rw-r--r--mysql-test/r/innodb_mysql.result15
-rw-r--r--mysql-test/r/insert.result134
-rw-r--r--mysql-test/r/insert_select.result12
-rw-r--r--mysql-test/r/key.result44
-rw-r--r--mysql-test/r/lock_multi.result11
-rw-r--r--mysql-test/r/lowercase_view.result21
-rw-r--r--mysql-test/r/merge.result5
-rw-r--r--mysql-test/r/mix_innodb_myisam_binlog.result119
-rw-r--r--mysql-test/r/multi_update.result24
-rw-r--r--mysql-test/r/myisam.result33
-rw-r--r--mysql-test/r/myisampack.result29
-rw-r--r--mysql-test/r/mysql.result2
-rw-r--r--mysql-test/r/mysql_comments.result50
-rw-r--r--mysql-test/r/mysqlbinlog.result1
-rw-r--r--mysql-test/r/mysqlcheck.result7
-rw-r--r--mysql-test/r/mysqldump.result22
-rw-r--r--mysql-test/r/named_pipe.result2153
-rw-r--r--mysql-test/r/ndb_condition_pushdown.result22
-rw-r--r--mysql-test/r/ndb_update.result8
-rw-r--r--mysql-test/r/null.result25
-rw-r--r--mysql-test/r/olap.result19
-rw-r--r--mysql-test/r/outfile_loaddata.result85
-rw-r--r--mysql-test/r/ps.result5
-rw-r--r--mysql-test/r/repair.result27
-rw-r--r--mysql-test/r/rpl_flush_log_loop.result7
-rw-r--r--mysql-test/r/rpl_packet.result37
-rw-r--r--mysql-test/r/rpl_slave_skip.result144
-rw-r--r--mysql-test/r/rpl_sp_effects.result41
-rw-r--r--mysql-test/r/select.result264
-rw-r--r--mysql-test/r/shm.result2155
-rw-r--r--mysql-test/r/skip_grants.result5
-rw-r--r--mysql-test/r/sp-error.result15
-rw-r--r--mysql-test/r/sp.result21
-rw-r--r--mysql-test/r/sp_trans_log.result4
-rw-r--r--mysql-test/r/subselect.result60
-rw-r--r--mysql-test/r/type_date.result49
-rw-r--r--mysql-test/r/type_datetime.result77
-rw-r--r--mysql-test/r/type_decimal.result91
-rw-r--r--mysql-test/r/type_float.result16
-rw-r--r--mysql-test/r/type_newdecimal.result20
-rw-r--r--mysql-test/r/udf.result35
-rw-r--r--mysql-test/r/variables.result21
-rw-r--r--mysql-test/r/view.result56
-rw-r--r--mysql-test/r/view_grant.result51
-rw-r--r--mysql-test/r/windows_shm.result2
-rw-r--r--mysql-test/std_data/corrupt-relay-bin.000624bin0 -> 91418 bytes
-rw-r--r--mysql-test/suite/funcs_1/datadict/datadict_master.inc12
-rw-r--r--mysql-test/suite/funcs_1/datadict/datadict_show_schema.inc3
-rw-r--r--mysql-test/suite/funcs_1/datadict/datadict_tables.inc4
-rw-r--r--mysql-test/suite/funcs_1/r/innodb__datadict.result116
-rw-r--r--mysql-test/suite/funcs_1/r/memory__datadict.result116
-rw-r--r--mysql-test/suite/funcs_1/r/myisam__datadict.result116
-rw-r--r--mysql-test/suite/funcs_2/r/innodb_charset.result6
-rw-r--r--mysql-test/suite/funcs_2/r/memory_charset.result6
-rw-r--r--mysql-test/suite/funcs_2/r/myisam_charset.result6
-rw-r--r--mysql-test/suite/funcs_2/r/ndb_charset.result6
-rw-r--r--mysql-test/suite/manual/r/rpl_replication_delay.result121
-rw-r--r--mysql-test/suite/manual/t/rpl_replication_delay-slave.opt1
-rw-r--r--mysql-test/suite/manual/t/rpl_replication_delay.test71
-rw-r--r--mysql-test/t/almost_full.test41
-rw-r--r--mysql-test/t/analyze.test14
-rw-r--r--mysql-test/t/archive.test16
-rw-r--r--mysql-test/t/bdb_gis.test1
-rw-r--r--mysql-test/t/bigint.test9
-rw-r--r--mysql-test/t/binlog_killed.test244
-rw-r--r--mysql-test/t/binlog_killed_simulate-master.opt1
-rw-r--r--mysql-test/t/binlog_killed_simulate.test66
-rw-r--r--mysql-test/t/case.test21
-rw-r--r--mysql-test/t/cast.test22
-rw-r--r--mysql-test/t/csv.test33
-rw-r--r--mysql-test/t/ctype_euckr.test23
-rw-r--r--mysql-test/t/ctype_uca.test6
-rw-r--r--mysql-test/t/ctype_ucs.test28
-rw-r--r--mysql-test/t/ctype_utf8.test34
-rw-r--r--mysql-test/t/delayed.test16
-rw-r--r--mysql-test/t/delete.test15
-rw-r--r--mysql-test/t/disabled.def6
-rw-r--r--mysql-test/t/flush.test31
-rw-r--r--mysql-test/t/fulltext.test8
-rw-r--r--mysql-test/t/func_gconcat.test37
-rw-r--r--mysql-test/t/func_group.test41
-rw-r--r--mysql-test/t/func_math.test25
-rw-r--r--mysql-test/t/func_misc.test24
-rw-r--r--mysql-test/t/func_regexp.test34
-rw-r--r--mysql-test/t/func_sapdb.test1
-rw-r--r--mysql-test/t/func_set.test19
-rw-r--r--mysql-test/t/func_str.test25
-rw-r--r--mysql-test/t/func_time.test10
-rw-r--r--mysql-test/t/gis-rtree.test36
-rw-r--r--mysql-test/t/gis.test10
-rw-r--r--mysql-test/t/grant.test5
-rw-r--r--mysql-test/t/grant2.test32
-rw-r--r--mysql-test/t/grant3.test100
-rw-r--r--mysql-test/t/group_by.test35
-rw-r--r--mysql-test/t/heap_btree.test18
-rw-r--r--mysql-test/t/information_schema.test29
-rw-r--r--mysql-test/t/innodb.test32
-rw-r--r--mysql-test/t/innodb_gis.test1
-rw-r--r--mysql-test/t/innodb_mysql.test9
-rw-r--r--mysql-test/t/insert.test101
-rw-r--r--mysql-test/t/insert_select.test12
-rw-r--r--mysql-test/t/key.test18
-rw-r--r--mysql-test/t/lock_multi.test32
-rw-r--r--mysql-test/t/lowercase_view.test23
-rw-r--r--mysql-test/t/merge.test14
-rw-r--r--mysql-test/t/mix_innodb_myisam_binlog.test186
-rw-r--r--mysql-test/t/multi_update.test34
-rw-r--r--mysql-test/t/myisam.test32
-rw-r--r--mysql-test/t/myisampack.test33
-rw-r--r--mysql-test/t/mysql.test9
-rw-r--r--mysql-test/t/mysql_comments.sql177
-rw-r--r--mysql-test/t/mysql_comments.test37
-rw-r--r--mysql-test/t/mysqlbinlog.test4
-rw-r--r--mysql-test/t/mysqlcheck.test11
-rw-r--r--mysql-test/t/mysqldump.test17
-rw-r--r--mysql-test/t/mysqltest.test3
-rw-r--r--mysql-test/t/named_pipe-master.opt1
-rw-r--r--mysql-test/t/named_pipe.test14
-rw-r--r--mysql-test/t/ndb_condition_pushdown.test1025
-rw-r--r--mysql-test/t/ndb_update.test5
-rw-r--r--mysql-test/t/null.test27
-rw-r--r--mysql-test/t/olap.test18
-rw-r--r--mysql-test/t/outfile_loaddata.test89
-rw-r--r--mysql-test/t/ps.test10
-rw-r--r--mysql-test/t/repair.test31
-rw-r--r--mysql-test/t/rpl_dual_pos_advance.test6
-rw-r--r--mysql-test/t/rpl_flush_log_loop.test3
-rw-r--r--mysql-test/t/rpl_packet.test10
-rw-r--r--mysql-test/t/rpl_slave_skip-slave.opt1
-rw-r--r--mysql-test/t/rpl_slave_skip.test203
-rw-r--r--mysql-test/t/rpl_sp_effects.test51
-rw-r--r--mysql-test/t/rpl_temporary.test2
-rw-r--r--mysql-test/t/select.test205
-rw-r--r--mysql-test/t/shm-master.opt (renamed from mysql-test/t/windows_shm-master.opt)2
-rw-r--r--mysql-test/t/shm.test19
-rw-r--r--mysql-test/t/skip_grants.test12
-rw-r--r--mysql-test/t/sp-error.test25
-rw-r--r--mysql-test/t/sp.test39
-rw-r--r--mysql-test/t/sp_trans_log.test2
-rw-r--r--mysql-test/t/subselect.test59
-rw-r--r--mysql-test/t/type_date.test34
-rw-r--r--mysql-test/t/type_datetime.test76
-rw-r--r--mysql-test/t/type_decimal.test73
-rw-r--r--mysql-test/t/type_float.test21
-rw-r--r--mysql-test/t/type_newdecimal.test21
-rw-r--r--mysql-test/t/udf.test54
-rw-r--r--mysql-test/t/variables.test24
-rw-r--r--mysql-test/t/view.test55
-rw-r--r--mysql-test/t/view_grant.test50
-rw-r--r--mysql-test/t/windows_shm.test9
-rwxr-xr-xmysys/CMakeLists.txt2
-rw-r--r--mysys/Makefile.am2
-rw-r--r--mysys/charset.c40
-rw-r--r--mysys/default.c201
-rw-r--r--mysys/mf_arr_appstr.c61
-rw-r--r--mysys/mf_keycache.c27
-rw-r--r--mysys/mf_qsort.c4
-rw-r--r--mysys/mf_sort.c2
-rw-r--r--mysys/my_getopt.c16
-rw-r--r--mysys/my_init.c2
-rw-r--r--mysys/my_largepage.c12
-rw-r--r--mysys/my_lib.c6
-rw-r--r--mysys/my_malloc.c16
-rw-r--r--mysys/my_winthread.c23
-rw-r--r--mysys/my_write.c4
-rw-r--r--mysys/queues.c4
-rw-r--r--mysys/safemalloc.c27
-rw-r--r--mysys/thr_mutex.c49
-rw-r--r--ndb/include/kernel/AttributeHeader.hpp10
-rw-r--r--ndb/include/kernel/signaldata/ScanTab.hpp1
-rw-r--r--ndb/include/ndbapi/Ndb.hpp3
-rw-r--r--ndb/include/ndbapi/NdbScanFilter.hpp27
-rw-r--r--ndb/include/ndbapi/ndbapi_limits.h2
-rw-r--r--ndb/include/util/ndb_rand.h33
-rw-r--r--ndb/src/common/util/Makefile.am3
-rw-r--r--ndb/src/common/util/ndb_rand.c40
-rw-r--r--ndb/src/kernel/blocks/dbtc/DbtcMain.cpp3
-rw-r--r--ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp8
-rw-r--r--ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp11
-rw-r--r--ndb/src/kernel/blocks/dbutil/DbUtil.cpp5
-rw-r--r--ndb/src/mgmsrv/MgmtSrvr.cpp6
-rw-r--r--ndb/src/ndbapi/NdbOperationDefine.cpp14
-rw-r--r--ndb/src/ndbapi/NdbScanFilter.cpp240
-rw-r--r--ndb/src/ndbapi/NdbScanOperation.cpp4
-rw-r--r--ndb/src/ndbapi/ndberror.c3
-rw-r--r--netware/mysql_test_run.c5
-rw-r--r--netware/mysqld_safe.c2
-rw-r--r--scripts/Makefile.am15
-rw-r--r--scripts/mysql_config.sh7
-rw-r--r--scripts/mysql_fix_privilege_tables.sh1
-rw-r--r--scripts/mysql_system_tables_data.sql3
-rw-r--r--scripts/mysqlbug.sh6
-rw-r--r--scripts/mysqld_safe-watch.sh2
-rw-r--r--scripts/mysqld_safe.sh2
-rw-r--r--server-tools/instance-manager/priv.h2
-rw-r--r--sql-common/client.c5
-rw-r--r--sql-common/my_time.c39
-rw-r--r--sql/examples/ha_tina.cc2
-rw-r--r--sql/field.cc126
-rw-r--r--sql/field.h1
-rw-r--r--sql/filesort.cc5
-rw-r--r--sql/gstream.cc2
-rw-r--r--sql/ha_federated.cc11
-rw-r--r--sql/ha_heap.cc2
-rw-r--r--sql/ha_innodb.cc50
-rw-r--r--sql/ha_innodb.h3
-rw-r--r--sql/ha_myisam.cc4
-rw-r--r--sql/ha_ndbcluster.cc46
-rw-r--r--sql/ha_ndbcluster.h9
-rw-r--r--sql/ha_ndbcluster_cond.cc20
-rw-r--r--sql/item.cc93
-rw-r--r--sql/item.h26
-rw-r--r--sql/item_cmpfunc.cc319
-rw-r--r--sql/item_cmpfunc.h16
-rw-r--r--sql/item_func.cc49
-rw-r--r--sql/item_func.h38
-rw-r--r--sql/item_geofunc.cc18
-rw-r--r--sql/item_geofunc.h7
-rw-r--r--sql/item_strfunc.cc35
-rw-r--r--sql/item_strfunc.h13
-rw-r--r--sql/item_subselect.cc13
-rw-r--r--sql/item_subselect.h1
-rw-r--r--sql/item_sum.cc42
-rw-r--r--sql/item_timefunc.cc57
-rw-r--r--sql/item_timefunc.h12
-rw-r--r--sql/log.cc11
-rw-r--r--sql/log_event.cc173
-rw-r--r--sql/log_event.h10
-rw-r--r--sql/my_decimal.cc43
-rw-r--r--sql/mysql_priv.h13
-rw-r--r--sql/mysqld.cc70
-rw-r--r--sql/opt_range.cc32
-rw-r--r--sql/opt_sum.cc10
-rw-r--r--sql/protocol.cc1
-rw-r--r--sql/records.cc3
-rw-r--r--sql/set_var.cc52
-rw-r--r--sql/set_var.h23
-rw-r--r--sql/share/errmsg.txt2
-rw-r--r--sql/slave.cc69
-rw-r--r--sql/sp.cc13
-rw-r--r--sql/sp_head.cc74
-rw-r--r--sql/sp_head.h17
-rw-r--r--sql/sp_rcontext.cc6
-rw-r--r--sql/sp_rcontext.h2
-rw-r--r--sql/sql_acl.cc188
-rw-r--r--sql/sql_acl.h5
-rw-r--r--sql/sql_array.h2
-rw-r--r--sql/sql_base.cc27
-rw-r--r--sql/sql_class.cc53
-rw-r--r--sql/sql_class.h50
-rw-r--r--sql/sql_delete.cc51
-rw-r--r--sql/sql_handler.cc68
-rw-r--r--sql/sql_help.cc2
-rw-r--r--sql/sql_insert.cc106
-rw-r--r--sql/sql_lex.h5
-rw-r--r--sql/sql_load.cc28
-rw-r--r--sql/sql_map.cc6
-rw-r--r--sql/sql_parse.cc64
-rw-r--r--sql/sql_prepare.cc2
-rw-r--r--sql/sql_repl.cc10
-rw-r--r--sql/sql_select.cc212
-rw-r--r--sql/sql_select.h8
-rw-r--r--sql/sql_table.cc34
-rw-r--r--sql/sql_udf.cc16
-rw-r--r--sql/sql_update.cc96
-rw-r--r--sql/sql_view.cc14
-rw-r--r--sql/sql_yacc.yy571
-rw-r--r--sql/structs.h2
-rw-r--r--sql/table.cc6
-rw-r--r--sql/table.h2
-rw-r--r--sql/udf_example.c35
-rw-r--r--sql/udf_example.def2
-rw-r--r--sql/unireg.cc2
-rw-r--r--strings/ctype-big5.c4
-rw-r--r--strings/ctype-euc_kr.c31
-rw-r--r--strings/ctype-gb2312.c4
-rw-r--r--strings/ctype-simple.c38
-rw-r--r--strings/ctype-sjis.c4
-rw-r--r--strings/ctype-ucs2.c24
-rw-r--r--strings/decimal.c3
-rw-r--r--strings/int2str.c16
-rw-r--r--strings/longlong2str.c32
-rw-r--r--support-files/MacOSX/ReadMe.txt8
-rw-r--r--support-files/compiler_warnings.supp6
-rw-r--r--support-files/debian/README.debian47
-rw-r--r--support-files/debian/changelog543
-rw-r--r--support-files/debian/control112
-rw-r--r--support-files/debian/copyright8
-rw-r--r--support-files/debian/gomi24
-rw-r--r--support-files/debian/libmysqlclient10.dirs1
-rw-r--r--support-files/debian/libmysqlclient10.postinst3
-rw-r--r--support-files/debian/libmysqlclient9.dirs1
-rw-r--r--support-files/debian/libmysqlclient9.postinst3
-rw-r--r--support-files/debian/move81
-rw-r--r--support-files/debian/my.cnf42
-rw-r--r--support-files/debian/mysql-bench.dirs1
-rw-r--r--support-files/debian/mysql-client.dirs3
-rw-r--r--support-files/debian/mysql-dev.dirs1
-rw-r--r--support-files/debian/mysql-doc.dirs1
-rw-r--r--support-files/debian/mysql-max-debug.dirs1
-rw-r--r--support-files/debian/mysql-max-debug.postinst3
-rw-r--r--support-files/debian/mysql-max-debug.postrm3
-rw-r--r--support-files/debian/mysql-max-shared.dirs1
-rw-r--r--support-files/debian/mysql-max-shared.postinst3
-rw-r--r--support-files/debian/mysql-max-shared.postrm3
-rw-r--r--support-files/debian/mysql-max.dirs1
-rw-r--r--support-files/debian/mysql-max.postinst3
-rw-r--r--support-files/debian/mysql-max.postrm3
-rw-r--r--support-files/debian/mysql-server-debug.dirs1
-rw-r--r--support-files/debian/mysql-server-debug.postinst3
-rw-r--r--support-files/debian/mysql-server-debug.postrm3
-rw-r--r--support-files/debian/mysql-server-shared.dirs1
-rw-r--r--support-files/debian/mysql-server-shared.postinst3
-rw-r--r--support-files/debian/mysql-server-shared.postrm3
-rw-r--r--support-files/debian/mysql-server.conffiles2
-rw-r--r--support-files/debian/mysql-server.dirs2
-rw-r--r--support-files/debian/mysql-server.postinst44
-rw-r--r--support-files/debian/mysql-server.postrm13
-rw-r--r--support-files/debian/mysql-server.prerm3
-rw-r--r--support-files/debian/patches/aa11
-rw-r--r--support-files/debian/patches/ab11
-rw-r--r--support-files/debian/patches/ac8
-rw-r--r--support-files/debian/patches/ad11
-rw-r--r--support-files/debian/patches/ae35
-rw-r--r--support-files/debian/patches/az39
-rw-r--r--support-files/debian/patches/ta68
-rw-r--r--support-files/debian/patches/tb86
-rwxr-xr-xsupport-files/debian/rules232
-rw-r--r--support-files/debian/shlibs1
-rw-r--r--support-files/mysql.server.sh2
-rw-r--r--support-files/mysql.spec.sh6
-rw-r--r--tests/mysql_client_test.c147
-rw-r--r--tests/ssl_test.c2
-rw-r--r--tests/thread_test.c8
-rwxr-xr-xwin/configure.js37
594 files changed, 20190 insertions, 16493 deletions
diff --git a/.bzrignore b/.bzrignore
index 35f5199be3c..9b90cd97d84 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -4,8 +4,6 @@
*.bb
*.bbg
*.bin
-*.vcproj.cmake
-cmake_install.cmake
*.cdf
*.core
*.d
@@ -33,6 +31,7 @@ cmake_install.cmake
*.spec
*.user
*.vcproj
+*.vcproj.cmake
*/*.dir/*
*/*_pure_*warnings
*/.deps
@@ -347,6 +346,7 @@ client/tmp.diff
client_debug/*
client_release/*
client_test
+cmake_install.cmake
cmd-line-utils/libedit/common.h
cmd-line-utils/libedit/makelist
comon.h
@@ -366,6 +366,9 @@ contrib/*.vcproj
core
core.*
core.2430
+cscope.in.out
+cscope.out
+cscope.po.out
db-*.*.*
dbug/*.ds?
dbug/*.vcproj
@@ -377,6 +380,8 @@ dbug/main.r
dbug/output*.r
dbug/user.ps
dbug/user.t
+debian/control
+debian/defs.mk
depcomp
emacs.h
examples/*.ds?
@@ -413,6 +418,7 @@ heap/hp_test2
help
help.c
help.h
+include/abi_check
include/check_abi
include/my_config.h
include/my_global.h
@@ -472,6 +478,7 @@ libmysql/release/libmysql.exp
libmysql/vio_priv.h
libmysql_r/*.c
libmysql_r/acconfig.h
+libmysql_r/client_settings.h
libmysql_r/conf_to_src
libmysql_r/my_static.h
libmysql_r/mysys_priv.h
@@ -1257,6 +1264,7 @@ support-files/mysql-3.23.29-gamma.spec
support-files/mysql-log-rotate
support-files/mysql.server
support-files/mysql.spec
+support-files/mysqld_multi.server
support-files/ndb-config-2-node.ini
tags
test/ndbapi/bank/bankCreator
@@ -1315,6 +1323,7 @@ test_xml
tests/*.ds?
tests/*.vcproj
tests/.libs -prune
+tests/bug25714
tests/client_test
tests/connect_test
tests/mysql_client_test
@@ -1342,11 +1351,3 @@ win/vs71cache.txt
win/vs8cache.txt
zlib/*.ds?
zlib/*.vcproj
-debian/control
-debian/defs.mk
-include/abi_check
-support-files/mysqld_multi.server
-tests/bug25714
-cscope.in.out
-cscope.out
-cscope.po.out
diff --git a/BUILD/compile-solaris-amd64 b/BUILD/compile-solaris-amd64
new file mode 100755
index 00000000000..f128fb12973
--- /dev/null
+++ b/BUILD/compile-solaris-amd64
@@ -0,0 +1,55 @@
+#!/usr/bin/bash
+
+function _find_mysql_root () (
+ while [ "x$PWD" != "x/" ]; do
+ # Check if some directories are present
+ if [ -d BUILD -a -d sql -a -d mysys ]; then
+ echo "$PWD"
+ return 0
+ fi
+ cd ..
+ done
+ return 1
+)
+
+make -k clean || true
+/bin/rm -f */.deps/*.P config.cache
+
+path=`dirname $0`
+. "$path/autorun.sh"
+
+warning_flags="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused"
+compiler_flags="-g -O3 -fno-omit-frame-pointer"
+
+export CC CXX CFLAGS CXXFLAGS LDFLAGS LIBS
+CC="gcc"
+CXX="gcc"
+CFLAGS="$warning_flags $compiler_flags"
+CXXFLAGS=""
+LDFLAGS="-O3 -g -static-libgcc"
+LIBS=-lmtmalloc
+root=$(_find_mysql_root)
+
+$root/configure \
+ --prefix=/usr/local/mysql \
+ --localstatedir=/usr/local/mysql/data \
+ --libexecdir=/usr/local/mysql/bin \
+ --with-extra-charsets=complex \
+ --enable-thread-safe-client \
+ --enable-local-infile \
+ --with-zlib-dir=bundled \
+ --with-big-tables \
+ --with-readline \
+ --with-archive-storage-engine \
+ --with-named-curses=-lcurses \
+ --with-big-tables \
+ --with-innodb \
+ --with-berkeley-db \
+ --with-example-storage-engine \
+ --with-blackhole-storage-engine \
+ --with-ndbcluster \
+ --with-federated-storage-engine \
+ --with-csv-storage-engine \
+ --with-ssl \
+ --with-embedded-server \
+ --disable-shared
diff --git a/BitKeeper/triggers/pre-commit.check-case.pl b/BitKeeper/triggers/pre-commit.check-case.pl
new file mode 100755
index 00000000000..4f68f8619e5
--- /dev/null
+++ b/BitKeeper/triggers/pre-commit.check-case.pl
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+my $status = 0;
+
+my $pending = $ENV{'BK_PENDING'};
+exit 0 unless -f $pending;
+
+open FI, "<", $pending || exit 0;
+while(<FI>) {
+ my ($file, $stuff) = split /\|/, $_, 2;
+ next unless -f $file;
+ $file =~ s/^(.*)\/([^\/]*)$/$2/;
+ my $path = $1;
+ opendir DIR, $path;
+ my @files = sort map { lc } readdir DIR;
+ closedir DIR;
+ my %count = ();
+ $count{$_}++ for @files;
+ @files = grep { $count{$_} > 1 } keys %count;
+ if(@files > 0) {
+ print "$path/$file: duplicate file names: " . (join " ", @files) . "\n";
+ $status = 1;
+ }
+}
+close FI;
+
+exit $status;
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e2fb39fee9a..27b2bf9b70e 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,6 +13,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7 FATAL_ERROR)
+
PROJECT(MySql)
# This reads user configuration, generated by configure.js.
@@ -109,6 +111,15 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_INIT ${CMAKE_CXX_FLAGS_INIT})
STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_DEBUG_INIT ${CMAKE_CXX_FLAGS_DEBUG_INIT})
+ # Disable automatic manifest generation.
+ STRING(REPLACE "/MANIFEST" "/MANIFEST:NO" CMAKE_EXE_LINKER_FLAGS
+ ${CMAKE_EXE_LINKER_FLAGS})
+ # Explicitly disable it since it is the default for newer versions of VS
+ STRING(REGEX MATCH "MANIFEST:NO" tmp_manifest ${CMAKE_EXE_LINKER_FLAGS})
+ IF(NOT tmp_manifest)
+ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
+ ENDIF(NOT tmp_manifest)
+
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
CMAKE_GENERATOR MATCHES "Visual Studio 8")
@@ -156,14 +167,6 @@ IF(EMBED_MANIFESTS)
MESSAGE(FATAL_ERROR "Sign tool, signtool.exe, can't be found.")
ENDIF(HAVE_SIGN_TOOL)
- # Disable automatic manifest generation.
- STRING(REPLACE "/MANIFEST" "/MANIFEST:NO" CMAKE_EXE_LINKER_FLAGS
- ${CMAKE_EXE_LINKER_FLAGS})
- # Explicitly disable it since it is the default for newer versions of VS
- STRING(REGEX MATCH "MANIFEST:NO" tmp_manifest ${CMAKE_EXE_LINKER_FLAGS})
- IF(NOT tmp_manifest)
- SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
- ENDIF(NOT tmp_manifest)
# Set the processor architecture.
IF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
SET(PROCESSOR_ARCH "amd64")
diff --git a/Docs/INSTALL-BINARY b/Docs/INSTALL-BINARY
new file mode 100644
index 00000000000..ba7e72af94d
--- /dev/null
+++ b/Docs/INSTALL-BINARY
@@ -0,0 +1,8 @@
+
+You can find information about how to install binary distributions at
+
+ http://dev.mysql.com/doc/refman/5.0/en/quick-standard-installation.html
+
+The MySQL Reference Manual is also available in various formats on
+http://dev.mysql.com/doc; if you're interested in the DocBook XML
+sources go to http://svn.mysql.com.
diff --git a/Docs/Makefile.am b/Docs/Makefile.am
index 369e02e4654..dac256f8fd6 100644
--- a/Docs/Makefile.am
+++ b/Docs/Makefile.am
@@ -13,14 +13,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-noinst_SCRIPTS = Support/generate-text-files.pl
-
-EXTRA_DIST = $(noinst_SCRIPTS) manual.chm mysql.info INSTALL-BINARY
-
-TXT_FILES= ../INSTALL-SOURCE ../INSTALL-WIN-SOURCE \
- INSTALL-BINARY ../support-files/MacOSX/ReadMe.txt
-
-all-local: $(TXT_FILES)
+EXTRA_DIST = mysql.info INSTALL-BINARY
# make sure that "make install" installs the info page, too
# automake only seems to take care of this automatically,
@@ -32,31 +25,5 @@ install-data-hook: $(srcdir)/mysql.info
uninstall-local:
@RM@ -f $(DESTDIR)$(infodir)/mysql.info
-# Problems with "make distclean", works differently for make files
-# generated by different versions of the automake. Some require the
-# generated files explicitly in DISTCLEANFILES.
-DISTCLEANFILES = $(TXT_FILES)
-
-# This target is not used in builds, just for convinience
-CLEAN_FILES: $(TXT_FILES)
- touch $(TXT_FILES)
-
-GT = $(srcdir)/Support/generate-text-files.pl
-
-../INSTALL-SOURCE: $(srcdir)/mysql.info $(GT)
- perl -w $(GT) $(srcdir)/mysql.info "installing-source" "windows-source-build" > $@
-
-../INSTALL-WIN-SOURCE: $(srcdir)/mysql.info $(GT)
- perl -w $(GT) $(srcdir)/mysql.info "windows-source-build" "post-installation" > $@
-
-# We put the description for the binary installation here so that
-# people who download source wont have to see it. It is moved up to
-# the toplevel by the script that makes the binary tar files.
-INSTALL-BINARY: $(srcdir)/mysql.info $(GT)
- perl -w $(GT) $(srcdir)/mysql.info "installing-binary" "installing-source" > $@
-
-../support-files/MacOSX/ReadMe.txt: $(srcdir)/mysql.info $(GT)
- perl -w $(GT) $(srcdir)/mysql.info "mac-os-x-installation" "netware-installation" > $@
-
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/Docs/Support/generate-text-files.pl b/Docs/Support/generate-text-files.pl
deleted file mode 100755
index 69e0478eb8a..00000000000
--- a/Docs/Support/generate-text-files.pl
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/perl -w -*- perl -*-
-# Copyright (C) 2000, 2003, 2005 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-# Generate text files from top directory from the manual.
-
-$from = shift(@ARGV);
-$fnode = shift(@ARGV);
-$tnode = shift(@ARGV);
-
-open(IN, "$from") || die "Cannot open $from: $!";
-
-$in = 0;
-
-while (<IN>)
-{
- if ($in)
- {
- if (/Node: $tnode,/ || /\[index/)
- {
- $in = 0;
- }
- elsif (/^File: mysql.info/ || (/^/))
- {
- # Just Skip node beginnings
- }
- else
- {
- print;
- }
- }
- else
- {
- if (/Node: $fnode,/)
- {
- $in = 1;
- # Skip first empty line
- <IN>;
- }
- }
-}
-
-close(IN);
-
-die "Could not find node \"$tnode\"" if ($in == 1);
-exit 0;
diff --git a/Docs/manual.chm b/Docs/manual.chm
deleted file mode 100644
index 28c3e1b5a86..00000000000
--- a/Docs/manual.chm
+++ /dev/null
@@ -1,14 +0,0 @@
-
-*********************************************************
-
-This is a dummy placeholder file for "manual.chm" in the
-MySQL source trees.
-
-Note, that the documentation has been moved into a separate
-BitKeeper source tree named "mysqldoc" - do not attempt to edit this
-file! All changes to it should be done in the mysqldoc tree.
-
-This dummy file is being replaced with the actual file from the
-mysqldoc tree when building the official source distribution.
-
-*********************************************************
diff --git a/Docs/mysql.info b/Docs/mysql.info
index 5846d7aadf6..b2c411e51ab 100644
--- a/Docs/mysql.info
+++ b/Docs/mysql.info
@@ -1,27 +1,4 @@
-This is mysql.info, produced by makeinfo version 4.8 from manual.texi.
-START-INFO-DIR-ENTRY
-* mysql: (mysql). MySQL documentation.
-END-INFO-DIR-ENTRY
-
-
-File: mysql.info, Node: Top, Next: (dir), Prev: (dir), Up: (dir)
-
-This is an empty placeholder file for the MySQL manual.
-
-The MySQL manual is now maintained in a separate BitKeeper source tree!
-Please see `http://www.mysql.com/doc/en/Installing_source_tree.html'
-for more info on how to work with BitKeeper.
-
-This file will be replaced with the current `mysql.info' when building
-the official source distribution.
-
-You can find a specific manual for any older version of MySQL in the
-binary or source distribution for that version.
-
-
-
-Tag Table:
-Node: Top166
-
-End Tag Table
+The MySQL Reference Manual is available in various formats on
+http://dev.mysql.com/doc; if you're interested in the DocBook XML
+sources go to http://svn.mysql.com.
diff --git a/INSTALL-SOURCE b/INSTALL-SOURCE
new file mode 100644
index 00000000000..3d9d7d41114
--- /dev/null
+++ b/INSTALL-SOURCE
@@ -0,0 +1,8 @@
+
+You can find information about how to install from a source distributions at
+
+ http://dev.mysql.com/doc/refman/5.0/en/installing-source.html
+
+The MySQL Reference Manual is also available in various formats on
+http://dev.mysql.com/doc; if you're interested in the DocBook XML
+sources go to http://svn.mysql.com.
diff --git a/INSTALL-WIN-SOURCE b/INSTALL-WIN-SOURCE
new file mode 100644
index 00000000000..2478e2cf609
--- /dev/null
+++ b/INSTALL-WIN-SOURCE
@@ -0,0 +1,9 @@
+
+You can find information about how to install from a Windows source
+distributions at
+
+ http://dev.mysql.com/doc/refman/5.0/en/windows-source-build.html
+
+The MySQL Reference Manual is also available in various formats on
+http://dev.mysql.com/doc; if you're interested in the DocBook XML
+sources go to http://svn.mysql.com.
diff --git a/Makefile.am b/Makefile.am
index 3e706fee80c..c1bdbb22e8e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -33,7 +33,7 @@ DIST_SUBDIRS = . include @docs_dirs@ zlib \
@thread_dirs@ pstack \
@sql_union_dirs@ scripts @man_dirs@ tests SSL\
BUILD netware os2 @libmysqld_dirs@ \
- @bench_dirs@ support-files @tools_dirs@ win debian
+ @bench_dirs@ support-files @tools_dirs@ win
# Run these targets before any others, also make part of clean target,
# to make sure we create new links after a clean.
diff --git a/client/client_priv.h b/client/client_priv.h
index 418bf86f2c8..8f509fa0763 100644
--- a/client/client_priv.h
+++ b/client/client_priv.h
@@ -51,5 +51,5 @@ enum options_client
OPT_TRIGGERS,
OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE,
OPT_TZ_UTC, OPT_AUTO_CLOSE, OPT_SSL_VERIFY_SERVER_CERT,
- OPT_DEBUG_INFO, OPT_ERROR_LOG_FILE
+ OPT_DEBUG_INFO, OPT_ERROR_LOG_FILE, OPT_DUMP_DATE
};
diff --git a/client/mysql.cc b/client/mysql.cc
index 8e1b6c2a9b4..2162e4bc25e 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -140,6 +140,7 @@ static my_bool info_flag=0,ignore_errors=0,wait_flag=0,quick=0,
default_pager_set= 0, opt_sigint_ignore= 0,
show_warnings= 0;
static volatile int executing_query= 0, interrupted_query= 0;
+static my_bool preserve_comments= 0;
static ulong opt_max_allowed_packet, opt_net_buffer_length;
static uint verbose=0,opt_silent=0,opt_mysql_port=0, opt_local_infile=0;
static my_string opt_mysql_unix_port=0;
@@ -673,9 +674,14 @@ static struct my_option my_long_options[] =
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port,
- (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
- 0},
+ {"port", 'P', "Port number to use for connection or 0 for default to, in "
+ "order of preference, my.cnf, $MYSQL_TCP_PORT, "
+#if MYSQL_PORT_DEFAULT == 0
+ "/etc/services, "
+#endif
+ "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
+ (gptr*) &opt_mysql_port,
+ (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"prompt", OPT_PROMPT, "Set the mysql prompt to this value.",
(gptr*) &current_prompt, (gptr*) &current_prompt, 0, GET_STR_ALLOC,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -754,6 +760,10 @@ static struct my_option my_long_options[] =
{"show-warnings", OPT_SHOW_WARNINGS, "Show warnings after every statement.",
(gptr*) &show_warnings, (gptr*) &show_warnings, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
+ {"comments", 'c', "Preserve comments. Send comments to the server."
+ " Comments are discarded by default, enable with --enable-comments",
+ (gptr*) &preserve_comments, (gptr*) &preserve_comments,
+ 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -1042,6 +1052,17 @@ static int read_and_execute(bool interactive)
if (!interactive)
{
line=batch_readline(status.line_buff);
+ /*
+ Skip UTF8 Byte Order Marker (BOM) 0xEFBBBF.
+ Editors like "notepad" put this marker in
+ the very beginning of a text file when
+ you save the file using "Unicode UTF-8" format.
+ */
+ if (!line_number &&
+ (uchar) line[0] == 0xEF &&
+ (uchar) line[1] == 0xBB &&
+ (uchar) line[2] == 0xBF)
+ line+= 3;
line_number++;
if (!glob_buffer.length())
status.query_start_line=line_number;
@@ -1131,10 +1152,6 @@ static int read_and_execute(bool interactive)
status.exit_status=0;
break;
}
- if (!in_string && (line[0] == '#' ||
- (line[0] == '-' && line[1] == '-') ||
- line[0] == 0))
- continue; // Skip comment lines
/*
Check if line is a mysql command line
@@ -1260,15 +1277,21 @@ static bool add_line(String &buffer,char *line,char *in_string,
for (pos=out=line ; (inchar= (uchar) *pos) ; pos++)
{
- if (my_isspace(charset_info,inchar) && out == line &&
- buffer.is_empty())
- continue;
+ if (!preserve_comments)
+ {
+ // Skip spaces at the beggining of a statement
+ if (my_isspace(charset_info,inchar) && (out == line) &&
+ buffer.is_empty())
+ continue;
+ }
+
#ifdef USE_MB
+ // Accept multi-byte characters as-is
int length;
if (use_mb(charset_info) &&
(length= my_ismbchar(charset_info, pos, end_of_line)))
{
- if (!*ml_comment)
+ if (!*ml_comment || preserve_comments)
{
while (length--)
*out++ = *pos++;
@@ -1294,8 +1317,13 @@ static bool add_line(String &buffer,char *line,char *in_string,
}
if ((com=find_command(NullS,(char) inchar)))
{
- const String tmp(line,(uint) (out-line), charset_info);
- buffer.append(tmp);
+ // Flush previously accepted characters
+ if (out != line)
+ {
+ buffer.append(line, (uint) (out-line));
+ out= line;
+ }
+
if ((*com->func)(&buffer,pos-1) > 0)
DBUG_RETURN(1); // Quit
if (com->takes_params)
@@ -1323,7 +1351,6 @@ static bool add_line(String &buffer,char *line,char *in_string,
pos+= delimiter_length - 1; // Point at last delim char
}
}
- out=line;
}
else
{
@@ -1336,46 +1363,105 @@ static bool add_line(String &buffer,char *line,char *in_string,
}
}
else if (!*ml_comment && !*in_string &&
- (*pos == *delimiter && is_prefix(pos + 1, delimiter + 1) ||
- buffer.length() == 0 && (out - line) >= 9 &&
- !my_strcasecmp(charset_info, line, "delimiter")))
- {
- uint old_delimiter_length= delimiter_length;
+ strlen(pos) >= 10 &&
+ !my_strnncoll(charset_info, (uchar*) pos, 10,
+ (const uchar*) "delimiter ", 10))
+ {
+ // Flush previously accepted characters
if (out != line)
- buffer.append(line, (uint) (out - line)); // Add this line
+ {
+ buffer.append(line, (uint32) (out - line));
+ out= line;
+ }
+
+ // Flush possible comments in the buffer
+ if (!buffer.is_empty())
+ {
+ if (com_go(&buffer, 0) > 0) // < 0 is not fatal
+ DBUG_RETURN(1);
+ buffer.length(0);
+ }
+
+ /*
+ Delimiter wants the get rest of the given line as argument to
+ allow one to change ';' to ';;' and back
+ */
+ buffer.append(pos);
+ if (com_delimiter(&buffer, pos) > 0)
+ DBUG_RETURN(1);
+
+ buffer.length(0);
+ break;
+ }
+ else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter))
+ {
+ // Found a statement. Continue parsing after the delimiter
+ pos+= delimiter_length;
+
+ if (preserve_comments)
+ {
+ while (my_isspace(charset_info, *pos))
+ *out++= *pos++;
+ }
+ // Flush previously accepted characters
+ if (out != line)
+ {
+ buffer.append(line, (uint32) (out-line));
+ out= line;
+ }
+
+ if (preserve_comments && ((*pos == '#') ||
+ ((*pos == '-') &&
+ (pos[1] == '-') &&
+ my_isspace(charset_info, pos[2]))))
+ {
+ // Add trailing single line comments to this statement
+ buffer.append(pos);
+ pos+= strlen(pos);
+ }
+
+ pos--;
+
if ((com= find_command(buffer.c_ptr(), 0)))
{
- if (com->func == com_delimiter)
- {
- /*
- Delimiter wants the get rest of the given line as argument to
- allow one to change ';' to ';;' and back
- */
- char *end= strend(pos);
- buffer.append(pos, (uint) (end - pos));
- /* Ensure pos will point at \0 after the pos+= below */
- pos= end - old_delimiter_length + 1;
- }
- if ((*com->func)(&buffer, buffer.c_ptr()) > 0)
- DBUG_RETURN(1); // Quit
+
+ if ((*com->func)(&buffer, buffer.c_ptr()) > 0)
+ DBUG_RETURN(1); // Quit
}
else
{
- if (com_go(&buffer, 0) > 0) // < 0 is not fatal
- DBUG_RETURN(1);
+ if (com_go(&buffer, 0) > 0) // < 0 is not fatal
+ DBUG_RETURN(1);
}
buffer.length(0);
- out= line;
- pos+= old_delimiter_length - 1;
}
else if (!*ml_comment && (!*in_string && (inchar == '#' ||
inchar == '-' && pos[1] == '-' &&
my_isspace(charset_info,pos[2]))))
- break; // comment to end of line
+ {
+ // Flush previously accepted characters
+ if (out != line)
+ {
+ buffer.append(line, (uint32) (out - line));
+ out= line;
+ }
+
+ // comment to end of line
+ if (preserve_comments)
+ buffer.append(pos);
+
+ break;
+ }
else if (!*in_string && inchar == '/' && *(pos+1) == '*' &&
*(pos+2) != '!')
{
- pos++;
+ if (preserve_comments)
+ {
+ *out++= *pos++; // copy '/'
+ *out++= *pos; // copy '*'
+ }
+ else
+ pos++;
*ml_comment= 1;
if (out != line)
{
@@ -1385,8 +1471,21 @@ static bool add_line(String &buffer,char *line,char *in_string,
}
else if (*ml_comment && !ss_comment && inchar == '*' && *(pos + 1) == '/')
{
- pos++;
+ if (preserve_comments)
+ {
+ *out++= *pos++; // copy '*'
+ *out++= *pos; // copy '/'
+ }
+ else
+ pos++;
*ml_comment= 0;
+ if (out != line)
+ {
+ buffer.append(line, (uint32) (out - line));
+ out= line;
+ }
+ // Consumed a 2 chars or more, and will add 1 at most,
+ // so using the 'line' buffer to edit data in place is ok.
need_space= 1;
}
else
@@ -1401,14 +1500,12 @@ static bool add_line(String &buffer,char *line,char *in_string,
else if (!*ml_comment && !*in_string &&
(inchar == '\'' || inchar == '"' || inchar == '`'))
*in_string= (char) inchar;
- if (!*ml_comment)
+ if (!*ml_comment || preserve_comments)
{
if (need_space && !my_isspace(charset_info, (char)inchar))
- {
*out++= ' ';
- need_space= 0;
- }
- *out++= (char) inchar;
+ need_space= 0;
+ *out++= (char) inchar;
}
}
}
@@ -1418,7 +1515,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
uint length=(uint) (out-line);
if (buffer.length() + length >= buffer.alloced_length())
buffer.realloc(buffer.length()+length+IO_SIZE);
- if (!(*ml_comment) && buffer.append(line,length))
+ if ((!*ml_comment || preserve_comments) && buffer.append(line, length))
DBUG_RETURN(1);
}
DBUG_RETURN(0);
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index fb30c6f2613..02829cd2178 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -88,8 +88,13 @@ static struct my_option my_long_options[]=
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"port", 'P', "Port number to use for connection.", 0,
- 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"port", 'P', "Port number to use for connection or 0 for default to, in "
+ "order of preference, my.cnf, $MYSQL_TCP_PORT, "
+#if MYSQL_PORT_DEFAULT == 0
+ "/etc/services, "
+#endif
+ "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
+ 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 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},
@@ -451,7 +456,11 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
if (my_write(fd, query, strlen(query),
MYF(MY_FNABP | MY_WME)))
+ {
+ my_close(fd, MYF(0));
+ my_delete(query_file_path, MYF(0));
die("Failed to write to '%s'", query_file_path);
+ }
ret= run_tool(mysql_path,
ds_res,
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc
index c7033f6914f..54f67c5df2d 100644
--- a/client/mysqladmin.cc
+++ b/client/mysqladmin.cc
@@ -159,7 +159,13 @@ static struct my_option my_long_options[] =
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"port", 'P', "Port number to use for connection.", (gptr*) &tcp_port,
+ {"port", 'P', "Port number to use for connection or 0 for default to, in "
+ "order of preference, my.cnf, $MYSQL_TCP_PORT, "
+#if MYSQL_PORT_DEFAULT == 0
+ "/etc/services, "
+#endif
+ "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
+ (gptr*) &tcp_port,
(gptr*) &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 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},
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index a371981e24d..3d06a21c243 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -687,9 +687,14 @@ static struct my_option my_long_options[] =
0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p', "Password to connect to remote server.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"port", 'P', "Use port to connect to the remote server.",
- (gptr*) &port, (gptr*) &port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0,
- 0, 0, 0},
+ {"port", 'P', "Port number to use for connection or 0 for default to, in "
+ "order of preference, my.cnf, $MYSQL_TCP_PORT, "
+#if MYSQL_PORT_DEFAULT == 0
+ "/etc/services, "
+#endif
+ "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
+ (gptr*) &port, (gptr*) &port, 0, GET_INT, REQUIRED_ARG,
+ 0, 0, 0, 0, 0, 0},
{"position", 'j', "Deprecated. Use --start-position instead.",
(gptr*) &start_position, (gptr*) &start_position, 0, GET_ULL,
REQUIRED_ARG, BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE,
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index 2c23a0bdd14..a24d3d8f535 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -123,7 +123,13 @@ static struct my_option my_long_options[] =
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port,
+ {"port", 'P', "Port number to use for connection or 0 for default to, in "
+ "order of preference, my.cnf, $MYSQL_TCP_PORT, "
+#if MYSQL_PORT_DEFAULT == 0
+ "/etc/services, "
+#endif
+ "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
+ (gptr*) &opt_mysql_port,
(gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
0},
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
@@ -180,6 +186,7 @@ static void dbDisconnect(char *host);
static void DBerror(MYSQL *mysql, const char *when);
static void safe_exit(int error);
static void print_result();
+static uint fixed_name_length(const char *name);
static char *fix_table_name(char *dest, char *src);
int what_to_do = 0;
@@ -403,14 +410,14 @@ static int process_selected_tables(char *db, char **table_names, int tables)
{
/*
We need table list in form `a`, `b`, `c`
- that's why we need 4 more chars added to to each table name
+ that's why we need 2 more chars added to to each table name
space is for more readable output in logs and in case of error
*/
char *table_names_comma_sep, *end;
int i, tot_length = 0;
for (i = 0; i < tables; i++)
- tot_length += strlen(*(table_names + i)) + 4;
+ tot_length+= fixed_name_length(*(table_names + i)) + 2;
if (!(table_names_comma_sep = (char *)
my_malloc((sizeof(char) * tot_length) + 4, MYF(MY_WME))))
@@ -428,23 +435,46 @@ static int process_selected_tables(char *db, char **table_names, int tables)
}
else
for (; tables > 0; tables--, table_names++)
- handle_request_for_tables(*table_names, strlen(*table_names));
+ handle_request_for_tables(*table_names, fixed_name_length(*table_names));
return 0;
} /* process_selected_tables */
-static char *fix_table_name(char *dest, char *src)
+static uint fixed_name_length(const char *name)
{
- char *db_sep;
+ const char *p;
+ uint extra_length= 2; /* count the first/last backticks */
+
+ for (p= name; *p; p++)
+ {
+ if (*p == '`')
+ extra_length++;
+ else if (*p == '.')
+ extra_length+= 2;
+ }
+ return (p - name) + extra_length;
+}
+
+static char *fix_table_name(char *dest, char *src)
+{
*dest++= '`';
- if ((db_sep= strchr(src, '.')))
+ for (; *src; src++)
{
- dest= strmake(dest, src, (uint) (db_sep - src));
- dest= strmov(dest, "`.`");
- src= db_sep + 1;
+ switch (*src) {
+ case '.': /* add backticks around '.' */
+ *dest++= '`';
+ *dest++= '.';
+ *dest++= '`';
+ break;
+ case '`': /* escape backtick character */
+ *dest++= '`';
+ /* fall through */
+ default:
+ *dest++= *src;
+ }
}
- dest= strxmov(dest, src, "`", NullS);
+ *dest++= '`';
return dest;
}
@@ -468,7 +498,7 @@ static int process_all_tables_in_db(char *database)
{
/*
We need table list in form `a`, `b`, `c`
- that's why we need 4 more chars added to to each table name
+ that's why we need 2 more chars added to to each table name
space is for more readable output in logs and in case of error
*/
@@ -476,7 +506,7 @@ static int process_all_tables_in_db(char *database)
uint tot_length = 0;
while ((row = mysql_fetch_row(res)))
- tot_length += strlen(row[0]) + 4;
+ tot_length+= fixed_name_length(row[0]) + 2;
mysql_data_seek(res, 0);
if (!(tables=(char *) my_malloc(sizeof(char)*tot_length+4, MYF(MY_WME))))
@@ -504,7 +534,7 @@ static int process_all_tables_in_db(char *database)
if ((num_columns == 2) && (strcmp(row[1], "VIEW") == 0))
continue;
- handle_request_for_tables(row[0], strlen(row[0]));
+ handle_request_for_tables(row[0], fixed_name_length(row[0]));
}
}
mysql_free_result(res);
@@ -738,7 +768,7 @@ int main(int argc, char **argv)
for (i = 0; i < tables4repair.elements ; i++)
{
char *name= (char*) dynamic_array_ptr(&tables4repair, i);
- handle_request_for_tables(name, strlen(name));
+ handle_request_for_tables(name, fixed_name_length(name));
}
}
end:
diff --git a/client/mysqldump.c b/client/mysqldump.c
index cc8458c7a8e..980013d539a 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -89,7 +89,7 @@ static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 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_lock_all_tables=0,
- opt_set_charset=0,
+ opt_set_charset=0, opt_dump_date=1,
opt_autocommit=0,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,
@@ -361,7 +361,13 @@ static struct my_option my_long_options[] =
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port,
+ {"port", 'P', "Port number to use for connection or 0 for default to, in "
+ "order of preference, my.cnf, $MYSQL_TCP_PORT, "
+#if MYSQL_PORT_DEFAULT == 0
+ "/etc/services, "
+#endif
+ "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
+ (gptr*) &opt_mysql_port,
(gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
0},
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
@@ -398,10 +404,17 @@ static struct my_option my_long_options[] =
"Creates a consistent snapshot by dumping all tables in a single "
"transaction. Works ONLY for tables stored in storage engines which "
"support multiversioning (currently only InnoDB does); the dump is NOT "
- "guaranteed to be consistent for other storage engines. Option "
- "automatically turns off --lock-tables.",
+ "guaranteed to be consistent for other storage engines. "
+ "While a --single-transaction dump is in process, to ensure a valid "
+ "dump file (correct table contents and binary log position), no other "
+ "connection should use the following statements: ALTER TABLE, DROP "
+ "TABLE, RENAME TABLE, TRUNCATE TABLE, as consistent snapshot is not "
+ "isolated from them. Option automatically turns off --lock-tables.",
(gptr*) &opt_single_transaction, (gptr*) &opt_single_transaction, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"dump-date", OPT_DUMP_DATE, "Put a dump date to the end of the output.",
+ (gptr*) &opt_dump_date, (gptr*) &opt_dump_date, 0,
+ GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"skip-opt", OPT_SKIP_OPTIMIZATION,
"Disable --opt. Disables --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -623,10 +636,15 @@ static void write_footer(FILE *sql_file)
fputs("\n", sql_file);
if (opt_comments)
{
- char time_str[20];
- get_date(time_str, GETDATE_DATE_TIME, 0);
- fprintf(sql_file, "-- Dump completed on %s\n",
- time_str);
+ if (opt_dump_date)
+ {
+ char time_str[20];
+ get_date(time_str, GETDATE_DATE_TIME, 0);
+ fprintf(sql_file, "-- Dump completed on %s\n",
+ time_str);
+ }
+ else
+ fprintf(sql_file, "-- Dump completed\n");
}
check_io(sql_file);
}
@@ -3346,6 +3364,18 @@ static int start_transaction(MYSQL *mysql_con)
need the REPEATABLE READ level (not anything lower, for example READ
COMMITTED would give one new consistent read per dumped table).
*/
+ if ((mysql_get_server_version(mysql_con) < 40100) && opt_master_data)
+ {
+ fprintf(stderr, "-- %s: the combination of --single-transaction and "
+ "--master-data requires a MySQL server version of at least 4.1 "
+ "(current server's version is %s). %s\n",
+ ignore_errors ? "Warning" : "Error",
+ mysql_con->server_version ? mysql_con->server_version : "unknown",
+ ignore_errors ? "Continuing due to --force, backup may not be consistent across all tables!" : "Aborting.");
+ if (!ignore_errors)
+ exit(EX_MYSQLERR);
+ }
+
return (mysql_query_with_error_report(mysql_con, 0,
"SET SESSION TRANSACTION ISOLATION "
"LEVEL REPEATABLE READ") ||
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index e7bf1cfd889..066e892f78a 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -119,7 +119,13 @@ static struct my_option my_long_options[] =
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port,
+ {"port", 'P', "Port number to use for connection or 0 for default to, in "
+ "order of preference, my.cnf, $MYSQL_TCP_PORT, "
+#if MYSQL_PORT_DEFAULT == 0
+ "/etc/services, "
+#endif
+ "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
+ (gptr*) &opt_mysql_port,
(gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
0},
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
diff --git a/client/mysqlmanagerc.c b/client/mysqlmanagerc.c
index 1fdedab97fb..b4cc6320047 100644
--- a/client/mysqlmanagerc.c
+++ b/client/mysqlmanagerc.c
@@ -49,7 +49,12 @@ static struct my_option my_long_options[] =
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"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,
+ {"port", 'P', "Port number to use for connection or 0 for default to, in "
+ "order of preference, my.cnf, $MYSQL_TCP_PORT, "
+#if MYSQL_PORT_DEFAULT == 0
+ "/etc/services, "
+#endif
+ "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", (gptr*) &port,
(gptr*) &port, 0, GET_UINT, REQUIRED_ARG, MYSQL_MANAGER_PORT, 0, 0, 0, 0,
0},
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
diff --git a/client/mysqlshow.c b/client/mysqlshow.c
index 5be01cc5a52..7b1835055f5 100644
--- a/client/mysqlshow.c
+++ b/client/mysqlshow.c
@@ -188,7 +188,13 @@ static struct my_option my_long_options[] =
{"password", 'p',
"Password to use when connecting to server. If password is not given it's asked from the tty.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port,
+ {"port", 'P', "Port number to use for connection or 0 for default to, in "
+ "order of preference, my.cnf, $MYSQL_TCP_PORT, "
+#if MYSQL_PORT_DEFAULT == 0
+ "/etc/services, "
+#endif
+ "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
+ (gptr*) &opt_mysql_port,
(gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
0},
#ifdef __WIN__
diff --git a/client/mysqltest.c b/client/mysqltest.c
index b2b579528ae..e5ae9e80a88 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -1580,10 +1580,21 @@ void check_result(DYNAMIC_STRING* ds)
and then show the diff
*/
char reject_file[FN_REFLEN];
- str_to_file(fn_format(reject_file, result_file_name, opt_logdir, ".reject",
- *opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT :
- MY_REPLACE_EXT),
- ds->str, ds->length);
+ dirname_part(reject_file, result_file_name);
+
+ if (access(reject_file, W_OK) == 0)
+ {
+ /* Result file directory is writable, save reject file there */
+ fn_format(reject_file, result_file_name, NULL,
+ ".reject", MY_REPLACE_EXT);
+ }
+ else
+ {
+ /* Put reject file in opt_logdir */
+ fn_format(reject_file, result_file_name, opt_logdir,
+ ".reject", MY_REPLACE_DIR | MY_REPLACE_EXT);
+ }
+ str_to_file(reject_file, ds->str, ds->length);
dynstr_set(ds, NULL); /* Don't create a .log file */
@@ -2664,7 +2675,7 @@ void do_copy_file(struct st_command *command)
command command handle
DESCRIPTION
- chmod_file <octal> <file_name>
+ chmod <octal> <file_name>
Change file permission of <file_name>
*/
@@ -4947,7 +4958,13 @@ static struct my_option my_long_options[] =
GET_INT, REQUIRED_ARG, 500, 1, 10000, 0, 0, 0},
{"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*) &opt_port,
+ {"port", 'P', "Port number to use for connection or 0 for default to, in "
+ "order of preference, my.cnf, $MYSQL_TCP_PORT, "
+#if MYSQL_PORT_DEFAULT == 0
+ "/etc/services, "
+#endif
+ "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
+ (gptr*) &opt_port,
(gptr*) &opt_port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"ps-protocol", OPT_PS_PROTOCOL, "Use prepared statements protocol for communication",
(gptr*) &ps_protocol, (gptr*) &ps_protocol, 0,
diff --git a/cmd-line-utils/libedit/Makefile.am b/cmd-line-utils/libedit/Makefile.am
index b7611193aea..bb4b40180d1 100644
--- a/cmd-line-utils/libedit/Makefile.am
+++ b/cmd-line-utils/libedit/Makefile.am
@@ -5,8 +5,7 @@
ASRC = $(srcdir)/vi.c $(srcdir)/emacs.c $(srcdir)/common.c
AHDR = vi.h emacs.h common.h
-# Make sure to include stuff from this directory first, to get right "config.h"
-INCLUDES = -I. -I$(top_builddir)/include -I$(top_srcdir)/include
+INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include
noinst_LIBRARIES = libedit.a
@@ -31,7 +30,14 @@ EXTRA_DIST = makelist.sh np/unvis.c np/strlcpy.c np/vis.c np/vis.h np/strlcat.c
CLEANFILES = makelist common.h emacs.h vi.h fcns.h help.h fcns.c help.c
-DEFS = -DUNDEF_THREADS_HACK -DHAVE_CONFIG_H -DNO_KILL_INTR
+# Make sure to include stuff from this directory first, to get right "config.h"
+# Automake puts into DEFAULT_INCLUDES this source and corresponding
+# build directory together with ../../include to let all make files
+# find the central "config.h". This variable is used before INCLUDES
+# above. But in automake 1.10 the order of these are changed. Put the
+# includes of this directory into DEFS to always be sure it is first
+# before DEFAULT_INCLUDES on the compile line.
+DEFS = -DUNDEF_THREADS_HACK -DHAVE_CONFIG_H -DNO_KILL_INTR -I. -I$(srcdir)
SUFFIXES = .sh
diff --git a/cmd-line-utils/readline/INSTALL b/cmd-line-utils/readline/INSTALL
index cb4a06fb701..f360b9e7907 100644
--- a/cmd-line-utils/readline/INSTALL
+++ b/cmd-line-utils/readline/INSTALL
@@ -1,7 +1,7 @@
Basic Installation
==================
-These are installation instructions for Readline-5.0.
+These are installation instructions for Readline-5.2.
The simplest way to compile readline is:
@@ -238,6 +238,9 @@ SHLIB_XLDFLAGS Additional flags to pass to SHOBJ_LD for shared library
SHLIB_LIBS Any additional libraries that shared libraries should be
linked against when they are created.
+SHLIB_LIBPREF The prefix to use when generating the filename of the shared
+ library. The default is `lib'; Cygwin uses `cyg'.
+
SHLIB_LIBSUFF The suffix to add to `libreadline' and `libhistory' when
generating the filename of the shared library. Many systems
use `so'; HP-UX uses `sl'.
@@ -254,6 +257,17 @@ SHLIB_LIBVERSION The string to append to the filename to indicate the version
numbers; use `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' on those systems.
Other Unix versions use different schemes.
+SHLIB_DLLVERSION The version number for shared libraries that determines API
+ compatibility between readline versions and the underlying
+ system. Used only on Cygwin. Defaults to $SHLIB_MAJOR, but
+ can be overridden at configuration time by defining DLLVERSION
+ in the environment.
+
+SHLIB_DOT The character used to separate the name of the shared library
+ from the suffix and version information. The default is `.';
+ systems like Cygwin which don't separate version information
+ from the library name should set this to the empty string.
+
SHLIB_STATUS Set this to `supported' when you have defined the other
necessary variables. Make uses this to determine whether
or not shared library creation should be attempted. If
diff --git a/cmd-line-utils/readline/README b/cmd-line-utils/readline/README
index ac4e3a767f9..8da99626aa1 100644
--- a/cmd-line-utils/readline/README
+++ b/cmd-line-utils/readline/README
@@ -1,7 +1,7 @@
Introduction
============
-This is the Gnu Readline library, version 5.0.
+This is the Gnu Readline library, version 5.2.
The Readline library provides a set of functions for use by applications
that allow users to edit command lines as they are typed in. Both
@@ -102,6 +102,9 @@ SHLIB_XLDFLAGS Additional flags to pass to SHOBJ_LD for shared library
SHLIB_LIBS Any additional libraries that shared libraries should be
linked against when they are created.
+SHLIB_LIBPREF The prefix to use when generating the filename of the shared
+ library. The default is `lib'; Cygwin uses `cyg'.
+
SHLIB_LIBSUFF The suffix to add to `libreadline' and `libhistory' when
generating the filename of the shared library. Many systems
use `so'; HP-UX uses `sl'.
@@ -118,6 +121,17 @@ SHLIB_LIBVERSION The string to append to the filename to indicate the version
numbers; use `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' on those systems.
Other Unix versions use different schemes.
+SHLIB_DLLVERSION The version number for shared libraries that determines API
+ compatibility between readline versions and the underlying
+ system. Used only on Cygwin. Defaults to $SHLIB_MAJOR, but
+ can be overridden at configuration time by defining DLLVERSION
+ in the environment.
+
+SHLIB_DOT The character used to separate the name of the shared library
+ from the suffix and version information. The default is `.';
+ systems like Cygwin which don't separate version information
+ from the library name should set this to the empty string.
+
SHLIB_STATUS Set this to `supported' when you have defined the other
necessary variables. Make uses this to determine whether
or not shared library creation should be attempted.
@@ -169,4 +183,4 @@ list (mirrored to the Usenet newsgroup gnu.bash.bug) often contains
Readline bug reports and fixes.
Chet Ramey
-chet@po.cwru.edu
+chet.ramey@case.edu
diff --git a/cmd-line-utils/readline/bind.c b/cmd-line-utils/readline/bind.c
index 568c3e8776a..08c906bfcc3 100644
--- a/cmd-line-utils/readline/bind.c
+++ b/cmd-line-utils/readline/bind.c
@@ -1,6 +1,6 @@
/* bind.c -- key binding and startup file support for the readline library. */
-/* Copyright (C) 1987, 1989, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2006 Free Software Foundation, Inc.
This file is part of the GNU Readline Library, a library for
reading lines of text with interactive input and history editing.
@@ -26,7 +26,9 @@
# include <floss.h>
#endif
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#include <stdio.h>
#include <sys/types.h>
@@ -75,6 +77,9 @@ static char *_rl_read_file PARAMS((char *, size_t *));
static void _rl_init_file_error PARAMS((const char *));
static int _rl_read_init_file PARAMS((const char *, int));
static int glean_key_from_name PARAMS((char *));
+static int find_boolean_var PARAMS((const char *));
+
+static char *_rl_get_string_variable_value PARAMS((const char *));
static int substring_member_of_array PARAMS((char *, const char **));
static int currently_reading_init_file;
@@ -337,10 +342,9 @@ rl_generic_bind (type, keyseq, data, map)
KEYMAP_ENTRY k;
k.function = 0;
- k.type= 0;
/* If no keys to bind to, exit right away. */
- if (!keyseq || !*keyseq)
+ if (keyseq == 0 || *keyseq == 0)
{
if (type == ISMACR)
free (data);
@@ -366,9 +370,12 @@ rl_generic_bind (type, keyseq, data, map)
ic = uc;
if (ic < 0 || ic >= KEYMAP_SIZE)
- return -1;
+ {
+ free (keys);
+ return -1;
+ }
- if (_rl_convert_meta_chars_to_ascii && META_CHAR (ic))
+ if (META_CHAR (ic) && _rl_convert_meta_chars_to_ascii)
{
ic = UNMETA (ic);
if (map[ESC].type == ISKMAP)
@@ -435,7 +442,7 @@ rl_translate_keyseq (seq, array, len)
{
register int i, c, l, temp;
- for (i = l = 0; (c = seq[i]); i++)
+ for (i = l = 0; c = seq[i]; i++)
{
if (c == '\\')
{
@@ -458,8 +465,24 @@ rl_translate_keyseq (seq, array, len)
}
else if (c == 'M')
{
- i++;
- array[l++] = ESC; /* ESC is meta-prefix */
+ i++; /* seq[i] == '-' */
+ /* XXX - obey convert-meta setting */
+ if (_rl_convert_meta_chars_to_ascii && _rl_keymap[ESC].type == ISKMAP)
+ array[l++] = ESC; /* ESC is meta-prefix */
+ else if (seq[i+1] == '\\' && seq[i+2] == 'C' && seq[i+3] == '-')
+ {
+ i += 4;
+ temp = (seq[i] == '?') ? RUBOUT : CTRL (_rl_to_upper (seq[i]));
+ array[l++] = META (temp);
+ }
+ else
+ {
+ /* This doesn't yet handle things like \M-\a, which may
+ or may not have any reasonable meaning. You're
+ probably better off using straight octal or hex. */
+ i++;
+ array[l++] = META (seq[i]);
+ }
}
else if (c == 'C')
{
@@ -554,6 +577,11 @@ rl_untranslate_keyseq (seq)
kseq[i++] = '-';
c = UNMETA (c);
}
+ else if (c == ESC)
+ {
+ kseq[i++] = '\\';
+ c = 'e';
+ }
else if (CTRL_CHAR (c))
{
kseq[i++] = '\\';
@@ -602,7 +630,12 @@ _rl_untranslate_macro_value (seq)
*r++ = '-';
c = UNMETA (c);
}
- else if (CTRL_CHAR (c) && c != ESC)
+ else if (c == ESC)
+ {
+ *r++ = '\\';
+ c = 'e';
+ }
+ else if (CTRL_CHAR (c))
{
*r++ = '\\';
*r++ = 'C';
@@ -661,7 +694,7 @@ rl_function_of_keyseq (keyseq, map, type)
{
register int i;
- if (!map)
+ if (map == 0)
map = _rl_keymap;
for (i = 0; keyseq && keyseq[i]; i++)
@@ -670,25 +703,27 @@ rl_function_of_keyseq (keyseq, map, type)
if (META_CHAR (ic) && _rl_convert_meta_chars_to_ascii)
{
- if (map[ESC].type != ISKMAP)
+ if (map[ESC].type == ISKMAP)
+ {
+ map = FUNCTION_TO_KEYMAP (map, ESC);
+ ic = UNMETA (ic);
+ }
+ /* XXX - should we just return NULL here, since this obviously
+ doesn't match? */
+ else
{
if (type)
*type = map[ESC].type;
return (map[ESC].function);
}
- else
- {
- map = FUNCTION_TO_KEYMAP (map, ESC);
- ic = UNMETA (ic);
- }
}
if (map[ic].type == ISKMAP)
{
/* If this is the last key in the key sequence, return the
map. */
- if (!keyseq[i + 1])
+ if (keyseq[i + 1] == '\0')
{
if (type)
*type = ISKMAP;
@@ -698,7 +733,12 @@ rl_function_of_keyseq (keyseq, map, type)
else
map = FUNCTION_TO_KEYMAP (map, ic);
}
- else
+ /* If we're not at the end of the key sequence, and the current key
+ is bound to something other than a keymap, then the entire key
+ sequence is not bound. */
+ else if (map[ic].type != ISKMAP && keyseq[i+1])
+ return ((rl_command_func_t *)NULL);
+ else /* map[ic].type != ISKMAP && keyseq[i+1] == 0 */
{
if (type)
*type = map[ic].type;
@@ -736,8 +776,7 @@ _rl_read_file (filename, sizep)
file_size = (size_t)finfo.st_size;
/* check for overflow on very large files */
- if ((long long) file_size != (long long) finfo.st_size ||
- file_size + 1 < file_size)
+ if (file_size != finfo.st_size || file_size + 1 < file_size)
{
if (file >= 0)
close (file);
@@ -767,8 +806,8 @@ _rl_read_file (filename, sizep)
/* Re-read the current keybindings file. */
int
-rl_re_read_init_file (int count __attribute__((unused)),
- int ignore __attribute__((unused)))
+rl_re_read_init_file (count, ignore)
+ int count, ignore;
{
int r;
r = rl_read_init_file ((const char *)NULL);
@@ -781,6 +820,7 @@ rl_re_read_init_file (int count __attribute__((unused)),
1. the filename used for the previous call
2. the value of the shell variable `INPUTRC'
3. ~/.inputrc
+ 4. /etc/inputrc
If the file existed and could be opened and read, 0 is returned,
otherwise errno is returned. */
int
@@ -789,17 +829,18 @@ rl_read_init_file (filename)
{
/* Default the filename. */
if (filename == 0)
+ filename = last_readline_init_file;
+ if (filename == 0)
+ filename = sh_get_env_value ("INPUTRC");
+ if (filename == 0 || *filename == 0)
{
- filename = last_readline_init_file;
- if (filename == 0)
- filename = sh_get_env_value ("INPUTRC");
- if (filename == 0)
- filename = DEFAULT_INPUTRC;
+ filename = DEFAULT_INPUTRC;
+ /* Try to read DEFAULT_INPUTRC; fall back to SYS_INPUTRC on failure */
+ if (_rl_read_init_file (filename, 0) == 0)
+ return 0;
+ filename = SYS_INPUTRC;
}
- if (*filename == 0)
- filename = DEFAULT_INPUTRC;
-
#if defined (__MSDOS__)
if (_rl_read_init_file (filename, 0) == 0)
return 0;
@@ -989,7 +1030,8 @@ parser_if (args)
/* Invert the current parser state if there is anything on the stack. */
static int
-parser_else (char *args __attribute__((unused)))
+parser_else (args)
+ char *args;
{
register int i;
@@ -1019,7 +1061,8 @@ parser_else (char *args __attribute__((unused)))
/* Terminate a conditional, popping the value of
_rl_parsing_conditionalized_out from the stack. */
static int
-parser_endif (char *args __attribute__((unused)))
+parser_endif (args)
+ char *args;
{
if (if_stack_depth)
_rl_parsing_conditionalized_out = if_stack[--if_stack_depth];
@@ -1142,7 +1185,7 @@ rl_parse_and_bind (string)
{
int passc = 0;
- for (i = 1; (c = string[i]); i++)
+ for (i = 1; c = string[i]; i++)
{
if (passc)
{
@@ -1183,9 +1226,9 @@ rl_parse_and_bind (string)
/* If this is a command to set a variable, then do that. */
if (_rl_stricmp (string, "set") == 0)
{
- char *var = string + i;
- char *value;
+ char *var, *value, *e;
+ var = string + i;
/* Make VAR point to start of variable name. */
while (*var && whitespace (*var)) var++;
@@ -1196,6 +1239,20 @@ rl_parse_and_bind (string)
*value++ = '\0';
while (*value && whitespace (*value)) value++;
+ /* Strip trailing whitespace from values to boolean variables. Temp
+ fix until I get a real quoted-string parser here. */
+ i = find_boolean_var (var);
+ if (i >= 0)
+ {
+ /* remove trailing whitespace */
+ e = value + strlen (value) - 1;
+ while (e >= value && whitespace (*e))
+ e--;
+ e++; /* skip back to whitespace or EOS */
+ if (*e && e >= value)
+ *e = '\0';
+ }
+
rl_variable_bind (var, value);
return 0;
}
@@ -1216,9 +1273,10 @@ rl_parse_and_bind (string)
the quoted string delimiter, like the shell. */
if (*funname == '\'' || *funname == '"')
{
- int delimiter = string[i++], passc;
+ int delimiter, passc;
- for (passc = 0; (c = string[i]); i++)
+ delimiter = string[i++];
+ for (passc = 0; c = string[i]; i++)
{
if (passc)
{
@@ -1353,6 +1411,7 @@ static struct {
int *value;
int flags;
} boolean_varlist [] = {
+ { "bind-tty-special-chars", &_rl_bind_stty_chars, 0 },
{ "blink-matching-paren", &rl_blink_matching_paren, V_SPECIAL },
{ "byte-oriented", &rl_byte_oriented, 0 },
{ "completion-ignore-case", &_rl_completion_case_fold, 0 },
@@ -1377,7 +1436,7 @@ static struct {
#if defined (VISIBLE_STATS)
{ "visible-stats", &rl_visible_stats, 0 },
#endif /* VISIBLE_STATS */
- { (char *)NULL, (int *)NULL, 0 }
+ { (char *)NULL, (int *)NULL }
};
static int
@@ -1446,7 +1505,7 @@ static struct {
{ "editing-mode", V_STRING, sv_editmode },
{ "isearch-terminators", V_STRING, sv_isrchterm },
{ "keymap", V_STRING, sv_keymap },
- { (char *)NULL, 0, 0 }
+ { (char *)NULL, 0 }
};
static int
@@ -1466,13 +1525,32 @@ find_string_var (name)
values result in 0 (false). */
static int
bool_to_int (value)
-const char *value;
+ const char *value;
{
return (value == 0 || *value == '\0' ||
(_rl_stricmp (value, "on") == 0) ||
(value[0] == '1' && value[1] == '\0'));
}
+char *
+rl_variable_value (name)
+ const char *name;
+{
+ register int i;
+
+ /* Check for simple variables first. */
+ i = find_boolean_var (name);
+ if (i >= 0)
+ return (*boolean_varlist[i].value ? "on" : "off");
+
+ i = find_string_var (name);
+ if (i >= 0)
+ return (_rl_get_string_variable_value (string_varlist[i].name));
+
+ /* Unknown variable names return NULL. */
+ return 0;
+}
+
int
rl_variable_bind (name, value)
const char *name, *value;
@@ -1725,13 +1803,13 @@ char *
rl_get_keymap_name_from_edit_mode ()
{
if (rl_editing_mode == emacs_mode)
- return (char*) "emacs";
+ return "emacs";
#if defined (VI_MODE)
else if (rl_editing_mode == vi_mode)
- return (char*) "vi";
+ return "vi";
#endif /* VI_MODE */
else
- return (char*) "none";
+ return "none";
}
/* **************************************************************** */
@@ -1899,12 +1977,16 @@ rl_invoking_keyseqs_in_map (function, map)
char *keyname = (char *)xmalloc (6 + strlen (seqs[i]));
if (key == ESC)
-#if 0
- sprintf (keyname, "\\e");
-#else
- /* XXX - experimental */
- sprintf (keyname, "\\M-");
-#endif
+ {
+ /* If ESC is the meta prefix and we're converting chars
+ with the eighth bit set to ESC-prefixed sequences, then
+ we can use \M-. Otherwise we need to use the sequence
+ for ESC. */
+ if (_rl_convert_meta_chars_to_ascii && map[ESC].type == ISKMAP)
+ sprintf (keyname, "\\M-");
+ else
+ sprintf (keyname, "\\e");
+ }
else if (CTRL_CHAR (key))
sprintf (keyname, "\\C-%c", _rl_to_lower (UNCTRL (key)));
else if (key == RUBOUT)
@@ -1966,7 +2048,7 @@ rl_function_dumper (print_readably)
fprintf (rl_outstream, "\n");
- for (i = 0; (name = names[i]); i++)
+ for (i = 0; name = names[i]; i++)
{
rl_command_func_t *function;
char **invokers;
@@ -2025,8 +2107,8 @@ rl_function_dumper (print_readably)
rl_outstream. If an explicit argument is given, then print
the output in such a way that it can be read back in. */
int
-rl_dump_functions (int count __attribute__((unused)),
- int key __attribute__((unused)))
+rl_dump_functions (count, key)
+ int count, key;
{
if (rl_dispatching)
fprintf (rl_outstream, "\r\n");
@@ -2105,7 +2187,8 @@ rl_macro_dumper (print_readably)
}
int
-rl_dump_macros(int count __attribute__((unused)), int key __attribute__((unused)))
+rl_dump_macros (count, key)
+ int count, key;
{
if (rl_dispatching)
fprintf (rl_outstream, "\r\n");
@@ -2114,12 +2197,67 @@ rl_dump_macros(int count __attribute__((unused)), int key __attribute__((unused)
return (0);
}
+static char *
+_rl_get_string_variable_value (name)
+ const char *name;
+{
+ static char numbuf[32];
+ char *ret;
+
+ if (_rl_stricmp (name, "bell-style") == 0)
+ {
+ switch (_rl_bell_preference)
+ {
+ case NO_BELL:
+ return "none";
+ case VISIBLE_BELL:
+ return "visible";
+ case AUDIBLE_BELL:
+ default:
+ return "audible";
+ }
+ }
+ else if (_rl_stricmp (name, "comment-begin") == 0)
+ return (_rl_comment_begin ? _rl_comment_begin : RL_COMMENT_BEGIN_DEFAULT);
+ else if (_rl_stricmp (name, "completion-query-items") == 0)
+ {
+ sprintf (numbuf, "%d", rl_completion_query_items);
+ return (numbuf);
+ }
+ else if (_rl_stricmp (name, "editing-mode") == 0)
+ return (rl_get_keymap_name_from_edit_mode ());
+ else if (_rl_stricmp (name, "isearch-terminators") == 0)
+ {
+ if (_rl_isearch_terminators == 0)
+ return 0;
+ ret = _rl_untranslate_macro_value (_rl_isearch_terminators);
+ if (ret)
+ {
+ strncpy (numbuf, ret, sizeof (numbuf) - 1);
+ free (ret);
+ numbuf[sizeof(numbuf) - 1] = '\0';
+ }
+ else
+ numbuf[0] = '\0';
+ return numbuf;
+ }
+ else if (_rl_stricmp (name, "keymap") == 0)
+ {
+ ret = rl_get_keymap_name (_rl_keymap);
+ if (ret == 0)
+ ret = rl_get_keymap_name_from_edit_mode ();
+ return (ret ? ret : "none");
+ }
+ else
+ return (0);
+}
+
void
rl_variable_dumper (print_readably)
int print_readably;
{
int i;
- const char *kname;
+ char *v;
for (i = 0; boolean_varlist[i].name; i++)
{
@@ -2131,70 +2269,24 @@ rl_variable_dumper (print_readably)
*boolean_varlist[i].value ? "on" : "off");
}
- /* bell-style */
- switch (_rl_bell_preference)
- {
- case NO_BELL:
- kname = "none"; break;
- case VISIBLE_BELL:
- kname = "visible"; break;
- case AUDIBLE_BELL:
- default:
- kname = "audible"; break;
- }
- if (print_readably)
- fprintf (rl_outstream, "set bell-style %s\n", kname);
- else
- fprintf (rl_outstream, "bell-style is set to `%s'\n", kname);
-
- /* comment-begin */
- if (print_readably)
- fprintf (rl_outstream, "set comment-begin %s\n", _rl_comment_begin ? _rl_comment_begin : RL_COMMENT_BEGIN_DEFAULT);
- else
- fprintf (rl_outstream, "comment-begin is set to `%s'\n", _rl_comment_begin ? _rl_comment_begin : RL_COMMENT_BEGIN_DEFAULT);
-
- /* completion-query-items */
- if (print_readably)
- fprintf (rl_outstream, "set completion-query-items %d\n", rl_completion_query_items);
- else
- fprintf (rl_outstream, "completion-query-items is set to `%d'\n", rl_completion_query_items);
-
- /* editing-mode */
- if (print_readably)
- fprintf (rl_outstream, "set editing-mode %s\n", (rl_editing_mode == emacs_mode) ? "emacs" : "vi");
- else
- fprintf (rl_outstream, "editing-mode is set to `%s'\n", (rl_editing_mode == emacs_mode) ? "emacs" : "vi");
-
- /* isearch-terminators */
- if (_rl_isearch_terminators)
+ for (i = 0; string_varlist[i].name; i++)
{
- char *disp;
-
- disp = _rl_untranslate_macro_value (_rl_isearch_terminators);
-
+ v = _rl_get_string_variable_value (string_varlist[i].name);
+ if (v == 0) /* _rl_isearch_terminators can be NULL */
+ continue;
if (print_readably)
- fprintf (rl_outstream, "set isearch-terminators \"%s\"\n", disp);
+ fprintf (rl_outstream, "set %s %s\n", string_varlist[i].name, v);
else
- fprintf (rl_outstream, "isearch-terminators is set to \"%s\"\n", disp);
-
- free (disp);
+ fprintf (rl_outstream, "%s is set to `%s'\n", string_varlist[i].name, v);
}
-
- /* keymap */
- kname = rl_get_keymap_name (_rl_keymap);
- if (kname == 0)
- kname = rl_get_keymap_name_from_edit_mode ();
- if (print_readably)
- fprintf (rl_outstream, "set keymap %s\n", kname ? kname : "none");
- else
- fprintf (rl_outstream, "keymap is set to `%s'\n", kname ? kname : "none");
}
/* Print all of the current variables and their values to
rl_outstream. If an explicit argument is given, then print
the output in such a way that it can be read back in. */
int
-rl_dump_variables(int count __attribute__((unused)), int key __attribute__((unused)))
+rl_dump_variables (count, key)
+ int count, key;
{
if (rl_dispatching)
fprintf (rl_outstream, "\r\n");
diff --git a/cmd-line-utils/readline/callback.c b/cmd-line-utils/readline/callback.c
index 0807f137b92..ada04d8593b 100644
--- a/cmd-line-utils/readline/callback.c
+++ b/cmd-line-utils/readline/callback.c
@@ -1,6 +1,6 @@
/* callback.c -- functions to use readline as an X `callback' mechanism. */
-/* Copyright (C) 1987, 1989, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2005 Free Software Foundation, Inc.
This file is part of the GNU Readline Library, a library for
reading lines of text with interactive input and history editing.
@@ -21,7 +21,9 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#include "rlconf.h"
@@ -41,10 +43,16 @@
#include "rldefs.h"
#include "readline.h"
#include "rlprivate.h"
+#include "xmalloc.h"
+
+/* Private data for callback registration functions. See comments in
+ rl_callback_read_char for more details. */
+_rl_callback_func_t *_rl_callback_func = 0;
+_rl_callback_generic_arg *_rl_callback_data = 0;
/* **************************************************************** */
/* */
-/* Callback Readline Functions */
+/* Callback Readline Functions */
/* */
/* **************************************************************** */
@@ -70,7 +78,8 @@ _rl_callback_newline ()
{
in_handler = 1;
- (*rl_prep_term_function) (_rl_meta_flag);
+ if (rl_prep_term_function)
+ (*rl_prep_term_function) (_rl_meta_flag);
#if defined (HANDLE_SIGNALS)
rl_set_signals ();
@@ -87,6 +96,7 @@ rl_callback_handler_install (prompt, linefunc)
rl_vcpfunc_t *linefunc;
{
rl_set_prompt (prompt);
+ RL_SETSTATE (RL_STATE_CALLBACK);
rl_linefunc = linefunc;
_rl_callback_newline ();
}
@@ -96,7 +106,8 @@ void
rl_callback_read_char ()
{
char *line;
- int eof;
+ int eof, jcode;
+ static procenv_t olevel;
if (rl_linefunc == NULL)
{
@@ -104,16 +115,89 @@ rl_callback_read_char ()
abort ();
}
- eof = readline_internal_char ();
+ memcpy ((void *)olevel, (void *)readline_top_level, sizeof (procenv_t));
+ jcode = setjmp (readline_top_level);
+ if (jcode)
+ {
+ (*rl_redisplay_function) ();
+ _rl_want_redisplay = 0;
+ memcpy ((void *)readline_top_level, (void *)olevel, sizeof (procenv_t));
+ return;
+ }
- /* We loop in case some function has pushed input back with rl_execute_next. */
- for (;;)
+ do
{
+ if (RL_ISSTATE (RL_STATE_ISEARCH))
+ {
+ eof = _rl_isearch_callback (_rl_iscxt);
+ if (eof == 0 && (RL_ISSTATE (RL_STATE_ISEARCH) == 0) && RL_ISSTATE (RL_STATE_INPUTPENDING))
+ rl_callback_read_char ();
+
+ return;
+ }
+ else if (RL_ISSTATE (RL_STATE_NSEARCH))
+ {
+ eof = _rl_nsearch_callback (_rl_nscxt);
+ return;
+ }
+ else if (RL_ISSTATE (RL_STATE_NUMERICARG))
+ {
+ eof = _rl_arg_callback (_rl_argcxt);
+ if (eof == 0 && (RL_ISSTATE (RL_STATE_NUMERICARG) == 0) && RL_ISSTATE (RL_STATE_INPUTPENDING))
+ rl_callback_read_char ();
+ /* XXX - this should handle _rl_last_command_was_kill better */
+ else if (RL_ISSTATE (RL_STATE_NUMERICARG) == 0)
+ _rl_internal_char_cleanup ();
+
+ return;
+ }
+ else if (RL_ISSTATE (RL_STATE_MULTIKEY))
+ {
+ eof = _rl_dispatch_callback (_rl_kscxt); /* For now */
+ while ((eof == -1 || eof == -2) && RL_ISSTATE (RL_STATE_MULTIKEY) && _rl_kscxt && (_rl_kscxt->flags & KSEQ_DISPATCHED))
+ eof = _rl_dispatch_callback (_rl_kscxt);
+ if (RL_ISSTATE (RL_STATE_MULTIKEY) == 0)
+ {
+ _rl_internal_char_cleanup ();
+ _rl_want_redisplay = 1;
+ }
+ }
+ else if (_rl_callback_func)
+ {
+ /* This allows functions that simply need to read an additional
+ character (like quoted-insert) to register a function to be
+ called when input is available. _rl_callback_data is simply a
+ pointer to a struct that has the argument count originally
+ passed to the registering function and space for any additional
+ parameters. */
+ eof = (*_rl_callback_func) (_rl_callback_data);
+ /* If the function `deregisters' itself, make sure the data is
+ cleaned up. */
+ if (_rl_callback_func == 0)
+ {
+ if (_rl_callback_data)
+ {
+ _rl_callback_data_dispose (_rl_callback_data);
+ _rl_callback_data = 0;
+ }
+ _rl_internal_char_cleanup ();
+ }
+ }
+ else
+ eof = readline_internal_char ();
+
+ if (rl_done == 0 && _rl_want_redisplay)
+ {
+ (*rl_redisplay_function) ();
+ _rl_want_redisplay = 0;
+ }
+
if (rl_done)
{
line = readline_internal_teardown (eof);
- (*rl_deprep_term_function) ();
+ if (rl_deprep_term_function)
+ (*rl_deprep_term_function) ();
#if defined (HANDLE_SIGNALS)
rl_clear_signals ();
#endif
@@ -129,11 +213,8 @@ rl_callback_read_char ()
if (in_handler == 0 && rl_linefunc)
_rl_callback_newline ();
}
- if (rl_pending_input || _rl_pushed_input_available ())
- eof = readline_internal_char ();
- else
- break;
}
+ while (rl_pending_input || _rl_pushed_input_available () || RL_ISSTATE (RL_STATE_MACROINPUT));
}
/* Remove the handler, and make sure the terminal is in its normal state. */
@@ -141,14 +222,37 @@ void
rl_callback_handler_remove ()
{
rl_linefunc = NULL;
+ RL_UNSETSTATE (RL_STATE_CALLBACK);
if (in_handler)
{
in_handler = 0;
- (*rl_deprep_term_function) ();
+ if (rl_deprep_term_function)
+ (*rl_deprep_term_function) ();
#if defined (HANDLE_SIGNALS)
rl_clear_signals ();
#endif
}
}
+_rl_callback_generic_arg *
+_rl_callback_data_alloc (count)
+ int count;
+{
+ _rl_callback_generic_arg *arg;
+
+ arg = (_rl_callback_generic_arg *)xmalloc (sizeof (_rl_callback_generic_arg));
+ arg->count = count;
+
+ arg->i1 = arg->i2 = 0;
+
+ return arg;
+}
+
+void _rl_callback_data_dispose (arg)
+ _rl_callback_generic_arg *arg;
+{
+ if (arg)
+ free (arg);
+}
+
#endif
diff --git a/cmd-line-utils/readline/chardefs.h b/cmd-line-utils/readline/chardefs.h
index 04a3b7a8e9c..def3a111bd3 100644
--- a/cmd-line-utils/readline/chardefs.h
+++ b/cmd-line-utils/readline/chardefs.h
@@ -59,11 +59,7 @@
#define largest_char 255 /* Largest character value. */
#define CTRL_CHAR(c) ((c) < control_character_threshold && (((c) & 0x80) == 0))
-#if largest_char >= 255
-#define META_CHAR(c) ((c) > meta_character_threshold)
-#else
#define META_CHAR(c) ((c) > meta_character_threshold && (c) <= largest_char)
-#endif
#define CTRL(c) ((c) & control_character_mask)
#define META(c) ((c) | meta_character_bit)
@@ -90,6 +86,8 @@
/* Some systems define these; we want our definitions. */
#undef ISPRINT
+/* Beware: these only work with single-byte ASCII characters. */
+
#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (c))
#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c))
#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
diff --git a/cmd-line-utils/readline/compat.c b/cmd-line-utils/readline/compat.c
index e4fbc322cee..a66d210fd2e 100644
--- a/cmd-line-utils/readline/compat.c
+++ b/cmd-line-utils/readline/compat.c
@@ -21,7 +21,9 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#include <stdio.h>
diff --git a/cmd-line-utils/readline/complete.c b/cmd-line-utils/readline/complete.c
index f4c361789b7..73f834a68a7 100644
--- a/cmd-line-utils/readline/complete.c
+++ b/cmd-line-utils/readline/complete.c
@@ -1,6 +1,6 @@
/* complete.c -- filename completion for readline. */
-/* Copyright (C) 1987-2004 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2005 Free Software Foundation, Inc.
This file is part of the GNU Readline Library, a library for
reading lines of text with interactive input and history editing.
@@ -21,18 +21,12 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#if !defined(_XOPEN_SOURCE) && !defined(__FreeBSD__)
-#define _XOPEN_SOURCE 500
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
#endif
-#include "config_readline.h"
-
#include <sys/types.h>
-
-/* To get SuSE 9.3 to define wcwidth() (in wchar.h) */
-
#include <fcntl.h>
-
#if defined (HAVE_SYS_FILE_H)
# include <sys/file.h>
#endif
@@ -54,7 +48,9 @@
extern int errno;
#endif /* !errno */
+#if defined (HAVE_PWD_H)
#include <pwd.h>
+#endif
#include "posixdir.h"
#include "posixstat.h"
@@ -85,9 +81,9 @@ typedef int QSFUNC ();
/* Most systems don't declare getpwent in <pwd.h> if _POSIX_SOURCE is
defined. */
-#if !defined (HAVE_GETPW_DECLS) || defined (_POSIX_SOURCE)
+#if defined (HAVE_GETPWENT) && (!defined (HAVE_GETPW_DECLS) || defined (_POSIX_SOURCE))
extern struct passwd *getpwent PARAMS((void));
-#endif /* !HAVE_GETPW_DECLS || _POSIX_SOURCE */
+#endif /* HAVE_GETPWENT && (!HAVE_GETPW_DECLS || _POSIX_SOURCE) */
/* If non-zero, then this is the address of a function to call when
completing a word would normally display the list of possible matches.
@@ -212,7 +208,8 @@ int rl_completion_type = 0;
/* Up to this many items will be displayed in response to a
possible-completions call. After that, we ask the user if
- she is sure she wants to see them all. */
+ she is sure she wants to see them all. A negative value means
+ don't ask. */
int rl_completion_query_items = 100;
int _rl_page_completions = 1;
@@ -360,15 +357,15 @@ rl_complete (ignore, invoking_key)
/* List the possible completions. See description of rl_complete (). */
int
-rl_possible_completions (int ignore __attribute__((unused)),
- int invoking_key __attribute__((unused)))
+rl_possible_completions (ignore, invoking_key)
+ int ignore, invoking_key;
{
return (rl_complete_internal ('?'));
}
int
-rl_insert_completions (int ignore __attribute__((unused)),
- int invoking_key __attribute__((unused)))
+rl_insert_completions (ignore, invoking_key)
+ int ignore, invoking_key;
{
return (rl_complete_internal ('*'));
}
@@ -627,6 +624,8 @@ fnprint (to_print)
mbstate_t ps;
const char *end;
size_t tlen;
+ int width, w;
+ wchar_t wc;
end = to_print + strlen (to_print) + 1;
memset (&ps, 0, sizeof (mbstate_t));
@@ -659,21 +658,28 @@ fnprint (to_print)
else
{
#if defined (HANDLE_MULTIBYTE)
- tlen = mbrlen (s, end - s, &ps);
+ tlen = mbrtowc (&wc, s, end - s, &ps);
if (MB_INVALIDCH (tlen))
{
tlen = 1;
+ width = 1;
memset (&ps, 0, sizeof (mbstate_t));
}
else if (MB_NULLWCH (tlen))
break;
+ else
+ {
+ w = wcwidth (wc);
+ width = (w >= 0) ? w : 1;
+ }
fwrite (s, 1, tlen, rl_outstream);
s += tlen;
+ printed_len += width;
#else
putc (*s, rl_outstream);
s++;
-#endif
printed_len++;
+#endif
}
}
@@ -689,7 +695,7 @@ print_filename (to_print, full_pathname)
char *to_print, *full_pathname;
{
int printed_len, extension_char, slen, tlen;
- char *s, c, *new_full_pathname;
+ char *s, c, *new_full_pathname, *dn;
extension_char = 0;
printed_len = fnprint (to_print);
@@ -714,7 +720,17 @@ print_filename (to_print, full_pathname)
files in the root directory. If we pass a null string to the
bash directory completion hook, for example, it will expand it
to the current directory. We just want the `/'. */
- s = tilde_expand (full_pathname && *full_pathname ? full_pathname : "/");
+ if (full_pathname == 0 || *full_pathname == 0)
+ dn = "/";
+ else if (full_pathname[0] != '/')
+ dn = full_pathname;
+ else if (full_pathname[1] == 0)
+ dn = "//"; /* restore trailing slash to `//' */
+ else if (full_pathname[1] == '/' && full_pathname[2] == 0)
+ dn = "/"; /* don't turn /// into // */
+ else
+ dn = full_pathname;
+ s = tilde_expand (dn);
if (rl_directory_completion_hook)
(*rl_directory_completion_hook) (&s);
@@ -722,6 +738,10 @@ print_filename (to_print, full_pathname)
tlen = strlen (to_print);
new_full_pathname = (char *)xmalloc (slen + tlen + 2);
strcpy (new_full_pathname, s);
+ if (s[slen - 1] == '/')
+ slen--;
+ else
+ new_full_pathname[slen] = '/';
new_full_pathname[slen] = '/';
strcpy (new_full_pathname + slen + 1, to_print);
@@ -760,7 +780,10 @@ print_filename (to_print, full_pathname)
}
static char *
-rl_quote_filename (char *s, int rtype __attribute__((unused)), char *qcp)
+rl_quote_filename (s, rtype, qcp)
+ char *s;
+ int rtype;
+ char *qcp;
{
char *r;
@@ -810,14 +833,7 @@ _rl_find_completion_word (fp, dp)
quote substrings for the completer. Try to find the start
of an unclosed quoted substring. */
/* FOUND_QUOTE is set so we know what kind of quotes we found. */
-#if defined (HANDLE_MULTIBYTE)
- for (scan = pass_next = 0; scan < end;
- scan = ((MB_CUR_MAX == 1 || rl_byte_oriented)
- ? (scan + 1)
- : _rl_find_next_mbchar (rl_line_buffer, scan, 1, MB_FIND_ANY)))
-#else
- for (scan = pass_next = 0; scan < end; scan++)
-#endif
+ for (scan = pass_next = 0; scan < end; scan = MB_NEXTCHAR (rl_line_buffer, scan, 1, MB_FIND_ANY))
{
if (pass_next)
{
@@ -867,11 +883,7 @@ _rl_find_completion_word (fp, dp)
/* We didn't find an unclosed quoted substring upon which to do
completion, so use the word break characters to find the
substring on which to complete. */
-#if defined (HANDLE_MULTIBYTE)
- while ((rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_ANY)))
-#else
- while (--rl_point)
-#endif
+ while (rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY))
{
scan = rl_line_buffer[rl_point];
@@ -938,7 +950,7 @@ gen_completion_matches (text, start, end, our_func, found_quote, quote_char)
rl_compentry_func_t *our_func;
int found_quote, quote_char;
{
- char **matches, *temp;
+ char **matches;
rl_completion_found_quote = found_quote;
rl_completion_quote_character = quote_char;
@@ -957,21 +969,9 @@ gen_completion_matches (text, start, end, our_func, found_quote, quote_char)
}
}
- /* Beware -- we're stripping the quotes here. Do this only if we know
- we are doing filename completion and the application has defined a
- filename dequoting function. */
- temp = (char *)NULL;
-
- if (found_quote && our_func == rl_filename_completion_function &&
- rl_filename_dequoting_function)
- {
- /* delete single and double quotes */
- temp = (*rl_filename_dequoting_function) (text, quote_char);
- text = temp; /* not freeing text is not a memory leak */
- }
+ /* XXX -- filename dequoting moved into rl_filename_completion_function */
matches = rl_completion_matches (text, our_func);
- FREE (temp);
return matches;
}
@@ -1104,7 +1104,8 @@ compute_lcd_of_matches (match_list, matches, text)
#if defined (HANDLE_MULTIBYTE)
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
{
- mbstate_t ps_back = ps1;
+ mbstate_t ps_back;
+ ps_back = ps1;
if (!_rl_compare_chars (match_list[i], si, &ps1, match_list[i+1], si, &ps2))
break;
else if ((v = _rl_get_char_len (&match_list[i][si], &ps_back)) > 1)
@@ -1154,8 +1155,7 @@ compute_lcd_of_matches (match_list, matches, text)
rl_completion_found_quote &&
rl_filename_quoting_desired)
{
- dtext = (*rl_filename_dequoting_function)
- ((char*) text, rl_completion_quote_character);
+ dtext = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character);
text = dtext;
}
@@ -1401,7 +1401,7 @@ display_matches (matches)
/* If there are many items, then ask the user if she really wants to
see them all. */
- if (len >= rl_completion_query_items)
+ if (rl_completion_query_items > 0 && len >= rl_completion_query_items)
{
rl_crlf ();
fprintf (rl_outstream, "Display all %d possibilities? (y or n)", len);
@@ -1538,7 +1538,7 @@ append_to_match (text, delimiter, quote_char, nontrivial_match)
: stat (filename, &finfo);
if (s == 0 && S_ISDIR (finfo.st_mode))
{
- if (_rl_complete_mark_directories)
+ if (_rl_complete_mark_directories /* && rl_completion_suppress_append == 0 */)
{
/* This is clumsy. Avoid putting in a double slash if point
is at the end of the line and the previous character is a
@@ -1802,7 +1802,7 @@ rl_completion_matches (text, entry_function)
match_list = (char **)xmalloc ((match_list_size + 1) * sizeof (char *));
match_list[1] = (char *)NULL;
- while ((string = (*entry_function) (text, matches)))
+ while (string = (*entry_function) (text, matches))
{
if (matches + 1 == match_list_size)
match_list = (char **)xrealloc
@@ -1852,16 +1852,20 @@ rl_username_completion_function (text, state)
setpwent ();
}
- while ((entry = getpwent ()))
+#if defined (HAVE_GETPWENT)
+ while (entry = getpwent ())
{
/* Null usernames should result in all users as possible completions. */
if (namelen == 0 || (STREQN (username, entry->pw_name, namelen)))
break;
}
+#endif
if (entry == 0)
{
+#if defined (HAVE_GETPWENT)
endpwent ();
+#endif
return ((char *)NULL);
}
else
@@ -1959,13 +1963,30 @@ rl_filename_completion_function (text, state)
if (rl_directory_rewrite_hook)
(*rl_directory_rewrite_hook) (&dirname);
+ /* The directory completion hook should perform any necessary
+ dequoting. */
if (rl_directory_completion_hook && (*rl_directory_completion_hook) (&dirname))
{
free (users_dirname);
users_dirname = savestring (dirname);
}
-
+ else if (rl_completion_found_quote && rl_filename_dequoting_function)
+ {
+ /* delete single and double quotes */
+ temp = (*rl_filename_dequoting_function) (users_dirname, rl_completion_quote_character);
+ free (users_dirname);
+ users_dirname = temp;
+ }
directory = opendir (dirname);
+
+ /* Now dequote a non-null filename. */
+ if (filename && *filename && rl_completion_found_quote && rl_filename_dequoting_function)
+ {
+ /* delete single and double quotes */
+ temp = (*rl_filename_dequoting_function) (filename, rl_completion_quote_character);
+ free (filename);
+ filename = temp;
+ }
filename_len = strlen (filename);
rl_filename_completion_desired = 1;
@@ -2088,7 +2109,8 @@ rl_filename_completion_function (text, state)
hit the end of the match list, we restore the original unmatched text,
ring the bell, and reset the counter to zero. */
int
-rl_menu_complete (int count, int ignore __attribute__((unused)))
+rl_menu_complete (count, ignore)
+ int count, ignore;
{
rl_compentry_func_t *our_func;
int matching_filenames, found_quote;
@@ -2172,9 +2194,11 @@ rl_menu_complete (int count, int ignore __attribute__((unused)))
return (0);
}
- match_list_index = (match_list_index + count) % match_list_size;
+ match_list_index += count;
if (match_list_index < 0)
match_list_index += match_list_size;
+ else
+ match_list_index %= match_list_size;
if (match_list_index == 0 && match_list_size > 1)
{
diff --git a/cmd-line-utils/readline/configure.in b/cmd-line-utils/readline/configure.in
index 31e17606024..868773be696 100644
--- a/cmd-line-utils/readline/configure.in
+++ b/cmd-line-utils/readline/configure.in
@@ -4,9 +4,27 @@ dnl
dnl report bugs to chet@po.cwru.edu
dnl
dnl Process this file with autoconf to produce a configure script.
-AC_REVISION([for Readline 5.0, version 2.52, from autoconf version] AC_ACVERSION)
-AC_INIT(readline, 5.0-rc1, bug-readline@gnu.org)
+# Copyright (C) 1987-2005 Free Software Foundation, Inc.
+
+# 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, 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.
+
+AC_REVISION([for Readline 5.2, version 2.61])
+
+AC_INIT(readline, 5.2, bug-readline@gnu.org)
dnl make sure we are using a recent autoconf version
AC_PREREQ(2.50)
@@ -16,20 +34,28 @@ AC_CONFIG_AUX_DIR(./support)
AC_CONFIG_HEADERS(config.h)
dnl update the value of RL_READLINE_VERSION in readline.h when this changes
-LIBVERSION=5.0
+LIBVERSION=5.2
AC_CANONICAL_HOST
dnl configure defaults
opt_curses=no
+opt_purify=no
dnl arguments to configure
AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses], [use the curses library instead of the termcap library]), opt_curses=$withval)
+AC_ARG_WITH(purify, AC_HELP_STRING([--with-purify], [configure to postprocess with purify]), opt_purify=$withval)
if test "$opt_curses" = "yes"; then
prefer_curses=yes
fi
+if test "$opt_purify" = yes; then
+ PURIFY="purify"
+else
+ PURIFY=
+fi
+
dnl option parsing for optional features
opt_multibyte=yes
opt_static_libs=yes
@@ -43,6 +69,36 @@ if test $opt_multibyte = no; then
AC_DEFINE(NO_MULTIBYTE_SUPPORT)
fi
+dnl load up the cross-building cache file -- add more cases and cache
+dnl files as necessary
+
+dnl Note that host and target machine are the same, and different than the
+dnl build machine.
+
+CROSS_COMPILE=
+if test "x$cross_compiling" = "xyes"; then
+ case "${host}" in
+ *-cygwin*)
+ cross_cache=${srcdir}/cross-build/cygwin.cache
+ ;;
+ *-mingw*)
+ cross_cache=${srcdir}/cross-build/mingw.cache
+ ;;
+ i[[3456]]86-*-beos*)
+ cross_cache=${srcdir}/cross-build/x86-beos.cache
+ ;;
+ *) echo "configure: cross-compiling for $host is not supported" >&2
+ ;;
+ esac
+ if test -n "${cross_cache}" && test -r "${cross_cache}"; then
+ echo "loading cross-build cache file ${cross_cache}"
+ . ${cross_cache}
+ fi
+ unset cross_cache
+ CROSS_COMPILE='-DCROSS_COMPILING'
+ AC_SUBST(CROSS_COMPILE)
+fi
+
echo ""
echo "Beginning configuration for readline-$LIBVERSION for ${host_cpu}-${host_vendor}-${host_os}"
echo ""
@@ -83,14 +139,24 @@ AC_HEADER_STDC
AC_HEADER_STAT
AC_HEADER_DIRENT
-AC_CHECK_FUNCS(lstat memmove putenv select setenv setlocale \
- strcasecmp strpbrk tcgetattr vsnprintf isascii isxdigit)
+AC_CHECK_FUNCS(fcntl kill lstat)
+AC_CHECK_FUNCS(memmove putenv select setenv setlocale \
+ strcasecmp strpbrk tcgetattr vsnprintf)
+AC_CHECK_FUNCS(isascii isxdigit)
+AC_CHECK_FUNCS(getpwent getpwnam getpwuid)
AC_FUNC_STRCOLL
-AC_CHECK_HEADERS(unistd.h stdlib.h varargs.h stdarg.h string.h strings.h \
- limits.h sys/ptem.h sys/pte.h sys/stream.h sys/select.h \
- termcap.h termios.h termio.h sys/file.h locale.h memory.h )
+AC_CHECK_HEADERS(fcntl.h unistd.h stdlib.h varargs.h stdarg.h string.h strings.h \
+ limits.h locale.h pwd.h memory.h termcap.h termios.h termio.h)
+AC_CHECK_HEADERS(sys/pte.h sys/stream.h sys/select.h sys/file.h)
+
+AC_CHECK_HEADERS(sys/ptem.h,,,
+[[
+#if HAVE_SYS_STREAM_H
+# include <sys/stream.h>
+#endif
+]])
BASH_SYS_SIGNAL_VINTAGE
BASH_SYS_REINSTALL_SIGHANDLERS
@@ -143,7 +209,13 @@ esac
#
if test -f ${srcdir}/support/shobj-conf; then
AC_MSG_CHECKING(configuration for building shared libraries)
- eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
+ eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
+
+# case "$SHLIB_LIBS" in
+# *curses*|*termcap*|*termlib*) ;;
+# *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
+# esac
+
AC_SUBST(SHOBJ_CC)
AC_SUBST(SHOBJ_CFLAGS)
AC_SUBST(SHOBJ_LD)
@@ -153,8 +225,11 @@ if test -f ${srcdir}/support/shobj-conf; then
AC_SUBST(SHOBJ_STATUS)
AC_SUBST(SHLIB_STATUS)
AC_SUBST(SHLIB_XLDFLAGS)
+ AC_SUBST(SHLIB_DOT)
+ AC_SUBST(SHLIB_LIBPREF)
AC_SUBST(SHLIB_LIBSUFF)
AC_SUBST(SHLIB_LIBVERSION)
+ AC_SUBST(SHLIB_DLLVERSION)
AC_SUBST(SHLIB_LIBS)
AC_MSG_RESULT($SHLIB_STATUS)
@@ -191,6 +266,12 @@ msdosdjgpp*) BUILD_DIR=`pwd.exe` ;; # to prevent //d/path/file
*) BUILD_DIR=`pwd` ;;
esac
+case "$BUILD_DIR" in
+*\ *) BUILD_DIR=`echo "$BUILD_DIR" | sed 's: :\\\\ :g'` ;;
+*) ;;
+esac
+
+AC_SUBST(PURIFY)
AC_SUBST(BUILD_DIR)
AC_SUBST(CFLAGS)
diff --git a/cmd-line-utils/readline/display.c b/cmd-line-utils/readline/display.c
index 06cac3bfd32..47ff0615974 100644
--- a/cmd-line-utils/readline/display.c
+++ b/cmd-line-utils/readline/display.c
@@ -1,6 +1,6 @@
/* display.c -- readline redisplay facility. */
-/* Copyright (C) 1987-2004 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2006 Free Software Foundation, Inc.
This file is part of the GNU Readline Library, a library for
reading lines of text with interactive input and history editing.
@@ -21,16 +21,12 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 500
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
#endif
-#include "config_readline.h"
-
#include <sys/types.h>
-/* To get SuSE 9.3 to define wcwidth() (in wchar.h) */
-
#if defined (HAVE_UNISTD_H)
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
@@ -63,10 +59,6 @@
extern char *strchr (), *strrchr ();
#endif /* !strchr && !__STDC__ */
-#if defined (HACK_TERMCAP_MOTION)
-extern char *_rl_term_forward_char;
-#endif
-
static void update_line PARAMS((char *, char *, int, int, int, int));
static void space_to_eol PARAMS((int));
static void delete_chars PARAMS((int));
@@ -84,9 +76,18 @@ static int *inv_lbreaks, *vis_lbreaks;
static int inv_lbsize, vis_lbsize;
/* Heuristic used to decide whether it is faster to move from CUR to NEW
- by backing up or outputting a carriage return and moving forward. */
+ by backing up or outputting a carriage return and moving forward. CUR
+ and NEW are either both buffer positions or absolute screen positions. */
#define CR_FASTER(new, cur) (((new) + 1) < ((cur) - (new)))
+/* _rl_last_c_pos is an absolute cursor position in multibyte locales and a
+ buffer index in others. This macro is used when deciding whether the
+ current cursor position is in the middle of a prompt string containing
+ invisible characters. */
+#define PROMPT_ENDING_INDEX \
+ ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) ? prompt_physical_chars : prompt_last_invisible+1)
+
+
/* **************************************************************** */
/* */
/* Display stuff */
@@ -122,16 +123,25 @@ rl_voidfunc_t *rl_redisplay_function = rl_redisplay;
int rl_display_fixed = 0;
int _rl_suppress_redisplay = 0;
+int _rl_want_redisplay = 0;
/* The stuff that gets printed out before the actual text of the line.
This is usually pointing to rl_prompt. */
char *rl_display_prompt = (char *)NULL;
/* Pseudo-global variables declared here. */
+
/* The visible cursor position. If you print some text, adjust this. */
+/* NOTE: _rl_last_c_pos is used as a buffer index when not in a locale
+ supporting multibyte characters, and an absolute cursor position when
+ in such a locale. This is an artifact of the donated multibyte support.
+ Care must be taken when modifying its value. */
int _rl_last_c_pos = 0;
int _rl_last_v_pos = 0;
+static int cpos_adjusted;
+static int cpos_buffer_position;
+
/* Number of lines currently on screen minus 1. */
int _rl_vis_botlin = 0;
@@ -158,6 +168,7 @@ static int line_size = 1024;
include invisible characters. */
static char *local_prompt, *local_prompt_prefix;
+static int local_prompt_len;
static int prompt_visible_length, prompt_prefix_length;
/* The number of invisible characters in the line currently being
@@ -184,6 +195,19 @@ static int prompt_last_screen_line;
static int prompt_physical_chars;
+/* Variables to save and restore prompt and display information. */
+
+/* These are getting numerous enough that it's time to create a struct. */
+
+static char *saved_local_prompt;
+static char *saved_local_prefix;
+static int saved_last_invisible;
+static int saved_visible_length;
+static int saved_prefix_length;
+static int saved_local_length;
+static int saved_invis_chars_first_line;
+static int saved_physical_chars;
+
/* Expand the prompt string S and return the number of visible
characters in *LP, if LP is not null. This is currently more-or-less
a placeholder for expansion. LIP, if non-null is a place to store the
@@ -204,8 +228,8 @@ expand_prompt (pmt, lp, lip, niflp, vlp)
char *pmt;
int *lp, *lip, *niflp, *vlp;
{
- char *r, *ret, *p;
- int l, rl, last, ignoring, ninvis, invfl, ind, pind, physchars;
+ char *r, *ret, *p, *igstart;
+ int l, rl, last, ignoring, ninvis, invfl, invflset, ind, pind, physchars;
/* Short-circuit if we can. */
if ((MB_CUR_MAX <= 1 || rl_byte_oriented) && strchr (pmt, RL_PROMPT_START_IGNORE) == 0)
@@ -218,7 +242,7 @@ expand_prompt (pmt, lp, lip, niflp, vlp)
if (niflp)
*niflp = 0;
if (vlp)
- *vlp = lp ? *lp : (int) strlen (r);
+ *vlp = lp ? *lp : strlen (r);
return r;
}
@@ -226,20 +250,24 @@ expand_prompt (pmt, lp, lip, niflp, vlp)
r = ret = (char *)xmalloc (l + 1);
invfl = 0; /* invisible chars in first line of prompt */
+ invflset = 0; /* we only want to set invfl once */
+ igstart = 0;
for (rl = ignoring = last = ninvis = physchars = 0, p = pmt; p && *p; p++)
{
/* This code strips the invisible character string markers
RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE */
- if (*p == RL_PROMPT_START_IGNORE)
+ if (ignoring == 0 && *p == RL_PROMPT_START_IGNORE) /* XXX - check ignoring? */
{
- ignoring++;
+ ignoring = 1;
+ igstart = p;
continue;
}
else if (ignoring && *p == RL_PROMPT_END_IGNORE)
{
ignoring = 0;
- last = r - ret - 1;
+ if (p != (igstart + 1))
+ last = r - ret - 1;
continue;
}
else
@@ -253,7 +281,10 @@ expand_prompt (pmt, lp, lip, niflp, vlp)
while (l--)
*r++ = *p++;
if (!ignoring)
- rl += ind - pind;
+ {
+ rl += ind - pind;
+ physchars += _rl_col_width (pmt, pind, ind);
+ }
else
ninvis += ind - pind;
p--; /* compensate for later increment */
@@ -263,16 +294,19 @@ expand_prompt (pmt, lp, lip, niflp, vlp)
{
*r++ = *p;
if (!ignoring)
- rl++; /* visible length byte counter */
+ {
+ rl++; /* visible length byte counter */
+ physchars++;
+ }
else
ninvis++; /* invisible chars byte counter */
}
- if (rl >= _rl_screenwidth)
- invfl = ninvis;
-
- if (ignoring == 0)
- physchars++;
+ if (invflset == 0 && rl >= _rl_screenwidth)
+ {
+ invfl = ninvis;
+ invflset = 1;
+ }
}
}
@@ -332,7 +366,9 @@ rl_expand_prompt (prompt)
FREE (local_prompt_prefix);
local_prompt = local_prompt_prefix = (char *)0;
- prompt_last_invisible = prompt_visible_length = 0;
+ local_prompt_len = 0;
+ prompt_last_invisible = prompt_invis_chars_first_line = 0;
+ prompt_visible_length = prompt_physical_chars = 0;
if (prompt == 0 || *prompt == 0)
return (0);
@@ -346,6 +382,7 @@ rl_expand_prompt (prompt)
&prompt_invis_chars_first_line,
&prompt_physical_chars);
local_prompt_prefix = (char *)0;
+ local_prompt_len = local_prompt ? strlen (local_prompt) : 0;
return (prompt_visible_length);
}
else
@@ -355,15 +392,16 @@ rl_expand_prompt (prompt)
local_prompt = expand_prompt (p, &prompt_visible_length,
&prompt_last_invisible,
(int *)NULL,
- (int *)NULL);
+ &prompt_physical_chars);
c = *t; *t = '\0';
/* The portion of the prompt string up to and including the
final newline is now null-terminated. */
local_prompt_prefix = expand_prompt (prompt, &prompt_prefix_length,
(int *)NULL,
&prompt_invis_chars_first_line,
- &prompt_physical_chars);
+ (int *)NULL);
*t = c;
+ local_prompt_len = local_prompt ? strlen (local_prompt) : 0;
return (prompt_prefix_length);
}
}
@@ -420,13 +458,13 @@ rl_redisplay ()
{
register int in, out, c, linenum, cursor_linenum;
register char *line;
- int c_pos, inv_botlin, lb_botlin, lb_linenum;
- int newlines, lpos, temp, modmark;
+ int inv_botlin, lb_botlin, lb_linenum, o_cpos;
+ int newlines, lpos, temp, modmark, n0, num;
char *prompt_this_line;
#if defined (HANDLE_MULTIBYTE)
wchar_t wc;
size_t wc_bytes;
- int wc_width= 0;
+ int wc_width;
mbstate_t ps;
int _rl_wrapped_multicolumn = 0;
#endif
@@ -435,16 +473,16 @@ rl_redisplay ()
return;
if (!rl_display_prompt)
- rl_display_prompt = (char*) "";
+ rl_display_prompt = "";
- if (invisible_line == 0)
+ if (invisible_line == 0 || vis_lbreaks == 0)
{
init_line_structures (0);
rl_on_new_line ();
}
/* Draw the line into the buffer. */
- c_pos = -1;
+ cpos_buffer_position = -1;
line = invisible_line;
out = inv_botlin = 0;
@@ -471,24 +509,23 @@ rl_redisplay ()
number of non-visible characters in the prompt string. */
if (rl_display_prompt == rl_prompt || local_prompt)
{
- int local_len = local_prompt ? strlen (local_prompt) : 0;
if (local_prompt_prefix && forced_display)
_rl_output_some_chars (local_prompt_prefix, strlen (local_prompt_prefix));
- if (local_len > 0)
+ if (local_prompt_len > 0)
{
- temp = local_len + out + 2;
+ temp = local_prompt_len + out + 2;
if (temp >= line_size)
{
line_size = (temp + 1024) - (temp % 1024);
visible_line = (char *)xrealloc (visible_line, line_size);
line = invisible_line = (char *)xrealloc (invisible_line, line_size);
}
- strncpy (line + out, local_prompt, local_len);
- out += local_len;
+ strncpy (line + out, local_prompt, local_prompt_len);
+ out += local_prompt_len;
}
line[out] = '\0';
- wrap_offset = local_len - prompt_visible_length;
+ wrap_offset = local_prompt_len - prompt_visible_length;
}
else
{
@@ -524,17 +561,6 @@ rl_redisplay ()
wrap_offset = prompt_invis_chars_first_line = 0;
}
-#if defined (HANDLE_MULTIBYTE)
-#define CHECK_INV_LBREAKS() \
- do { \
- if (newlines >= (inv_lbsize - 2)) \
- { \
- inv_lbsize *= 2; \
- inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
- _rl_wrapped_line = (int *)xrealloc (_rl_wrapped_line, inv_lbsize * sizeof (int)); \
- } \
- } while (0)
-#else
#define CHECK_INV_LBREAKS() \
do { \
if (newlines >= (inv_lbsize - 2)) \
@@ -543,7 +569,6 @@ rl_redisplay ()
inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
} \
} while (0)
-#endif
#if defined (HANDLE_MULTIBYTE)
#define CHECK_LPOS() \
@@ -589,6 +614,7 @@ rl_redisplay ()
#if defined (HANDLE_MULTIBYTE)
memset (_rl_wrapped_line, 0, vis_lbsize);
+ num = 0;
#endif
/* prompt_invis_chars_first_line is the number of invisible characters in
@@ -600,6 +626,7 @@ rl_redisplay ()
contents of the command line? */
while (lpos >= _rl_screenwidth)
{
+ int z;
/* fix from Darin Johnson <darin@acuson.com> for prompt string with
invisible characters that is longer than the screen width. The
prompt_invis_chars_first_line variable could be made into an array
@@ -607,19 +634,47 @@ rl_redisplay ()
probably too much work for the benefit gained. How many people have
prompts that exceed two physical lines?
Additional logic fix from Edward Catmur <ed@catmur.co.uk> */
- temp = ((newlines + 1) * _rl_screenwidth) +
- ((local_prompt_prefix == 0) ? ((newlines == 0) ? prompt_invis_chars_first_line
- : ((newlines == 1) ? wrap_offset : 0))
- : ((newlines == 0) ? wrap_offset :0));
+#if defined (HANDLE_MULTIBYTE)
+ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
+ {
+ n0 = num;
+ temp = local_prompt_len;
+ while (num < temp)
+ {
+ z = _rl_col_width (local_prompt, n0, num);
+ if (z > _rl_screenwidth)
+ {
+ num = _rl_find_prev_mbchar (local_prompt, num, MB_FIND_ANY);
+ break;
+ }
+ else if (z == _rl_screenwidth)
+ break;
+ num++;
+ }
+ temp = num;
+ }
+ else
+#endif /* !HANDLE_MULTIBYTE */
+ temp = ((newlines + 1) * _rl_screenwidth);
+
+ /* Now account for invisible characters in the current line. */
+ temp += ((local_prompt_prefix == 0) ? ((newlines == 0) ? prompt_invis_chars_first_line
+ : ((newlines == 1) ? wrap_offset : 0))
+ : ((newlines == 0) ? wrap_offset :0));
inv_lbreaks[++newlines] = temp;
- lpos -= _rl_screenwidth;
+#if defined (HANDLE_MULTIBYTE)
+ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
+ lpos -= _rl_col_width (local_prompt, n0, num);
+ else
+#endif
+ lpos -= _rl_screenwidth;
}
prompt_last_screen_line = newlines;
/* Draw the rest of the line (after the prompt) into invisible_line, keeping
- track of where the cursor is (c_pos), the number of the line containing
+ track of where the cursor is (cpos_buffer_position), the number of the line containing
the cursor (lb_linenum), the last line number (lb_botlin and inv_botlin).
It maintains an array of line breaks for display (inv_lbreaks).
This handles expanding tabs for display and displaying meta characters. */
@@ -672,7 +727,7 @@ rl_redisplay ()
if (in == rl_point)
{
- c_pos = out;
+ cpos_buffer_position = out;
lb_linenum = newlines;
}
@@ -766,10 +821,10 @@ rl_redisplay ()
}
if (in == rl_point)
{
- c_pos = out;
+ cpos_buffer_position = out;
lb_linenum = newlines;
}
- for (i = in; i < (int) (in+wc_bytes); i++)
+ for (i = in; i < in+wc_bytes; i++)
line[out++] = rl_line_buffer[i];
for (i = 0; i < wc_width; i++)
CHECK_LPOS();
@@ -797,9 +852,9 @@ rl_redisplay ()
}
line[out] = '\0';
- if (c_pos < 0)
+ if (cpos_buffer_position < 0)
{
- c_pos = out;
+ cpos_buffer_position = out;
lb_linenum = newlines;
}
@@ -808,7 +863,7 @@ rl_redisplay ()
inv_lbreaks[newlines+1] = out;
cursor_linenum = lb_linenum;
- /* C_POS == position in buffer where cursor should be placed.
+ /* CPOS_BUFFER_POSITION == position in buffer where cursor should be placed.
CURSOR_LINENUM == line number where the cursor should be placed. */
/* PWP: now is when things get a bit hairy. The visible and invisible
@@ -822,7 +877,7 @@ rl_redisplay ()
if (_rl_horizontal_scroll_mode == 0 && _rl_term_up && *_rl_term_up)
{
- int nleft, pos, changed_screen_line;
+ int nleft, pos, changed_screen_line, tx;
if (!rl_display_fixed || forced_display)
{
@@ -847,15 +902,38 @@ rl_redisplay ()
#define VIS_LLEN(l) ((l) > _rl_vis_botlin ? 0 : (vis_lbreaks[l+1] - vis_lbreaks[l]))
#define INV_LLEN(l) (inv_lbreaks[l+1] - inv_lbreaks[l])
#define VIS_CHARS(line) (visible_line + vis_lbreaks[line])
-#define VIS_LINE(line) ((line) > _rl_vis_botlin) ? (char*) "" : VIS_CHARS(line)
+#define VIS_LINE(line) ((line) > _rl_vis_botlin) ? "" : VIS_CHARS(line)
#define INV_LINE(line) (invisible_line + inv_lbreaks[line])
/* For each line in the buffer, do the updating display. */
for (linenum = 0; linenum <= inv_botlin; linenum++)
{
+ /* This can lead us astray if we execute a program that changes
+ the locale from a non-multibyte to a multibyte one. */
+ o_cpos = _rl_last_c_pos;
+ cpos_adjusted = 0;
update_line (VIS_LINE(linenum), INV_LINE(linenum), linenum,
VIS_LLEN(linenum), INV_LLEN(linenum), inv_botlin);
+ /* update_line potentially changes _rl_last_c_pos, but doesn't
+ take invisible characters into account, since _rl_last_c_pos
+ is an absolute cursor position in a multibyte locale. See
+ if compensating here is the right thing, or if we have to
+ change update_line itself. There is one case in which
+ update_line adjusts _rl_last_c_pos itself (so it can pass
+ _rl_move_cursor_relative accurate values); it communicates
+ this back by setting cpos_adjusted. If we assume that
+ _rl_last_c_pos is correct (an absolute cursor position) each
+ time update_line is called, then we can assume in our
+ calculations that o_cpos does not need to be adjusted by
+ wrap_offset. */
+ if (linenum == 0 && (MB_CUR_MAX > 1 && rl_byte_oriented == 0) &&
+ cpos_adjusted == 0 &&
+ _rl_last_c_pos != o_cpos &&
+ _rl_last_c_pos > wrap_offset &&
+ o_cpos < prompt_last_invisible)
+ _rl_last_c_pos -= wrap_offset;
+
/* If this is the line with the prompt, we might need to
compensate for invisible characters in the new line. Do
this only if there is not more than one new line (which
@@ -867,7 +945,10 @@ rl_redisplay ()
(wrap_offset > visible_wrap_offset) &&
(_rl_last_c_pos < visible_first_line_len))
{
- nleft = _rl_screenwidth + wrap_offset - _rl_last_c_pos;
+ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
+ nleft = _rl_screenwidth - _rl_last_c_pos;
+ else
+ nleft = _rl_screenwidth + wrap_offset - _rl_last_c_pos;
if (nleft)
_rl_clear_to_eol (nleft);
}
@@ -888,7 +969,7 @@ rl_redisplay ()
_rl_move_vert (linenum);
_rl_move_cursor_relative (0, tt);
_rl_clear_to_eol
- ((linenum == _rl_vis_botlin) ? (int) strlen (tt) : _rl_screenwidth);
+ ((linenum == _rl_vis_botlin) ? strlen (tt) : _rl_screenwidth);
}
}
_rl_vis_botlin = inv_botlin;
@@ -903,7 +984,7 @@ rl_redisplay ()
the physical cursor position on the screen stays the same,
but the buffer position needs to be adjusted to account
for invisible characters. */
- if (cursor_linenum == 0 && wrap_offset)
+ if ((MB_CUR_MAX == 1 || rl_byte_oriented) && cursor_linenum == 0 && wrap_offset)
_rl_last_c_pos += wrap_offset;
}
@@ -914,7 +995,11 @@ rl_redisplay ()
invisible character in the prompt string. */
nleft = prompt_visible_length + wrap_offset;
if (cursor_linenum == 0 && wrap_offset > 0 && _rl_last_c_pos > 0 &&
- _rl_last_c_pos <= prompt_last_invisible && local_prompt)
+#if 0
+ _rl_last_c_pos <= PROMPT_ENDING_INDEX && local_prompt)
+#else
+ _rl_last_c_pos < PROMPT_ENDING_INDEX && local_prompt)
+#endif
{
#if defined (__MSDOS__)
putc ('\r', rl_outstream);
@@ -924,7 +1009,7 @@ rl_redisplay ()
#endif
_rl_output_some_chars (local_prompt, nleft);
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
- _rl_last_c_pos = _rl_col_width (local_prompt, 0, nleft);
+ _rl_last_c_pos = _rl_col_width (local_prompt, 0, nleft) - wrap_offset;
else
_rl_last_c_pos = nleft;
}
@@ -933,21 +1018,35 @@ rl_redisplay ()
in the buffer? */
pos = inv_lbreaks[cursor_linenum];
/* nleft == number of characters in the line buffer between the
- start of the line and the cursor position. */
- nleft = c_pos - pos;
+ start of the line and the desired cursor position. */
+ nleft = cpos_buffer_position - pos;
+
+ /* NLEFT is now a number of characters in a buffer. When in a
+ multibyte locale, however, _rl_last_c_pos is an absolute cursor
+ position that doesn't take invisible characters in the prompt
+ into account. We use a fudge factor to compensate. */
/* Since _rl_backspace() doesn't know about invisible characters in the
prompt, and there's no good way to tell it, we compensate for
those characters here and call _rl_backspace() directly. */
if (wrap_offset && cursor_linenum == 0 && nleft < _rl_last_c_pos)
{
- _rl_backspace (_rl_last_c_pos - nleft);
+ /* TX == new physical cursor position in multibyte locale. */
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
- _rl_last_c_pos = _rl_col_width (&visible_line[pos], 0, nleft);
+ tx = _rl_col_width (&visible_line[pos], 0, nleft) - visible_wrap_offset;
else
- _rl_last_c_pos = nleft;
+ tx = nleft;
+ if (_rl_last_c_pos > tx)
+ {
+ _rl_backspace (_rl_last_c_pos - tx); /* XXX */
+ _rl_last_c_pos = tx;
+ }
}
+ /* We need to note that in a multibyte locale we are dealing with
+ _rl_last_c_pos as an absolute cursor position, but moving to a
+ point specified by a buffer position (NLEFT) that doesn't take
+ invisible characters into account. */
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
_rl_move_cursor_relative (nleft, &invisible_line[pos]);
else if (nleft != _rl_last_c_pos)
@@ -966,11 +1065,11 @@ rl_redisplay ()
will be LMARGIN. */
/* The number of characters that will be displayed before the cursor. */
- ndisp = c_pos - wrap_offset;
+ ndisp = cpos_buffer_position - wrap_offset;
nleft = prompt_visible_length + wrap_offset;
/* Where the new cursor position will be on the screen. This can be
longer than SCREENWIDTH; if it is, lmargin will be adjusted. */
- phys_c_pos = c_pos - (last_lmargin ? last_lmargin : wrap_offset);
+ phys_c_pos = cpos_buffer_position - (last_lmargin ? last_lmargin : wrap_offset);
t = _rl_screenwidth / 3;
/* If the number of characters had already exceeded the screenwidth,
@@ -981,7 +1080,7 @@ rl_redisplay ()
two-thirds of the way across the screen. */
if (phys_c_pos > _rl_screenwidth - 2)
{
- lmargin = c_pos - (2 * t);
+ lmargin = cpos_buffer_position - (2 * t);
if (lmargin < 0)
lmargin = 0;
/* If the left margin would be in the middle of a prompt with
@@ -995,7 +1094,7 @@ rl_redisplay ()
{
/* If we are moving back towards the beginning of the line and
the last margin is no longer correct, compute a new one. */
- lmargin = ((c_pos - 1) / t) * t; /* XXX */
+ lmargin = ((cpos_buffer_position - 1) / t) * t; /* XXX */
if (wrap_offset && lmargin > 0 && lmargin < nleft)
lmargin = nleft;
}
@@ -1040,7 +1139,7 @@ rl_redisplay ()
if (visible_first_line_len > _rl_screenwidth)
visible_first_line_len = _rl_screenwidth;
- _rl_move_cursor_relative (c_pos - lmargin, &invisible_line[lmargin]);
+ _rl_move_cursor_relative (cpos_buffer_position - lmargin, &invisible_line[lmargin]);
last_lmargin = lmargin;
}
}
@@ -1106,7 +1205,10 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
the exact cursor position and cut-and-paste with certain terminal
emulators. In this calculation, TEMP is the physical screen
position of the cursor. */
- temp = _rl_last_c_pos - W_OFFSET(_rl_last_v_pos, visible_wrap_offset);
+ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
+ temp = _rl_last_c_pos;
+ else
+ temp = _rl_last_c_pos - W_OFFSET(_rl_last_v_pos, visible_wrap_offset);
if (temp == _rl_screenwidth && _rl_term_autowrap && !_rl_horizontal_scroll_mode
&& _rl_last_v_pos == current_line - 1)
{
@@ -1171,7 +1273,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
putc (new[0], rl_outstream);
else
putc (' ', rl_outstream);
- _rl_last_c_pos = 1; /* XXX */
+ _rl_last_c_pos = 1;
_rl_last_v_pos++;
if (old[0] && new[0])
old[0] = new[0];
@@ -1312,7 +1414,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
if (_rl_last_v_pos != current_line)
{
_rl_move_vert (current_line);
- if (current_line == 0 && visible_wrap_offset)
+ if ((MB_CUR_MAX == 1 || rl_byte_oriented) && current_line == 0 && visible_wrap_offset)
_rl_last_c_pos += visible_wrap_offset;
}
@@ -1328,11 +1430,11 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
sequences (like drawing the `unbold' sequence without a corresponding
`bold') that manifests itself on certain terminals. */
- lendiff = local_prompt ? strlen (local_prompt) : 0;
+ lendiff = local_prompt_len;
od = ofd - old; /* index of first difference in visible line */
if (current_line == 0 && !_rl_horizontal_scroll_mode &&
_rl_term_cr && lendiff > prompt_visible_length && _rl_last_c_pos > 0 &&
- od >= lendiff && _rl_last_c_pos <= prompt_last_invisible)
+ od >= lendiff && _rl_last_c_pos < PROMPT_ENDING_INDEX)
{
#if defined (__MSDOS__)
putc ('\r', rl_outstream);
@@ -1341,12 +1443,29 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
#endif
_rl_output_some_chars (local_prompt, lendiff);
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
- _rl_last_c_pos = _rl_col_width (local_prompt, 0, lendiff);
+ {
+ /* We take wrap_offset into account here so we can pass correct
+ information to _rl_move_cursor_relative. */
+ _rl_last_c_pos = _rl_col_width (local_prompt, 0, lendiff) - wrap_offset;
+ cpos_adjusted = 1;
+ }
else
_rl_last_c_pos = lendiff;
}
+ /* When this function returns, _rl_last_c_pos is correct, and an absolute
+ cursor postion in multibyte mode, but a buffer index when not in a
+ multibyte locale. */
_rl_move_cursor_relative (od, old);
+#if 1
+#if defined (HANDLE_MULTIBYTE)
+ /* We need to indicate that the cursor position is correct in the presence of
+ invisible characters in the prompt string. Let's see if setting this when
+ we make sure we're at the end of the drawn prompt string works. */
+ if (current_line == 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0 && _rl_last_c_pos == prompt_physical_chars)
+ cpos_adjusted = 1;
+#endif
+#endif
/* if (len (new) > len (old))
lendiff == difference in buffer
@@ -1403,7 +1522,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
insert_some_chars (nfd, lendiff, col_lendiff);
_rl_last_c_pos += col_lendiff;
}
- else if (*ols == 0 && lendiff > 0)
+ else if ((MB_CUR_MAX == 1 || rl_byte_oriented != 0) && *ols == 0 && lendiff > 0)
{
/* At the end of a line the characters do not have to
be "inserted". They can just be placed on the screen. */
@@ -1442,6 +1561,10 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
/* cannot insert chars, write to EOL */
_rl_output_some_chars (nfd, temp);
_rl_last_c_pos += col_temp;
+ /* If we're in a multibyte locale and were before the last invisible
+ char in the current line (which implies we just output some invisible
+ characters) we need to adjust _rl_last_c_pos, since it represents
+ a physical character position. */
}
}
else /* Delete characters from line. */
@@ -1473,7 +1596,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
if (temp > 0)
{
_rl_output_some_chars (nfd, temp);
- _rl_last_c_pos += col_temp;
+ _rl_last_c_pos += col_temp; /* XXX */
}
lendiff = (oe - old) - (ne - new);
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
@@ -1535,7 +1658,7 @@ rl_on_new_line_with_prompt ()
l = strlen (prompt_last_line);
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
- _rl_last_c_pos = _rl_col_width (prompt_last_line, 0, l);
+ _rl_last_c_pos = _rl_col_width (prompt_last_line, 0, l); /* XXX */
else
_rl_last_c_pos = l;
@@ -1570,10 +1693,11 @@ rl_on_new_line_with_prompt ()
int
rl_forced_update_display ()
{
+ register char *temp;
+
if (visible_line)
{
- register char *temp = visible_line;
-
+ temp = visible_line;
while (*temp)
*temp++ = '\0';
}
@@ -1584,6 +1708,8 @@ rl_forced_update_display ()
}
/* Move the cursor from _rl_last_c_pos to NEW, which are buffer indices.
+ (Well, when we don't have multibyte characters, _rl_last_c_pos is a
+ buffer index.)
DATA is the contents of the screen line of interest; i.e., where
the movement is being done. */
void
@@ -1592,29 +1718,47 @@ _rl_move_cursor_relative (new, data)
const char *data;
{
register int i;
+ int woff; /* number of invisible chars on current line */
+ int cpos, dpos; /* current and desired cursor positions */
- /* If we don't have to do anything, then return. */
+ woff = W_OFFSET (_rl_last_v_pos, wrap_offset);
+ cpos = _rl_last_c_pos;
#if defined (HANDLE_MULTIBYTE)
/* If we have multibyte characters, NEW is indexed by the buffer point in
a multibyte string, but _rl_last_c_pos is the display position. In
this case, NEW's display position is not obvious and must be
- calculated. */
- if (MB_CUR_MAX == 1 || rl_byte_oriented)
+ calculated. We need to account for invisible characters in this line,
+ as long as we are past them and they are counted by _rl_col_width. */
+ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
{
- if (_rl_last_c_pos == new)
- return;
+ dpos = _rl_col_width (data, 0, new);
+ if (dpos > prompt_last_invisible) /* XXX - don't use woff here */
+ {
+ dpos -= woff;
+ /* Since this will be assigned to _rl_last_c_pos at the end (more
+ precisely, _rl_last_c_pos == dpos when this function returns),
+ let the caller know. */
+ cpos_adjusted = 1;
+ }
}
- else if (_rl_last_c_pos == _rl_col_width (data, 0, new))
- return;
-#else
- if (_rl_last_c_pos == new) return;
+ else
#endif
+ dpos = new;
+
+ /* If we don't have to do anything, then return. */
+ if (cpos == dpos)
+ return;
/* It may be faster to output a CR, and then move forwards instead
of moving backwards. */
/* i == current physical cursor position. */
- i = _rl_last_c_pos - W_OFFSET(_rl_last_v_pos, visible_wrap_offset);
- if (new == 0 || CR_FASTER (new, _rl_last_c_pos) ||
+#if defined (HANDLE_MULTIBYTE)
+ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
+ i = _rl_last_c_pos;
+ else
+#endif
+ i = _rl_last_c_pos - woff;
+ if (dpos == 0 || CR_FASTER (dpos, _rl_last_c_pos) ||
(_rl_term_autowrap && i == _rl_screenwidth))
{
#if defined (__MSDOS__)
@@ -1622,10 +1766,10 @@ _rl_move_cursor_relative (new, data)
#else
tputs (_rl_term_cr, 1, _rl_output_character_function);
#endif /* !__MSDOS__ */
- _rl_last_c_pos = 0;
+ cpos = _rl_last_c_pos = 0;
}
- if (_rl_last_c_pos < new)
+ if (cpos < dpos)
{
/* Move the cursor forward. We do it by printing the command
to move the cursor forward if there is one, else print that
@@ -1636,67 +1780,43 @@ _rl_move_cursor_relative (new, data)
sequence telling the terminal to move forward one character.
That kind of control is for people who don't know what the
data is underneath the cursor. */
-#if defined (HACK_TERMCAP_MOTION)
- if (_rl_term_forward_char)
+
+ /* However, we need a handle on where the current display position is
+ in the buffer for the immediately preceding comment to be true.
+ In multibyte locales, we don't currently have that info available.
+ Without it, we don't know where the data we have to display begins
+ in the buffer and we have to go back to the beginning of the screen
+ line. In this case, we can use the terminal sequence to move forward
+ if it's available. */
+ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
{
- if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
+ if (_rl_term_forward_char)
{
- int width;
- width = _rl_col_width (data, _rl_last_c_pos, new);
- for (i = 0; i < width; i++)
- tputs (_rl_term_forward_char, 1, _rl_output_character_function);
+ for (i = cpos; i < dpos; i++)
+ tputs (_rl_term_forward_char, 1, _rl_output_character_function);
}
else
{
- for (i = _rl_last_c_pos; i < new; i++)
- tputs (_rl_term_forward_char, 1, _rl_output_character_function);
+ tputs (_rl_term_cr, 1, _rl_output_character_function);
+ for (i = 0; i < new; i++)
+ putc (data[i], rl_outstream);
}
}
- else if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
- {
- tputs (_rl_term_cr, 1, _rl_output_character_function);
- for (i = 0; i < new; i++)
- putc (data[i], rl_outstream);
- }
else
- for (i = _rl_last_c_pos; i < new; i++)
+ for (i = cpos; i < new; i++)
putc (data[i], rl_outstream);
-
-#else /* !HACK_TERMCAP_MOTION */
-
- if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
- {
- tputs (_rl_term_cr, 1, _rl_output_character_function);
- for (i = 0; i < new; i++)
- putc (data[i], rl_outstream);
- }
- else
- for (i = _rl_last_c_pos; i < new; i++)
- putc (data[i], rl_outstream);
-
-#endif /* !HACK_TERMCAP_MOTION */
-
}
+
#if defined (HANDLE_MULTIBYTE)
/* NEW points to the buffer point, but _rl_last_c_pos is the display point.
The byte length of the string is probably bigger than the column width
of the string, which means that if NEW == _rl_last_c_pos, then NEW's
display point is less than _rl_last_c_pos. */
- else if (_rl_last_c_pos >= new)
-#else
- else if (_rl_last_c_pos > new)
#endif
- {
- if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
- _rl_backspace (_rl_last_c_pos - _rl_col_width (data, 0, new));
- else
- _rl_backspace (_rl_last_c_pos - new);
- }
+ else if (cpos > dpos)
+ _rl_backspace (cpos - dpos);
- if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
- _rl_last_c_pos = _rl_col_width (data, 0, new);
- else
- _rl_last_c_pos = new;
+ _rl_last_c_pos = dpos;
}
/* PWP: move the cursor up or down. */
@@ -1785,9 +1905,9 @@ rl_character_len (c, pos)
return ((ISPRINT (uc)) ? 1 : 2);
}
-
/* How to print things in the "echo-area". The prompt is treated as a
mini-modeline. */
+static int msg_saved_prompt = 0;
#if defined (USE_VARARGS)
int
@@ -1818,8 +1938,20 @@ rl_message (va_alist)
#endif
va_end (args);
+ if (saved_local_prompt == 0)
+ {
+ rl_save_prompt ();
+ msg_saved_prompt = 1;
+ }
rl_display_prompt = msg_buf;
+ local_prompt = expand_prompt (msg_buf, &prompt_visible_length,
+ &prompt_last_invisible,
+ &prompt_invis_chars_first_line,
+ &prompt_physical_chars);
+ local_prompt_prefix = (char *)NULL;
+ local_prompt_len = local_prompt ? strlen (local_prompt) : 0;
(*rl_redisplay_function) ();
+
return 0;
}
#else /* !USE_VARARGS */
@@ -1829,8 +1961,21 @@ rl_message (format, arg1, arg2)
{
sprintf (msg_buf, format, arg1, arg2);
msg_buf[sizeof(msg_buf) - 1] = '\0'; /* overflow? */
+
rl_display_prompt = msg_buf;
+ if (saved_local_prompt == 0)
+ {
+ rl_save_prompt ();
+ msg_saved_prompt = 1;
+ }
+ local_prompt = expand_prompt (msg_buf, &prompt_visible_length,
+ &prompt_last_invisible,
+ &prompt_invis_chars_first_line,
+ &prompt_physical_chars);
+ local_prompt_prefix = (char *)NULL;
+ local_prompt_len = local_prompt ? strlen (local_prompt) : 0;
(*rl_redisplay_function) ();
+
return 0;
}
#endif /* !USE_VARARGS */
@@ -1840,6 +1985,11 @@ int
rl_clear_message ()
{
rl_display_prompt = rl_prompt;
+ if (msg_saved_prompt)
+ {
+ rl_restore_prompt ();
+ msg_saved_prompt = 0;
+ }
(*rl_redisplay_function) ();
return 0;
}
@@ -1849,32 +1999,26 @@ rl_reset_line_state ()
{
rl_on_new_line ();
- rl_display_prompt = rl_prompt ? rl_prompt : (char*) "";
+ rl_display_prompt = rl_prompt ? rl_prompt : "";
forced_display = 1;
return 0;
}
-/* These are getting numerous enough that it's time to create a struct. */
-
-static char *saved_local_prompt;
-static char *saved_local_prefix;
-static int saved_last_invisible;
-static int saved_visible_length;
-static int saved_invis_chars_first_line;
-static int saved_physical_chars;
-
void
rl_save_prompt ()
{
saved_local_prompt = local_prompt;
saved_local_prefix = local_prompt_prefix;
+ saved_prefix_length = prompt_prefix_length;
+ saved_local_length = local_prompt_len;
saved_last_invisible = prompt_last_invisible;
saved_visible_length = prompt_visible_length;
saved_invis_chars_first_line = prompt_invis_chars_first_line;
saved_physical_chars = prompt_physical_chars;
local_prompt = local_prompt_prefix = (char *)0;
- prompt_last_invisible = prompt_visible_length = 0;
+ local_prompt_len = 0;
+ prompt_last_invisible = prompt_visible_length = prompt_prefix_length = 0;
prompt_invis_chars_first_line = prompt_physical_chars = 0;
}
@@ -1886,10 +2030,18 @@ rl_restore_prompt ()
local_prompt = saved_local_prompt;
local_prompt_prefix = saved_local_prefix;
+ local_prompt_len = saved_local_length;
+ prompt_prefix_length = saved_prefix_length;
prompt_last_invisible = saved_last_invisible;
prompt_visible_length = saved_visible_length;
prompt_invis_chars_first_line = saved_invis_chars_first_line;
prompt_physical_chars = saved_physical_chars;
+
+ /* can test saved_local_prompt to see if prompt info has been saved. */
+ saved_local_prompt = saved_local_prefix = (char *)0;
+ saved_local_length = 0;
+ saved_last_invisible = saved_visible_length = saved_prefix_length = 0;
+ saved_invis_chars_first_line = saved_physical_chars = 0;
}
char *
@@ -1897,11 +2049,15 @@ _rl_make_prompt_for_search (pchar)
int pchar;
{
int len;
- char *pmt;
+ char *pmt, *p;
rl_save_prompt ();
- if (saved_local_prompt == 0)
+ /* We've saved the prompt, and can do anything with the various prompt
+ strings we need before they're restored. We want the unexpanded
+ portion of the prompt string after any final newline. */
+ p = rl_prompt ? strrchr (rl_prompt, '\n') : 0;
+ if (p == 0)
{
len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0;
pmt = (char *)xmalloc (len + 2);
@@ -1912,17 +2068,17 @@ _rl_make_prompt_for_search (pchar)
}
else
{
- len = *saved_local_prompt ? strlen (saved_local_prompt) : 0;
+ p++;
+ len = strlen (p);
pmt = (char *)xmalloc (len + 2);
if (len)
- strcpy (pmt, saved_local_prompt);
+ strcpy (pmt, p);
pmt[len] = pchar;
pmt[len+1] = '\0';
- local_prompt = savestring (pmt);
- prompt_last_invisible = saved_last_invisible;
- prompt_visible_length = saved_visible_length + 1;
- }
+ }
+ /* will be overwritten by expand_prompt, called from rl_message */
+ prompt_physical_chars = saved_physical_chars + 1;
return pmt;
}
@@ -1983,6 +2139,9 @@ insert_some_chars (string, count, col)
char *string;
int count, col;
{
+#if defined (__MSDOS__) || defined (__MINGW32__)
+ _rl_output_some_chars (string, count);
+#else
/* DEBUGGING */
if (MB_CUR_MAX == 1 || rl_byte_oriented)
if (count != col)
@@ -2021,6 +2180,7 @@ insert_some_chars (string, count, col)
if (_rl_term_ei && *_rl_term_ei)
tputs (_rl_term_ei, 1, _rl_output_character_function);
}
+#endif /* __MSDOS__ || __MINGW32__ */
}
/* Delete COUNT characters from the display line. */
@@ -2031,6 +2191,7 @@ delete_chars (count)
if (count > _rl_screenwidth) /* XXX */
return;
+#if !defined (__MSDOS__) && !defined (__MINGW32__)
if (_rl_term_DC && *_rl_term_DC)
{
char *buffer;
@@ -2043,6 +2204,7 @@ delete_chars (count)
while (count--)
tputs (_rl_term_dc, 1, _rl_output_character_function);
}
+#endif /* !__MSDOS__ && !__MINGW32__ */
}
void
@@ -2066,7 +2228,8 @@ _rl_update_final ()
char *last_line;
last_line = &visible_line[vis_lbreaks[_rl_vis_botlin]];
- _rl_move_cursor_relative (_rl_screenwidth - 1, last_line);
+ cpos_buffer_position = -1; /* don't know where we are in buffer */
+ _rl_move_cursor_relative (_rl_screenwidth - 1, last_line); /* XXX */
_rl_clear_to_eol (0);
putc (last_line[_rl_screenwidth - 1], rl_outstream);
}
@@ -2098,18 +2261,10 @@ static void
redraw_prompt (t)
char *t;
{
- char *oldp, *oldl, *oldlprefix;
- int oldlen, oldlast, oldplen, oldninvis, oldphyschars;
+ char *oldp;
- /* Geez, I should make this a struct. */
oldp = rl_display_prompt;
- oldl = local_prompt;
- oldlprefix = local_prompt_prefix;
- oldlen = prompt_visible_length;
- oldplen = prompt_prefix_length;
- oldlast = prompt_last_invisible;
- oldninvis = prompt_invis_chars_first_line;
- oldphyschars = prompt_physical_chars;
+ rl_save_prompt ();
rl_display_prompt = t;
local_prompt = expand_prompt (t, &prompt_visible_length,
@@ -2117,16 +2272,12 @@ redraw_prompt (t)
&prompt_invis_chars_first_line,
&prompt_physical_chars);
local_prompt_prefix = (char *)NULL;
+ local_prompt_len = local_prompt ? strlen (local_prompt) : 0;
+
rl_forced_update_display ();
rl_display_prompt = oldp;
- local_prompt = oldl;
- local_prompt_prefix = oldlprefix;
- prompt_visible_length = oldlen;
- prompt_prefix_length = oldplen;
- prompt_last_invisible = oldlast;
- prompt_invis_chars_first_line = oldninvis;
- prompt_physical_chars = oldphyschars;
+ rl_restore_prompt();
}
/* Redisplay the current line after a SIGWINCH is received. */
@@ -2230,10 +2381,11 @@ _rl_col_width (str, start, end)
if (end <= start)
return 0;
+ memset (&ps, 0, sizeof (mbstate_t));
+
point = 0;
max = end;
- memset (&ps, 0, sizeof(ps));
while (point < start)
{
tmp = mbrlen (str + point, max, &ps);
diff --git a/cmd-line-utils/readline/funmap.c b/cmd-line-utils/readline/funmap.c
index d56ffb9fadc..9c760cc3475 100644
--- a/cmd-line-utils/readline/funmap.c
+++ b/cmd-line-utils/readline/funmap.c
@@ -21,7 +21,9 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#if !defined (BUFSIZ)
#include <stdio.h>
@@ -174,6 +176,7 @@ static FUNMAP default_funmap[] = {
{ "vi-put", rl_vi_put },
{ "vi-redo", rl_vi_redo },
{ "vi-replace", rl_vi_replace },
+ { "vi-rubout", rl_vi_rubout },
{ "vi-search", rl_vi_search },
{ "vi-search-again", rl_vi_search_again },
{ "vi-set-mark", rl_vi_set_mark },
diff --git a/cmd-line-utils/readline/histexpand.c b/cmd-line-utils/readline/histexpand.c
index 0a45438990a..f46c0b2a45d 100644
--- a/cmd-line-utils/readline/histexpand.c
+++ b/cmd-line-utils/readline/histexpand.c
@@ -22,7 +22,9 @@
#define READLINE_LIBRARY
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#include <stdio.h>
@@ -54,8 +56,6 @@
typedef int _hist_search_func_t PARAMS((const char *, int));
-extern int rl_byte_oriented; /* declared in mbutil.c */
-
static char error_pointer;
static char *subst_lhs;
@@ -87,14 +87,14 @@ char history_comment_char = '\0';
/* The list of characters which inhibit the expansion of text if found
immediately following history_expansion_char. */
-char *history_no_expand_chars = (char*) " \t\n\r=";
+char *history_no_expand_chars = " \t\n\r=";
/* If set to a non-zero value, single quotes inhibit history expansion.
The default is 0. */
int history_quotes_inhibit_expansion = 0;
/* Used to split words by history_tokenize_internal. */
-char *history_word_delimiters = (char*) HISTORY_WORD_DELIMITERS;
+char *history_word_delimiters = HISTORY_WORD_DELIMITERS;
/* If set, this points to a function that is called to verify that a
particular history expansion should be performed. */
@@ -203,24 +203,25 @@ get_history_event (string, caller_index, delimiting_quote)
}
/* Only a closing `?' or a newline delimit a substring search string. */
- for (local_index = i; (c = string[i]); i++)
+ for (local_index = i; c = string[i]; i++)
+ {
#if defined (HANDLE_MULTIBYTE)
- if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
- {
- int v;
- mbstate_t ps;
+ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
+ {
+ int v;
+ mbstate_t ps;
+
+ memset (&ps, 0, sizeof (mbstate_t));
+ /* These produce warnings because we're passing a const string to a
+ function that takes a non-const string. */
+ _rl_adjust_point ((char *)string, i, &ps);
+ if ((v = _rl_get_char_len ((char *)string + i, &ps)) > 1)
+ {
+ i += v - 1;
+ continue;
+ }
+ }
- memset (&ps, 0, sizeof (mbstate_t));
- /* These produce warnings because we're passing a const string to a
- function that takes a non-const string. */
- _rl_adjust_point ((char *)string, i, &ps);
- if ((v = _rl_get_char_len ((char *)string + i, &ps)) > 1)
- {
- i += v - 1;
- continue;
- }
- }
- else
#endif /* HANDLE_MULTIBYTE */
if ((!substring_okay && (whitespace (c) || c == ':' ||
(history_search_delimiter_chars && member (c, history_search_delimiter_chars)) ||
@@ -228,6 +229,7 @@ get_history_event (string, caller_index, delimiting_quote)
string[i] == '\n' ||
(substring_okay && string[i] == '?'))
break;
+ }
which = i - local_index;
temp = (char *)xmalloc (1 + which);
@@ -560,12 +562,12 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line)
#if defined (HANDLE_MULTIBYTE)
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
{
- int chr, l;
+ int ch, l;
l = _rl_find_prev_mbchar (string, i, MB_FIND_ANY);
- chr = string[l];
+ ch = string[l];
/* XXX - original patch had i - 1 ??? If i == 0 it would fail. */
- if (i && (chr == '\'' || chr == '"'))
- quoted_search_delimiter = chr;
+ if (i && (ch == '\'' || ch == '"'))
+ quoted_search_delimiter = ch;
}
else
#endif /* HANDLE_MULTIBYTE */
@@ -1426,6 +1428,8 @@ history_tokenize_word (string, ind)
{
if (peek == '<' && string[i + 2] == '-')
i++;
+ else if (peek == '<' && string[i + 2] == '<')
+ i++;
i += 2;
return i;
}
diff --git a/cmd-line-utils/readline/histfile.c b/cmd-line-utils/readline/histfile.c
index f1822b105a4..2f051a32563 100644
--- a/cmd-line-utils/readline/histfile.c
+++ b/cmd-line-utils/readline/histfile.c
@@ -30,7 +30,9 @@
# include <floss.h>
#endif
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#include <stdio.h>
@@ -184,8 +186,7 @@ read_history_range (filename, from, to)
file_size = (size_t)finfo.st_size;
/* check for overflow on very large files */
- if ((long long) file_size != (long long) finfo.st_size ||
- file_size + 1 < file_size)
+ if (file_size != finfo.st_size || file_size + 1 < file_size)
{
errno = overflow_errno;
goto error_and_exit;
@@ -255,7 +256,11 @@ read_history_range (filename, from, to)
for (line_end = line_start; line_end < bufend; line_end++)
if (*line_end == '\n')
{
- *line_end = '\0';
+ /* Change to allow Windows-like \r\n end of line delimiter. */
+ if (line_end > line_start && line_end[-1] == '\r')
+ line_end[-1] = '\0';
+ else
+ *line_end = '\0';
if (*line_start)
{
@@ -334,8 +339,7 @@ history_truncate_file (fname, lines)
file_size = (size_t)finfo.st_size;
/* check for overflow on very large files */
- if ((long long) file_size != (long long) finfo.st_size ||
- file_size + 1 < file_size)
+ if (file_size != finfo.st_size || file_size + 1 < file_size)
{
close (file);
#if defined (EFBIG)
diff --git a/cmd-line-utils/readline/history.c b/cmd-line-utils/readline/history.c
index bb1960d8d99..1ccf4db786c 100644
--- a/cmd-line-utils/readline/history.c
+++ b/cmd-line-utils/readline/history.c
@@ -1,6 +1,6 @@
/* history.c -- standalone history library */
-/* Copyright (C) 1989-2003 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2005 Free Software Foundation, Inc.
This file contains the GNU History Library (the Library), a set of
routines for managing the text of previously typed lines.
@@ -25,7 +25,9 @@
you can call. I think I have done that. */
#define READLINE_LIBRARY
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#include <stdio.h>
@@ -202,11 +204,27 @@ history_get (offset)
int local_index;
local_index = offset - history_base;
- return (local_index >= history_length || local_index < 0 || !the_history)
+ return (local_index >= history_length || local_index < 0 || the_history == 0)
? (HIST_ENTRY *)NULL
: the_history[local_index];
}
+HIST_ENTRY *
+alloc_history_entry (string, ts)
+ char *string;
+ char *ts;
+{
+ HIST_ENTRY *temp;
+
+ temp = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY));
+
+ temp->line = string ? savestring (string) : string;
+ temp->data = (char *)NULL;
+ temp->timestamp = ts;
+
+ return temp;
+}
+
time_t
history_get_time (hist)
HIST_ENTRY *hist;
@@ -288,11 +306,7 @@ add_history (string)
}
}
- temp = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY));
- temp->line = savestring (string);
- temp->data = (char *)NULL;
-
- temp->timestamp = hist_inittime ();
+ temp = alloc_history_entry (string, hist_inittime ());
the_history[history_length] = (HIST_ENTRY *)NULL;
the_history[history_length - 1] = temp;
@@ -326,6 +340,26 @@ free_history_entry (hist)
free (hist);
return (x);
}
+
+HIST_ENTRY *
+copy_history_entry (hist)
+ HIST_ENTRY *hist;
+{
+ HIST_ENTRY *ret;
+ char *ts;
+
+ if (hist == 0)
+ return hist;
+
+ ret = alloc_history_entry (hist->line, (char *)NULL);
+
+ ts = hist->timestamp ? savestring (hist->timestamp) : hist->timestamp;
+ ret->timestamp = ts;
+
+ ret->data = hist->data;
+
+ return ret;
+}
/* Make the history entry at WHICH have LINE and DATA. This returns
the old entry so you can dispose of the data. In the case of an
@@ -338,7 +372,7 @@ replace_history_entry (which, line, data)
{
HIST_ENTRY *temp, *old_value;
- if (which >= history_length)
+ if (which < 0 || which >= history_length)
return ((HIST_ENTRY *)NULL);
temp = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY));
@@ -352,6 +386,51 @@ replace_history_entry (which, line, data)
return (old_value);
}
+/* Replace the DATA in the specified history entries, replacing OLD with
+ NEW. WHICH says which one(s) to replace: WHICH == -1 means to replace
+ all of the history entries where entry->data == OLD; WHICH == -2 means
+ to replace the `newest' history entry where entry->data == OLD; and
+ WHICH >= 0 means to replace that particular history entry's data, as
+ long as it matches OLD. */
+void
+replace_history_data (which,old, new)
+ int which;
+ histdata_t *old, *new;
+{
+ HIST_ENTRY *entry;
+ register int i, last;
+
+ if (which < -2 || which >= history_length || history_length == 0 || the_history == 0)
+ return;
+
+ if (which >= 0)
+ {
+ entry = the_history[which];
+ if (entry && entry->data == old)
+ entry->data = new;
+ return;
+ }
+
+ last = -1;
+ for (i = 0; i < history_length; i++)
+ {
+ entry = the_history[i];
+ if (entry == 0)
+ continue;
+ if (entry->data == old)
+ {
+ last = i;
+ if (which == -1)
+ entry->data = new;
+ }
+ }
+ if (which == -2 && last >= 0)
+ {
+ entry = the_history[last];
+ entry->data = new; /* XXX - we don't check entry->old */
+ }
+}
+
/* Remove history element WHICH from the history. The removed
element is returned to you so you can free the line, data,
and containing structure. */
@@ -362,17 +441,15 @@ remove_history (which)
HIST_ENTRY *return_value;
register int i;
- if (which >= history_length || !history_length)
- return_value = (HIST_ENTRY *)NULL;
- else
- {
- return_value = the_history[which];
+ if (which < 0 || which >= history_length || history_length == 0 || the_history == 0)
+ return ((HIST_ENTRY *)NULL);
- for (i = which; i < history_length; i++)
- the_history[i] = the_history[i + 1];
+ return_value = the_history[which];
- history_length--;
- }
+ for (i = which; i < history_length; i++)
+ the_history[i] = the_history[i + 1];
+
+ history_length--;
return (return_value);
}
diff --git a/cmd-line-utils/readline/histsearch.c b/cmd-line-utils/readline/histsearch.c
index 778b323afdc..1cc5875a4b4 100644
--- a/cmd-line-utils/readline/histsearch.c
+++ b/cmd-line-utils/readline/histsearch.c
@@ -22,7 +22,9 @@
#define READLINE_LIBRARY
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#include <stdio.h>
#if defined (HAVE_STDLIB_H)
diff --git a/cmd-line-utils/readline/input.c b/cmd-line-utils/readline/input.c
index 818f2e8763d..da5d771c481 100644
--- a/cmd-line-utils/readline/input.c
+++ b/cmd-line-utils/readline/input.c
@@ -1,6 +1,6 @@
/* input.c -- character input functions for readline. */
-/* Copyright (C) 1994 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2005 Free Software Foundation, Inc.
This file is part of the GNU Readline Library, a library for
reading lines of text with interactive input and history editing.
@@ -25,7 +25,9 @@
# include <floss.h>
#endif
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#include <sys/types.h>
#include <fcntl.h>
@@ -177,6 +179,7 @@ rl_gather_tyi ()
struct timeval timeout;
#endif
+ chars_avail = 0;
tty = fileno (rl_instream);
#if defined (HAVE_SELECT)
@@ -218,6 +221,13 @@ rl_gather_tyi ()
}
#endif /* O_NDELAY */
+#if defined (__MINGW32__)
+ /* Use getch/_kbhit to check for available console input, in the same way
+ that we read it normally. */
+ chars_avail = isatty (tty) ? _kbhit () : 0;
+ result = 0;
+#endif
+
/* If there's nothing available, don't waste time trying to read
something. */
if (chars_avail <= 0)
@@ -261,7 +271,7 @@ rl_set_keyboard_input_timeout (u)
int o;
o = _keyboard_input_timeout;
- if (u > 0)
+ if (u >= 0)
_keyboard_input_timeout = u;
return (o);
}
@@ -303,6 +313,11 @@ _rl_input_available ()
#endif
+#if defined (__MINGW32__)
+ if (isatty (tty))
+ return (_kbhit ());
+#endif
+
return 0;
}
@@ -405,7 +420,7 @@ rl_read_key ()
else
{
/* If input is coming from a macro, then use that. */
- if ((c= _rl_next_macro_key ()))
+ if (c = _rl_next_macro_key ())
return (c);
/* If the user has an event function, then call it periodically. */
@@ -442,6 +457,10 @@ rl_getc (stream)
while (1)
{
+#if defined (__MINGW32__)
+ if (isatty (fileno (stream)))
+ return (getch ());
+#endif
result = read (fileno (stream), &c, sizeof (unsigned char));
if (result == sizeof (unsigned char))
@@ -483,7 +502,7 @@ rl_getc (stream)
this is simply an interrupted system call to read ().
Otherwise, some error ocurred, also signifying EOF. */
if (errno != EINTR)
- return (EOF);
+ return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF);
}
}
@@ -517,6 +536,12 @@ _rl_read_mbchar (mbchar, size)
ps = ps_back;
continue;
}
+ else if (mbchar_bytes_length == 0)
+ {
+ mbchar[0] = '\0'; /* null wide character */
+ mb_len = 1;
+ break;
+ }
else if (mbchar_bytes_length > (size_t)(0))
break;
}
@@ -525,21 +550,21 @@ _rl_read_mbchar (mbchar, size)
}
/* Read a multibyte-character string whose first character is FIRST into
- the buffer MB of length MBLEN. Returns the last character read, which
+ the buffer MB of length MLEN. Returns the last character read, which
may be FIRST. Used by the search functions, among others. Very similar
to _rl_read_mbchar. */
int
-_rl_read_mbstring (first, mb, mb_len)
+_rl_read_mbstring (first, mb, mlen)
int first;
char *mb;
- int mb_len;
+ int mlen;
{
int i, c;
mbstate_t ps;
c = first;
- memset (mb, 0, mb_len);
- for (i = 0; i < mb_len; i++)
+ memset (mb, 0, mlen);
+ for (i = 0; i < mlen; i++)
{
mb[i] = (char)c;
memset (&ps, 0, sizeof (mbstate_t));
diff --git a/cmd-line-utils/readline/isearch.c b/cmd-line-utils/readline/isearch.c
index 9071695dda8..9f67bfc0801 100644
--- a/cmd-line-utils/readline/isearch.c
+++ b/cmd-line-utils/readline/isearch.c
@@ -4,7 +4,7 @@
/* */
/* **************************************************************** */
-/* Copyright (C) 1987-2002 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2005 Free Software Foundation, Inc.
This file contains the Readline Library (the Library), a set of
routines for providing Emacs style line input to programs that ask
@@ -26,7 +26,9 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#include <sys/types.h>
@@ -54,21 +56,77 @@
/* Variables exported to other files in the readline library. */
char *_rl_isearch_terminators = (char *)NULL;
+_rl_search_cxt *_rl_iscxt = 0;
+
/* Variables imported from other files in the readline library. */
extern HIST_ENTRY *_rl_saved_line_for_history;
-/* Forward declarations */
static int rl_search_history PARAMS((int, int));
+static _rl_search_cxt *_rl_isearch_init PARAMS((int));
+static void _rl_isearch_fini PARAMS((_rl_search_cxt *));
+static int _rl_isearch_cleanup PARAMS((_rl_search_cxt *, int));
+
/* Last line found by the current incremental search, so we don't `find'
- identical lines many times in a row. */
-static char *prev_line_found;
+ identical lines many times in a row. Now part of isearch context. */
+/* static char *prev_line_found; */
/* Last search string and its length. */
static char *last_isearch_string;
static int last_isearch_string_len;
-static char *default_isearch_terminators = (char*) "\033\012";
+static char *default_isearch_terminators = "\033\012";
+
+_rl_search_cxt *
+_rl_scxt_alloc (type, flags)
+ int type, flags;
+{
+ _rl_search_cxt *cxt;
+
+ cxt = (_rl_search_cxt *)xmalloc (sizeof (_rl_search_cxt));
+
+ cxt->type = type;
+ cxt->sflags = flags;
+
+ cxt->search_string = 0;
+ cxt->search_string_size = cxt->search_string_index = 0;
+
+ cxt->lines = 0;
+ cxt->allocated_line = 0;
+ cxt->hlen = cxt->hindex = 0;
+
+ cxt->save_point = rl_point;
+ cxt->save_mark = rl_mark;
+ cxt->save_line = where_history ();
+ cxt->last_found_line = cxt->save_line;
+ cxt->prev_line_found = 0;
+
+ cxt->save_undo_list = 0;
+
+ cxt->history_pos = 0;
+ cxt->direction = 0;
+
+ cxt->lastc = 0;
+
+ cxt->sline = 0;
+ cxt->sline_len = cxt->sline_index = 0;
+
+ cxt->search_terminators = 0;
+
+ return cxt;
+}
+
+void
+_rl_scxt_dispose (cxt, flags)
+ _rl_search_cxt *cxt;
+ int flags;
+{
+ FREE (cxt->search_string);
+ FREE (cxt->allocated_line);
+ FREE (cxt->lines);
+
+ free (cxt);
+}
/* Search backwards through the history looking for a string which is typed
interactively. Start with the current line. */
@@ -90,12 +148,13 @@ rl_forward_search_history (sign, key)
/* Display the current state of the search in the echo-area.
SEARCH_STRING contains the string that is being searched for,
- DIRECTION is zero for forward, or 1 for reverse,
+ DIRECTION is zero for forward, or non-zero for reverse,
WHERE is the history list number of the current line. If it is
-1, then this line is the starting one. */
static void
-rl_display_search (char *search_string, int reverse_p,
- int where __attribute__((unused)))
+rl_display_search (search_string, reverse_p, where)
+ char *search_string;
+ int reverse_p, where;
{
char *message;
int msglen, searchlen;
@@ -137,65 +196,23 @@ rl_display_search (char *search_string, int reverse_p,
(*rl_redisplay_function) ();
}
-/* Search through the history looking for an interactively typed string.
- This is analogous to i-search. We start the search in the current line.
- DIRECTION is which direction to search; >= 0 means forward, < 0 means
- backwards. */
-static int
-rl_search_history (int direction, int invoking_key __attribute__((unused)))
+static _rl_search_cxt *
+_rl_isearch_init (direction)
+ int direction;
{
- /* The string that the user types in to search for. */
- char *search_string;
-
- /* The current length of SEARCH_STRING. */
- int search_string_index;
-
- /* The amount of space that SEARCH_STRING has allocated to it. */
- int search_string_size;
-
- /* The list of lines to search through. */
- char **lines, *allocated_line;
-
- /* The length of LINES. */
- int hlen;
-
- /* Where we get LINES from. */
- HIST_ENTRY **hlist;
-
+ _rl_search_cxt *cxt;
register int i;
- int orig_point, orig_mark, orig_line, last_found_line;
- int c, found, failed, sline_len;
- int n, wstart, wlen;
-#if defined (HANDLE_MULTIBYTE)
- char mb[MB_LEN_MAX];
-#endif
-
- /* The line currently being searched. */
- char *sline;
-
- /* Offset in that line. */
- int line_index;
-
- /* Non-zero if we are doing a reverse search. */
- int reverse;
-
- /* The list of characters which terminate the search, but are not
- subsequently executed. If the variable isearch-terminators has
- been set, we use that value, otherwise we use ESC and C-J. */
- char *isearch_terminators;
+ HIST_ENTRY **hlist;
- RL_SETSTATE(RL_STATE_ISEARCH);
- orig_point = rl_point;
- orig_mark = rl_mark;
- last_found_line = orig_line = where_history ();
- reverse = direction < 0;
- hlist = history_list ();
- allocated_line = (char *)NULL;
+ cxt = _rl_scxt_alloc (RL_SEARCH_ISEARCH, 0);
+ if (direction < 0)
+ cxt->sflags |= SF_REVERSE;
- isearch_terminators = _rl_isearch_terminators ? _rl_isearch_terminators
+ cxt->search_terminators = _rl_isearch_terminators ? _rl_isearch_terminators
: default_isearch_terminators;
/* Create an arrary of pointers to the lines that we want to search. */
+ hlist = history_list ();
rl_maybe_replace_line ();
i = 0;
if (hlist)
@@ -203,354 +220,447 @@ rl_search_history (int direction, int invoking_key __attribute__((unused)))
/* Allocate space for this many lines, +1 for the current input line,
and remember those lines. */
- lines = (char **)xmalloc ((1 + (hlen = i)) * sizeof (char *));
- for (i = 0; i < hlen; i++)
- lines[i] = hlist[i]->line;
+ cxt->lines = (char **)xmalloc ((1 + (cxt->hlen = i)) * sizeof (char *));
+ for (i = 0; i < cxt->hlen; i++)
+ cxt->lines[i] = hlist[i]->line;
if (_rl_saved_line_for_history)
- lines[i] = _rl_saved_line_for_history->line;
+ cxt->lines[i] = _rl_saved_line_for_history->line;
else
{
/* Keep track of this so we can free it. */
- allocated_line = (char *)xmalloc (1 + strlen (rl_line_buffer));
- strcpy (allocated_line, &rl_line_buffer[0]);
- lines[i] = allocated_line;
+ cxt->allocated_line = (char *)xmalloc (1 + strlen (rl_line_buffer));
+ strcpy (cxt->allocated_line, &rl_line_buffer[0]);
+ cxt->lines[i] = cxt->allocated_line;
}
- hlen++;
+ cxt->hlen++;
/* The line where we start the search. */
- i = orig_line;
+ cxt->history_pos = cxt->save_line;
rl_save_prompt ();
/* Initialize search parameters. */
- search_string = (char *)xmalloc (search_string_size = 128);
- *search_string = '\0';
- search_string_index = 0;
- prev_line_found = (char *)0; /* XXX */
+ cxt->search_string = (char *)xmalloc (cxt->search_string_size = 128);
+ cxt->search_string[cxt->search_string_index = 0] = '\0';
/* Normalize DIRECTION into 1 or -1. */
- direction = (direction >= 0) ? 1 : -1;
+ cxt->direction = (direction >= 0) ? 1 : -1;
- rl_display_search (search_string, reverse, -1);
+ cxt->sline = rl_line_buffer;
+ cxt->sline_len = strlen (cxt->sline);
+ cxt->sline_index = rl_point;
- sline = rl_line_buffer;
- sline_len = strlen (sline);
- line_index = rl_point;
+ _rl_iscxt = cxt; /* save globally */
- found = failed = 0;
- for (;;)
+ return cxt;
+}
+
+static void
+_rl_isearch_fini (cxt)
+ _rl_search_cxt *cxt;
+{
+ /* First put back the original state. */
+ strcpy (rl_line_buffer, cxt->lines[cxt->save_line]);
+
+ rl_restore_prompt ();
+
+ /* Save the search string for possible later use. */
+ FREE (last_isearch_string);
+ last_isearch_string = cxt->search_string;
+ last_isearch_string_len = cxt->search_string_index;
+ cxt->search_string = 0;
+
+ if (cxt->last_found_line < cxt->save_line)
+ rl_get_previous_history (cxt->save_line - cxt->last_found_line, 0);
+ else
+ rl_get_next_history (cxt->last_found_line - cxt->save_line, 0);
+
+ /* If the string was not found, put point at the end of the last matching
+ line. If last_found_line == orig_line, we didn't find any matching
+ history lines at all, so put point back in its original position. */
+ if (cxt->sline_index < 0)
{
- rl_command_func_t *f = (rl_command_func_t *)NULL;
+ if (cxt->last_found_line == cxt->save_line)
+ cxt->sline_index = cxt->save_point;
+ else
+ cxt->sline_index = strlen (rl_line_buffer);
+ rl_mark = cxt->save_mark;
+ }
+
+ rl_point = cxt->sline_index;
+ /* Don't worry about where to put the mark here; rl_get_previous_history
+ and rl_get_next_history take care of it. */
+
+ rl_clear_message ();
+}
- /* Read a key and decide how to proceed. */
- RL_SETSTATE(RL_STATE_MOREINPUT);
- c = rl_read_key ();
- RL_UNSETSTATE(RL_STATE_MOREINPUT);
+int
+_rl_search_getchar (cxt)
+ _rl_search_cxt *cxt;
+{
+ int c;
+
+ /* Read a key and decide how to proceed. */
+ RL_SETSTATE(RL_STATE_MOREINPUT);
+ c = cxt->lastc = rl_read_key ();
+ RL_UNSETSTATE(RL_STATE_MOREINPUT);
#if defined (HANDLE_MULTIBYTE)
- if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
- c = _rl_read_mbstring (c, mb, MB_LEN_MAX);
+ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
+ c = cxt->lastc = _rl_read_mbstring (cxt->lastc, cxt->mb, MB_LEN_MAX);
#endif
- /* Translate the keys we do something with to opcodes. */
- if (c >= 0 && _rl_keymap[c].type == ISFUNC)
- {
- f = _rl_keymap[c].function;
-
- if (f == rl_reverse_search_history)
- c = reverse ? -1 : -2;
- else if (f == rl_forward_search_history)
- c = !reverse ? -1 : -2;
- else if (f == rl_rubout)
- c = -3;
- else if (c == CTRL ('G'))
- c = -4;
- else if (c == CTRL ('W')) /* XXX */
- c = -5;
- else if (c == CTRL ('Y')) /* XXX */
- c = -6;
- }
+ return c;
+}
- /* The characters in isearch_terminators (set from the user-settable
- variable isearch-terminators) are used to terminate the search but
- not subsequently execute the character as a command. The default
- value is "\033\012" (ESC and C-J). */
- if (strchr (isearch_terminators, c))
- {
- /* ESC still terminates the search, but if there is pending
- input or if input arrives within 0.1 seconds (on systems
- with select(2)) it is used as a prefix character
- with rl_execute_next. WATCH OUT FOR THIS! This is intended
- to allow the arrow keys to be used like ^F and ^B are used
- to terminate the search and execute the movement command.
- XXX - since _rl_input_available depends on the application-
- settable keyboard timeout value, this could alternatively
- use _rl_input_queued(100000) */
- if (c == ESC && _rl_input_available ())
- rl_execute_next (ESC);
- break;
- }
+/* Process just-read character C according to isearch context CXT. Return
+ -1 if the caller should just free the context and return, 0 if we should
+ break out of the loop, and 1 if we should continue to read characters. */
+int
+_rl_isearch_dispatch (cxt, c)
+ _rl_search_cxt *cxt;
+ int c;
+{
+ int n, wstart, wlen, limit, cval;
+ rl_command_func_t *f;
+
+ f = (rl_command_func_t *)NULL;
+
+ /* Translate the keys we do something with to opcodes. */
+ if (c >= 0 && _rl_keymap[c].type == ISFUNC)
+ {
+ f = _rl_keymap[c].function;
+
+ if (f == rl_reverse_search_history)
+ cxt->lastc = (cxt->sflags & SF_REVERSE) ? -1 : -2;
+ else if (f == rl_forward_search_history)
+ cxt->lastc = (cxt->sflags & SF_REVERSE) ? -2 : -1;
+ else if (f == rl_rubout)
+ cxt->lastc = -3;
+ else if (c == CTRL ('G'))
+ cxt->lastc = -4;
+ else if (c == CTRL ('W')) /* XXX */
+ cxt->lastc = -5;
+ else if (c == CTRL ('Y')) /* XXX */
+ cxt->lastc = -6;
+ }
+
+ /* The characters in isearch_terminators (set from the user-settable
+ variable isearch-terminators) are used to terminate the search but
+ not subsequently execute the character as a command. The default
+ value is "\033\012" (ESC and C-J). */
+ if (strchr (cxt->search_terminators, cxt->lastc))
+ {
+ /* ESC still terminates the search, but if there is pending
+ input or if input arrives within 0.1 seconds (on systems
+ with select(2)) it is used as a prefix character
+ with rl_execute_next. WATCH OUT FOR THIS! This is intended
+ to allow the arrow keys to be used like ^F and ^B are used
+ to terminate the search and execute the movement command.
+ XXX - since _rl_input_available depends on the application-
+ settable keyboard timeout value, this could alternatively
+ use _rl_input_queued(100000) */
+ if (cxt->lastc == ESC && _rl_input_available ())
+ rl_execute_next (ESC);
+ return (0);
+ }
#define ENDSRCH_CHAR(c) \
((CTRL_CHAR (c) || META_CHAR (c) || (c) == RUBOUT) && ((c) != CTRL ('G')))
#if defined (HANDLE_MULTIBYTE)
- if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
+ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
+ {
+ if (cxt->lastc >= 0 && (cxt->mb[0] && cxt->mb[1] == '\0') && ENDSRCH_CHAR (cxt->lastc))
+ {
+ /* This sets rl_pending_input to c; it will be picked up the next
+ time rl_read_key is called. */
+ rl_execute_next (cxt->lastc);
+ return (0);
+ }
+ }
+ else
+#endif
+ if (cxt->lastc >= 0 && ENDSRCH_CHAR (cxt->lastc))
+ {
+ /* This sets rl_pending_input to LASTC; it will be picked up the next
+ time rl_read_key is called. */
+ rl_execute_next (cxt->lastc);
+ return (0);
+ }
+
+ /* Now dispatch on the character. `Opcodes' affect the search string or
+ state. Other characters are added to the string. */
+ switch (cxt->lastc)
+ {
+ /* search again */
+ case -1:
+ if (cxt->search_string_index == 0)
{
- if (c >= 0 && strlen (mb) == 1 && ENDSRCH_CHAR (c))
+ if (last_isearch_string)
{
- /* This sets rl_pending_input to c; it will be picked up the next
- time rl_read_key is called. */
- rl_execute_next (c);
+ cxt->search_string_size = 64 + last_isearch_string_len;
+ cxt->search_string = (char *)xrealloc (cxt->search_string, cxt->search_string_size);
+ strcpy (cxt->search_string, last_isearch_string);
+ cxt->search_string_index = last_isearch_string_len;
+ rl_display_search (cxt->search_string, (cxt->sflags & SF_REVERSE), -1);
break;
}
+ return (1);
}
+ else if (cxt->sflags & SF_REVERSE)
+ cxt->sline_index--;
+ else if (cxt->sline_index != cxt->sline_len)
+ cxt->sline_index++;
else
-#endif
- if (c >= 0 && ENDSRCH_CHAR (c))
+ rl_ding ();
+ break;
+
+ /* switch directions */
+ case -2:
+ cxt->direction = -cxt->direction;
+ if (cxt->direction < 0)
+ cxt->sflags |= SF_REVERSE;
+ else
+ cxt->sflags &= ~SF_REVERSE;
+ break;
+
+ /* delete character from search string. */
+ case -3: /* C-H, DEL */
+ /* This is tricky. To do this right, we need to keep a
+ stack of search positions for the current search, with
+ sentinels marking the beginning and end. But this will
+ do until we have a real isearch-undo. */
+ if (cxt->search_string_index == 0)
+ rl_ding ();
+ else
+ cxt->search_string[--cxt->search_string_index] = '\0';
+ break;
+
+ case -4: /* C-G, abort */
+ rl_replace_line (cxt->lines[cxt->save_line], 0);
+ rl_point = cxt->save_point;
+ rl_mark = cxt->save_mark;
+ rl_restore_prompt();
+ rl_clear_message ();
+
+ return -1;
+
+ case -5: /* C-W */
+ /* skip over portion of line we already matched and yank word */
+ wstart = rl_point + cxt->search_string_index;
+ if (wstart >= rl_end)
{
- /* This sets rl_pending_input to c; it will be picked up the next
- time rl_read_key is called. */
- rl_execute_next (c);
+ rl_ding ();
break;
}
- switch (c)
+ /* if not in a word, move to one. */
+ cval = _rl_char_value (rl_line_buffer, wstart);
+ if (_rl_walphabetic (cval) == 0)
{
- case -1:
- if (search_string_index == 0)
- {
- if (last_isearch_string)
- {
- search_string_size = 64 + last_isearch_string_len;
- search_string = (char *)xrealloc (search_string, search_string_size);
- strcpy (search_string, last_isearch_string);
- search_string_index = last_isearch_string_len;
- rl_display_search (search_string, reverse, -1);
- break;
- }
- continue;
- }
- else if (reverse)
- --line_index;
- else if (line_index != sline_len)
- ++line_index;
- else
- rl_ding ();
+ rl_ding ();
break;
-
- /* switch directions */
- case -2:
- direction = -direction;
- reverse = direction < 0;
+ }
+ n = MB_NEXTCHAR (rl_line_buffer, wstart, 1, MB_FIND_NONZERO);;
+ while (n < rl_end)
+ {
+ cval = _rl_char_value (rl_line_buffer, n);
+ if (_rl_walphabetic (cval) == 0)
+ break;
+ n = MB_NEXTCHAR (rl_line_buffer, n, 1, MB_FIND_NONZERO);;
+ }
+ wlen = n - wstart + 1;
+ if (cxt->search_string_index + wlen + 1 >= cxt->search_string_size)
+ {
+ cxt->search_string_size += wlen + 1;
+ cxt->search_string = (char *)xrealloc (cxt->search_string, cxt->search_string_size);
+ }
+ for (; wstart < n; wstart++)
+ cxt->search_string[cxt->search_string_index++] = rl_line_buffer[wstart];
+ cxt->search_string[cxt->search_string_index] = '\0';
+ break;
+
+ case -6: /* C-Y */
+ /* skip over portion of line we already matched and yank rest */
+ wstart = rl_point + cxt->search_string_index;
+ if (wstart >= rl_end)
+ {
+ rl_ding ();
break;
+ }
+ n = rl_end - wstart + 1;
+ if (cxt->search_string_index + n + 1 >= cxt->search_string_size)
+ {
+ cxt->search_string_size += n + 1;
+ cxt->search_string = (char *)xrealloc (cxt->search_string, cxt->search_string_size);
+ }
+ for (n = wstart; n < rl_end; n++)
+ cxt->search_string[cxt->search_string_index++] = rl_line_buffer[n];
+ cxt->search_string[cxt->search_string_index] = '\0';
+ break;
+
+ /* Add character to search string and continue search. */
+ default:
+ if (cxt->search_string_index + 2 >= cxt->search_string_size)
+ {
+ cxt->search_string_size += 128;
+ cxt->search_string = (char *)xrealloc (cxt->search_string, cxt->search_string_size);
+ }
+#if defined (HANDLE_MULTIBYTE)
+ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
+ {
+ int j, l;
+ for (j = 0, l = strlen (cxt->mb); j < l; )
+ cxt->search_string[cxt->search_string_index++] = cxt->mb[j++];
+ }
+ else
+#endif
+ cxt->search_string[cxt->search_string_index++] = c;
+ cxt->search_string[cxt->search_string_index] = '\0';
+ break;
+ }
- /* delete character from search string. */
- case -3: /* C-H, DEL */
- /* This is tricky. To do this right, we need to keep a
- stack of search positions for the current search, with
- sentinels marking the beginning and end. But this will
- do until we have a real isearch-undo. */
- if (search_string_index == 0)
- rl_ding ();
- else
- search_string[--search_string_index] = '\0';
-
- break;
+ for (cxt->sflags &= ~(SF_FOUND|SF_FAILED);; )
+ {
+ limit = cxt->sline_len - cxt->search_string_index + 1;
- case -4: /* C-G */
- rl_replace_line (lines[orig_line], 0);
- rl_point = orig_point;
- rl_mark = orig_mark;
- rl_restore_prompt();
- rl_clear_message ();
- if (allocated_line)
- free (allocated_line);
- free (lines);
- RL_UNSETSTATE(RL_STATE_ISEARCH);
- return 0;
-
- case -5: /* C-W */
- /* skip over portion of line we already matched */
- wstart = rl_point + search_string_index;
- if (wstart >= rl_end)
+ /* Search the current line. */
+ while ((cxt->sflags & SF_REVERSE) ? (cxt->sline_index >= 0) : (cxt->sline_index < limit))
+ {
+ if (STREQN (cxt->search_string, cxt->sline + cxt->sline_index, cxt->search_string_index))
{
- rl_ding ();
+ cxt->sflags |= SF_FOUND;
break;
}
+ else
+ cxt->sline_index += cxt->direction;
+ }
+ if (cxt->sflags & SF_FOUND)
+ break;
- /* if not in a word, move to one. */
- if (rl_alphabetic(rl_line_buffer[wstart]) == 0)
- {
- rl_ding ();
- break;
- }
- n = wstart;
- while (n < rl_end && rl_alphabetic(rl_line_buffer[n]))
- n++;
- wlen = n - wstart + 1;
- if (search_string_index + wlen + 1 >= search_string_size)
- {
- search_string_size += wlen + 1;
- search_string = (char *)xrealloc (search_string, search_string_size);
- }
- for (; wstart < n; wstart++)
- search_string[search_string_index++] = rl_line_buffer[wstart];
- search_string[search_string_index] = '\0';
- break;
+ /* Move to the next line, but skip new copies of the line
+ we just found and lines shorter than the string we're
+ searching for. */
+ do
+ {
+ /* Move to the next line. */
+ cxt->history_pos += cxt->direction;
- case -6: /* C-Y */
- /* skip over portion of line we already matched */
- wstart = rl_point + search_string_index;
- if (wstart >= rl_end)
+ /* At limit for direction? */
+ if ((cxt->sflags & SF_REVERSE) ? (cxt->history_pos < 0) : (cxt->history_pos == cxt->hlen))
{
- rl_ding ();
+ cxt->sflags |= SF_FAILED;
break;
}
- n = rl_end - wstart + 1;
- if (search_string_index + n + 1 >= search_string_size)
- {
- search_string_size += n + 1;
- search_string = (char *)xrealloc (search_string, search_string_size);
- }
- for (n = wstart; n < rl_end; n++)
- search_string[search_string_index++] = rl_line_buffer[n];
- search_string[search_string_index] = '\0';
- break;
- default:
- /* Add character to search string and continue search. */
- if (search_string_index + 2 >= search_string_size)
- {
- search_string_size += 128;
- search_string = (char *)xrealloc (search_string, search_string_size);
- }
-#if defined (HANDLE_MULTIBYTE)
- if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
- {
- int j, l;
- for (j = 0, l = strlen (mb); j < l; )
- search_string[search_string_index++] = mb[j++];
- }
- else
-#endif
- search_string[search_string_index++] = c;
- search_string[search_string_index] = '\0';
- break;
+ /* We will need these later. */
+ cxt->sline = cxt->lines[cxt->history_pos];
+ cxt->sline_len = strlen (cxt->sline);
}
+ while ((cxt->prev_line_found && STREQ (cxt->prev_line_found, cxt->lines[cxt->history_pos])) ||
+ (cxt->search_string_index > cxt->sline_len));
- for (found = failed = 0;;)
- {
- int limit = sline_len - search_string_index + 1;
+ if (cxt->sflags & SF_FAILED)
+ break;
- /* Search the current line. */
- while (reverse ? (line_index >= 0) : (line_index < limit))
- {
- if (STREQN (search_string, sline + line_index, search_string_index))
- {
- found++;
- break;
- }
- else
- line_index += direction;
- }
- if (found)
- break;
+ /* Now set up the line for searching... */
+ cxt->sline_index = (cxt->sflags & SF_REVERSE) ? cxt->sline_len - cxt->search_string_index : 0;
+ }
- /* Move to the next line, but skip new copies of the line
- we just found and lines shorter than the string we're
- searching for. */
- do
- {
- /* Move to the next line. */
- i += direction;
-
- /* At limit for direction? */
- if (reverse ? (i < 0) : (i == hlen))
- {
- failed++;
- break;
- }
-
- /* We will need these later. */
- sline = lines[i];
- sline_len = strlen (sline);
- }
- while ((prev_line_found && STREQ (prev_line_found, lines[i])) ||
- (search_string_index > sline_len));
+ if (cxt->sflags & SF_FAILED)
+ {
+ /* We cannot find the search string. Ding the bell. */
+ rl_ding ();
+ cxt->history_pos = cxt->last_found_line;
+ return 1;
+ }
- if (failed)
- break;
+ /* We have found the search string. Just display it. But don't
+ actually move there in the history list until the user accepts
+ the location. */
+ if (cxt->sflags & SF_FOUND)
+ {
+ cxt->prev_line_found = cxt->lines[cxt->history_pos];
+ rl_replace_line (cxt->lines[cxt->history_pos], 0);
+ rl_point = cxt->sline_index;
+ cxt->last_found_line = cxt->history_pos;
+ rl_display_search (cxt->search_string, (cxt->sflags & SF_REVERSE), (cxt->history_pos == cxt->save_line) ? -1 : cxt->history_pos);
+ }
- /* Now set up the line for searching... */
- line_index = reverse ? sline_len - search_string_index : 0;
- }
+ return 1;
+}
- if (failed)
- {
- /* We cannot find the search string. Ding the bell. */
- rl_ding ();
- i = last_found_line;
- continue; /* XXX - was break */
- }
+static int
+_rl_isearch_cleanup (cxt, r)
+ _rl_search_cxt *cxt;
+ int r;
+{
+ if (r >= 0)
+ _rl_isearch_fini (cxt);
+ _rl_scxt_dispose (cxt, 0);
+ _rl_iscxt = 0;
- /* We have found the search string. Just display it. But don't
- actually move there in the history list until the user accepts
- the location. */
- if (found)
- {
- prev_line_found = lines[i];
- rl_replace_line (lines[i], 0);
- rl_point = line_index;
- last_found_line = i;
- rl_display_search (search_string, reverse, (i == orig_line) ? -1 : i);
- }
- }
+ RL_UNSETSTATE(RL_STATE_ISEARCH);
- /* The searching is over. The user may have found the string that she
- was looking for, or else she may have exited a failing search. If
- LINE_INDEX is -1, then that shows that the string searched for was
- not found. We use this to determine where to place rl_point. */
+ return (r != 0);
+}
- /* First put back the original state. */
- strcpy (rl_line_buffer, lines[orig_line]);
+/* Search through the history looking for an interactively typed string.
+ This is analogous to i-search. We start the search in the current line.
+ DIRECTION is which direction to search; >= 0 means forward, < 0 means
+ backwards. */
+static int
+rl_search_history (direction, invoking_key)
+ int direction, invoking_key;
+{
+ _rl_search_cxt *cxt; /* local for now, but saved globally */
+ int c, r;
- rl_restore_prompt ();
+ RL_SETSTATE(RL_STATE_ISEARCH);
+ cxt = _rl_isearch_init (direction);
- /* Save the search string for possible later use. */
- FREE (last_isearch_string);
- last_isearch_string = search_string;
- last_isearch_string_len = search_string_index;
+ rl_display_search (cxt->search_string, (cxt->sflags & SF_REVERSE), -1);
- if (last_found_line < orig_line)
- rl_get_previous_history (orig_line - last_found_line, 0);
- else
- rl_get_next_history (last_found_line - orig_line, 0);
+ /* If we are using the callback interface, all we do is set up here and
+ return. The key is that we leave RL_STATE_ISEARCH set. */
+ if (RL_ISSTATE (RL_STATE_CALLBACK))
+ return (0);
- /* If the string was not found, put point at the end of the last matching
- line. If last_found_line == orig_line, we didn't find any matching
- history lines at all, so put point back in its original position. */
- if (line_index < 0)
+ r = -1;
+ for (;;)
{
- if (last_found_line == orig_line)
- line_index = orig_point;
- else
- line_index = strlen (rl_line_buffer);
- rl_mark = orig_mark;
+ c = _rl_search_getchar (cxt);
+ /* We might want to handle EOF here (c == 0) */
+ r = _rl_isearch_dispatch (cxt, cxt->lastc);
+ if (r <= 0)
+ break;
}
- rl_point = line_index;
- /* Don't worry about where to put the mark here; rl_get_previous_history
- and rl_get_next_history take care of it. */
-
- rl_clear_message ();
+ /* The searching is over. The user may have found the string that she
+ was looking for, or else she may have exited a failing search. If
+ LINE_INDEX is -1, then that shows that the string searched for was
+ not found. We use this to determine where to place rl_point. */
+ return (_rl_isearch_cleanup (cxt, r));
+}
- FREE (allocated_line);
- free (lines);
+#if defined (READLINE_CALLBACKS)
+/* Called from the callback functions when we are ready to read a key. The
+ callback functions know to call this because RL_ISSTATE(RL_STATE_ISEARCH).
+ If _rl_isearch_dispatch finishes searching, this function is responsible
+ for turning off RL_STATE_ISEARCH, which it does using _rl_isearch_cleanup. */
+int
+_rl_isearch_callback (cxt)
+ _rl_search_cxt *cxt;
+{
+ int c, r;
- RL_UNSETSTATE(RL_STATE_ISEARCH);
+ c = _rl_search_getchar (cxt);
+ /* We might want to handle EOF here */
+ r = _rl_isearch_dispatch (cxt, cxt->lastc);
- return 0;
+ return (r <= 0) ? _rl_isearch_cleanup (cxt, r) : 0;
}
+#endif
diff --git a/cmd-line-utils/readline/keymaps.c b/cmd-line-utils/readline/keymaps.c
index 2be03f7086f..70d0cc08d3f 100644
--- a/cmd-line-utils/readline/keymaps.c
+++ b/cmd-line-utils/readline/keymaps.c
@@ -20,7 +20,9 @@
Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#if defined (HAVE_STDLIB_H)
# include <stdlib.h>
diff --git a/cmd-line-utils/readline/kill.c b/cmd-line-utils/readline/kill.c
index 4d31a8ff170..031ddf47c5b 100644
--- a/cmd-line-utils/readline/kill.c
+++ b/cmd-line-utils/readline/kill.c
@@ -21,7 +21,9 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#include <sys/types.h>
@@ -76,7 +78,8 @@ static int rl_yank_nth_arg_internal PARAMS((int, int, int));
/* How to say that you only want to save a certain amount
of kill material. */
int
-rl_set_retained_kills (int num __attribute__((unused)))
+rl_set_retained_kills (num)
+ int num;
{
return 0;
}
@@ -292,8 +295,8 @@ rl_backward_kill_line (direction, ignore)
/* Kill the whole line, no matter where point is. */
int
-rl_kill_full_line (int count __attribute__((unused)),
- int ignore __attribute__((unused)))
+rl_kill_full_line (count, ignore)
+ int count, ignore;
{
rl_begin_undo_group ();
rl_point = 0;
@@ -310,7 +313,8 @@ rl_kill_full_line (int count __attribute__((unused)),
/* This does what C-w does in Unix. We can't prevent people from
using behaviour that they expect. */
int
-rl_unix_word_rubout (int count, int key __attribute__((unused)))
+rl_unix_word_rubout (count, key)
+ int count, key;
{
int orig_point;
@@ -342,7 +346,8 @@ rl_unix_word_rubout (int count, int key __attribute__((unused)))
/* This deletes one filename component in a Unix pathname. That is, it
deletes backward to directory separator (`/') or whitespace. */
int
-rl_unix_filename_rubout (int count, int key __attribute__((unused)))
+rl_unix_filename_rubout (count, key)
+ int count, key;
{
int orig_point, c;
@@ -385,8 +390,8 @@ rl_unix_filename_rubout (int count, int key __attribute__((unused)))
into the line at all, and if you aren't, then you know what you are
doing. */
int
-rl_unix_line_discard (int count __attribute__((unused)),
- int key __attribute__((unused)))
+rl_unix_line_discard (count, key)
+ int count, key;
{
if (rl_point == 0)
rl_ding ();
@@ -422,16 +427,16 @@ region_kill_internal (delete)
/* Copy the text in the region to the kill ring. */
int
-rl_copy_region_to_kill (int count __attribute__((unused)),
- int key __attribute__((unused)))
+rl_copy_region_to_kill (count, ignore)
+ int count, ignore;
{
return (region_kill_internal (0));
}
/* Kill the text between the point and mark. */
int
-rl_kill_region (int count __attribute__((unused)),
- int ignore __attribute__((unused)))
+rl_kill_region (count, ignore)
+ int count, ignore;
{
int r, npoint;
@@ -495,7 +500,8 @@ rl_copy_backward_word (count, key)
/* Yank back the last killed text. This ignores arguments. */
int
-rl_yank (int count __attribute__((unused)), int ignore __attribute__((unused)))
+rl_yank (count, ignore)
+ int count, ignore;
{
if (rl_kill_ring == 0)
{
@@ -513,7 +519,8 @@ rl_yank (int count __attribute__((unused)), int ignore __attribute__((unused)))
delete that text from the line, rotate the index down, and
yank back some other text. */
int
-rl_yank_pop (int count __attribute__((unused)), int key __attribute__((unused)))
+rl_yank_pop (count, key)
+ int count, key;
{
int l, n;
@@ -575,6 +582,7 @@ rl_yank_nth_arg_internal (count, ignore, history_skip)
if (!arg || !*arg)
{
rl_ding ();
+ FREE (arg);
return -1;
}
diff --git a/cmd-line-utils/readline/macro.c b/cmd-line-utils/readline/macro.c
index 8727285e181..00cd58d628c 100644
--- a/cmd-line-utils/readline/macro.c
+++ b/cmd-line-utils/readline/macro.c
@@ -21,7 +21,9 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#include <sys/types.h>
@@ -98,6 +100,8 @@ _rl_with_macro_input (string)
int
_rl_next_macro_key ()
{
+ int c;
+
if (rl_executing_macro == 0)
return (0);
@@ -107,7 +111,14 @@ _rl_next_macro_key ()
return (_rl_next_macro_key ());
}
+#if defined (READLINE_CALLBACKS)
+ c = rl_executing_macro[executing_macro_index++];
+ if (RL_ISSTATE (RL_STATE_CALLBACK) && RL_ISSTATE (RL_STATE_READCMD|RL_STATE_MOREINPUT) && rl_executing_macro[executing_macro_index] == 0)
+ _rl_pop_executing_macro ();
+ return c;
+#else
return (rl_executing_macro[executing_macro_index++]);
+#endif
}
/* Save the currently executing macro on a stack of saved macros. */
@@ -189,8 +200,8 @@ _rl_kill_kbd_macro ()
definition to the end of the existing macro, and start by
re-executing the existing macro. */
int
-rl_start_kbd_macro (int ignore1 __attribute__((unused)),
- int ignore2 __attribute__((unused)))
+rl_start_kbd_macro (ignore1, ignore2)
+ int ignore1, ignore2;
{
if (RL_ISSTATE (RL_STATE_MACRODEF))
{
@@ -214,7 +225,8 @@ rl_start_kbd_macro (int ignore1 __attribute__((unused)),
A numeric argument says to execute the macro right now,
that many times, counting the definition as the first time. */
int
-rl_end_kbd_macro (int count, int ignore __attribute__((unused)))
+rl_end_kbd_macro (count, ignore)
+ int count, ignore;
{
if (RL_ISSTATE (RL_STATE_MACRODEF) == 0)
{
@@ -233,7 +245,8 @@ rl_end_kbd_macro (int count, int ignore __attribute__((unused)))
/* Execute the most recently defined keyboard macro.
COUNT says how many times to execute it. */
int
-rl_call_last_kbd_macro (int count, int ignore __attribute__((unused)))
+rl_call_last_kbd_macro (count, ignore)
+ int count, ignore;
{
if (current_macro == 0)
_rl_abort_internal ();
diff --git a/cmd-line-utils/readline/mbutil.c b/cmd-line-utils/readline/mbutil.c
index 284ea63aae4..17dde53ed7b 100644
--- a/cmd-line-utils/readline/mbutil.c
+++ b/cmd-line-utils/readline/mbutil.c
@@ -1,6 +1,6 @@
/* mbutil.c -- readline multibyte character utility functions */
-/* Copyright (C) 2001-2004 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2005 Free Software Foundation, Inc.
This file is part of the GNU Readline Library, a library for
reading lines of text with interactive input and history editing.
@@ -21,16 +21,11 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 500
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
#endif
-#include "config_readline.h"
-
#include <sys/types.h>
-
-/* To get SuSE 9.3 to define wcwidth() (in wchar.h) */
-
#include <fcntl.h>
#include "posixjmp.h"
@@ -82,18 +77,20 @@ _rl_find_next_mbchar_internal (string, seed, count, find_non_zero)
char *string;
int seed, count, find_non_zero;
{
- size_t tmp = 0;
+ size_t tmp;
mbstate_t ps;
- int point = 0;
+ int point;
wchar_t wc;
+ tmp = 0;
+
memset(&ps, 0, sizeof (mbstate_t));
if (seed < 0)
seed = 0;
if (count <= 0)
return seed;
- point = seed + _rl_adjust_point(string, seed, &ps);
+ point = seed + _rl_adjust_point (string, seed, &ps);
/* if this is true, means that seed was not pointed character
started byte. So correct the point and consume count */
if (seed < point)
@@ -131,15 +128,16 @@ _rl_find_next_mbchar_internal (string, seed, count, find_non_zero)
if (find_non_zero)
{
tmp = mbrtowc (&wc, string + point, strlen (string + point), &ps);
- while (wcwidth (wc) == 0)
+ while (tmp > 0 && wcwidth (wc) == 0)
{
point += tmp;
tmp = mbrtowc (&wc, string + point, strlen (string + point), &ps);
- if (tmp == (size_t)(0) || tmp == (size_t)(-1) || tmp == (size_t)(-2))
+ if (MB_NULLWCH (tmp) || MB_INVALIDCH (tmp))
break;
}
}
- return point;
+
+ return point;
}
static int
@@ -318,6 +316,28 @@ _rl_is_mbchar_matched (string, seed, end, mbchar, length)
return 0;
return 1;
}
+
+wchar_t
+_rl_char_value (buf, ind)
+ char *buf;
+ int ind;
+{
+ size_t tmp;
+ wchar_t wc;
+ mbstate_t ps;
+ int l;
+
+ if (MB_LEN_MAX == 1 || rl_byte_oriented)
+ return ((wchar_t) buf[ind]);
+ l = strlen (buf);
+ if (ind >= l - 1)
+ return ((wchar_t) buf[ind]);
+ memset (&ps, 0, sizeof (mbstate_t));
+ tmp = mbrtowc (&wc, buf + ind, l - ind, &ps);
+ if (MB_INVALIDCH (tmp) || MB_NULLWCH (tmp))
+ return ((wchar_t) buf[ind]);
+ return wc;
+}
#endif /* HANDLE_MULTIBYTE */
/* Find next `count' characters started byte point of the specified seed.
diff --git a/cmd-line-utils/readline/misc.c b/cmd-line-utils/readline/misc.c
index c8739d0d750..94ecb25900a 100644
--- a/cmd-line-utils/readline/misc.c
+++ b/cmd-line-utils/readline/misc.c
@@ -1,6 +1,6 @@
/* misc.c -- miscellaneous bindable readline functions. */
-/* Copyright (C) 1987-2004 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2005 Free Software Foundation, Inc.
This file is part of the GNU Readline Library, a library for
reading lines of text with interactive input and history editing.
@@ -21,7 +21,9 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#if defined (HAVE_UNISTD_H)
# include <unistd.h>
@@ -61,6 +63,8 @@ void _rl_free_history_entry PARAMS((HIST_ENTRY *));
to preserve the value of rl_point from line to line. */
int _rl_history_preserve_point = 0;
+_rl_arg_cxt _rl_argcxt;
+
/* Saved target point for when _rl_history_preserve_point is set. Special
value of -1 means that point is at the end of the line. */
int _rl_history_saved_point = -1;
@@ -71,77 +75,74 @@ int _rl_history_saved_point = -1;
/* */
/* **************************************************************** */
-/* Handle C-u style numeric args, as well as M--, and M-digits. */
-static int
-rl_digit_loop ()
+int
+_rl_arg_overflow ()
{
- int key, c, sawminus, sawdigits;
+ if (rl_numeric_arg > 1000000)
+ {
+ _rl_argcxt = 0;
+ rl_explicit_arg = rl_numeric_arg = 0;
+ rl_ding ();
+ rl_restore_prompt ();
+ rl_clear_message ();
+ RL_UNSETSTATE(RL_STATE_NUMERICARG);
+ return 1;
+ }
+ return 0;
+}
+void
+_rl_arg_init ()
+{
rl_save_prompt ();
-
+ _rl_argcxt = 0;
RL_SETSTATE(RL_STATE_NUMERICARG);
- sawminus = sawdigits = 0;
- while (1)
- {
- if (rl_numeric_arg > 1000000)
- {
- sawdigits = rl_explicit_arg = rl_numeric_arg = 0;
- rl_ding ();
- rl_restore_prompt ();
- rl_clear_message ();
- RL_UNSETSTATE(RL_STATE_NUMERICARG);
- return 1;
- }
- rl_message ("(arg: %d) ", rl_arg_sign * rl_numeric_arg);
- RL_SETSTATE(RL_STATE_MOREINPUT);
- key = c = rl_read_key ();
- RL_UNSETSTATE(RL_STATE_MOREINPUT);
+}
- if (c < 0)
- {
- _rl_abort_internal ();
- return -1;
- }
+int
+_rl_arg_getchar ()
+{
+ int c;
- /* If we see a key bound to `universal-argument' after seeing digits,
- it ends the argument but is otherwise ignored. */
- if (_rl_keymap[c].type == ISFUNC &&
- _rl_keymap[c].function == rl_universal_argument)
- {
- if (sawdigits == 0)
- {
- rl_numeric_arg *= 4;
- continue;
- }
- else
- {
- RL_SETSTATE(RL_STATE_MOREINPUT);
- key = rl_read_key ();
- RL_UNSETSTATE(RL_STATE_MOREINPUT);
- rl_restore_prompt ();
- rl_clear_message ();
- RL_UNSETSTATE(RL_STATE_NUMERICARG);
- return (_rl_dispatch (key, _rl_keymap));
- }
- }
+ rl_message ("(arg: %d) ", rl_arg_sign * rl_numeric_arg);
+ RL_SETSTATE(RL_STATE_MOREINPUT);
+ c = rl_read_key ();
+ RL_UNSETSTATE(RL_STATE_MOREINPUT);
- c = UNMETA (c);
+ return c;
+}
- if (_rl_digit_p (c))
- {
- rl_numeric_arg = rl_explicit_arg ? (rl_numeric_arg * 10) + c - '0' : c - '0';
- sawdigits = rl_explicit_arg = 1;
- }
- else if (c == '-' && rl_explicit_arg == 0)
+/* Process C as part of the current numeric argument. Return -1 if the
+ argument should be aborted, 0 if we should not read any more chars, and
+ 1 if we should continue to read chars. */
+int
+_rl_arg_dispatch (cxt, c)
+ _rl_arg_cxt cxt;
+ int c;
+{
+ int key, r;
+
+ key = c;
+
+ /* If we see a key bound to `universal-argument' after seeing digits,
+ it ends the argument but is otherwise ignored. */
+ if (_rl_keymap[c].type == ISFUNC && _rl_keymap[c].function == rl_universal_argument)
+ {
+ if ((cxt & NUM_SAWDIGITS) == 0)
{
- rl_numeric_arg = sawminus = 1;
- rl_arg_sign = -1;
+ rl_numeric_arg *= 4;
+ return 1;
}
+ else if (RL_ISSTATE (RL_STATE_CALLBACK))
+ {
+ _rl_argcxt |= NUM_READONE;
+ return 0; /* XXX */
+ }
else
{
- /* Make M-- command equivalent to M--1 command. */
- if (sawminus && rl_numeric_arg == 1 && rl_explicit_arg == 0)
- rl_explicit_arg = 1;
+ RL_SETSTATE(RL_STATE_MOREINPUT);
+ key = rl_read_key ();
+ RL_UNSETSTATE(RL_STATE_MOREINPUT);
rl_restore_prompt ();
rl_clear_message ();
RL_UNSETSTATE(RL_STATE_NUMERICARG);
@@ -149,45 +150,144 @@ rl_digit_loop ()
}
}
- /*NOTREACHED*/
-}
+ c = UNMETA (c);
-/* Add the current digit to the argument in progress. */
-int
-rl_digit_argument (int ignore __attribute__((unused)), int key)
-{
- rl_execute_next (key);
- return (rl_digit_loop ());
+ if (_rl_digit_p (c))
+ {
+ r = _rl_digit_value (c);
+ rl_numeric_arg = rl_explicit_arg ? (rl_numeric_arg * 10) + r : r;
+ rl_explicit_arg = 1;
+ _rl_argcxt |= NUM_SAWDIGITS;
+ }
+ else if (c == '-' && rl_explicit_arg == 0)
+ {
+ rl_numeric_arg = 1;
+ _rl_argcxt |= NUM_SAWMINUS;
+ rl_arg_sign = -1;
+ }
+ else
+ {
+ /* Make M-- command equivalent to M--1 command. */
+ if ((_rl_argcxt & NUM_SAWMINUS) && rl_numeric_arg == 1 && rl_explicit_arg == 0)
+ rl_explicit_arg = 1;
+ rl_restore_prompt ();
+ rl_clear_message ();
+ RL_UNSETSTATE(RL_STATE_NUMERICARG);
+
+ r = _rl_dispatch (key, _rl_keymap);
+ if (RL_ISSTATE (RL_STATE_CALLBACK))
+ {
+ /* At worst, this will cause an extra redisplay. Otherwise,
+ we have to wait until the next character comes in. */
+ if (rl_done == 0)
+ (*rl_redisplay_function) ();
+ r = 0;
+ }
+ return r;
+ }
+
+ return 1;
}
-/* What to do when you abort reading an argument. */
-int
-rl_discard_argument ()
+/* Handle C-u style numeric args, as well as M--, and M-digits. */
+static int
+rl_digit_loop ()
{
- rl_ding ();
- rl_clear_message ();
- _rl_init_argument ();
- return 0;
+ int c, r;
+
+ while (1)
+ {
+ if (_rl_arg_overflow ())
+ return 1;
+
+ c = _rl_arg_getchar ();
+
+ if (c < 0)
+ {
+ _rl_abort_internal ();
+ return -1;
+ }
+
+ r = _rl_arg_dispatch (_rl_argcxt, c);
+ if (r <= 0 || (RL_ISSTATE (RL_STATE_NUMERICARG) == 0))
+ break;
+ }
+
+ return r;
}
/* Create a default argument. */
-int
-_rl_init_argument ()
+void
+_rl_reset_argument ()
{
rl_numeric_arg = rl_arg_sign = 1;
rl_explicit_arg = 0;
- return 0;
+ _rl_argcxt = 0;
+}
+
+/* Start a numeric argument with initial value KEY */
+int
+rl_digit_argument (ignore, key)
+ int ignore, key;
+{
+ _rl_arg_init ();
+ if (RL_ISSTATE (RL_STATE_CALLBACK))
+ {
+ _rl_arg_dispatch (_rl_argcxt, key);
+ rl_message ("(arg: %d) ", rl_arg_sign * rl_numeric_arg);
+ return 0;
+ }
+ else
+ {
+ rl_execute_next (key);
+ return (rl_digit_loop ());
+ }
}
/* C-u, universal argument. Multiply the current argument by 4.
Read a key. If the key has nothing to do with arguments, then
dispatch on it. If the key is the abort character then abort. */
int
-rl_universal_argument (int count __attribute__((unused)),
- int key __attribute__((unused)))
+rl_universal_argument (count, key)
+ int count, key;
{
+ _rl_arg_init ();
rl_numeric_arg *= 4;
- return (rl_digit_loop ());
+
+ return (RL_ISSTATE (RL_STATE_CALLBACK) ? 0 : rl_digit_loop ());
+}
+
+int
+_rl_arg_callback (cxt)
+ _rl_arg_cxt cxt;
+{
+ int c, r;
+
+ c = _rl_arg_getchar ();
+
+ if (_rl_argcxt & NUM_READONE)
+ {
+ _rl_argcxt &= ~NUM_READONE;
+ rl_restore_prompt ();
+ rl_clear_message ();
+ RL_UNSETSTATE(RL_STATE_NUMERICARG);
+ rl_execute_next (c);
+ return 0;
+ }
+
+ r = _rl_arg_dispatch (cxt, c);
+ return (r != 1);
+}
+
+/* What to do when you abort reading an argument. */
+int
+rl_discard_argument ()
+{
+ rl_ding ();
+ rl_clear_message ();
+ _rl_reset_argument ();
+
+ return 0;
}
/* **************************************************************** */
@@ -222,8 +322,10 @@ _rl_free_history_entry (entry)
{
if (entry == 0)
return;
- if (entry->line)
- free (entry->line);
+
+ FREE (entry->line);
+ FREE (entry->timestamp);
+
free (entry);
}
@@ -239,6 +341,7 @@ rl_maybe_replace_line ()
{
temp = replace_history_entry (where_history (), rl_line_buffer, (histdata_t)rl_undo_list);
free (temp->line);
+ FREE (temp->timestamp);
free (temp);
}
return 0;
@@ -271,14 +374,9 @@ rl_maybe_save_line ()
{
_rl_saved_line_for_history = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY));
_rl_saved_line_for_history->line = savestring (rl_line_buffer);
+ _rl_saved_line_for_history->timestamp = (char *)NULL;
_rl_saved_line_for_history->data = (char *)rl_undo_list;
}
- else if (STREQ (rl_line_buffer, _rl_saved_line_for_history->line) == 0)
- {
- free (_rl_saved_line_for_history->line);
- _rl_saved_line_for_history->line = savestring (rl_line_buffer);
- _rl_saved_line_for_history->data = (char *)rl_undo_list; /* XXX possible memleak */
- }
return 0;
}
@@ -313,7 +411,9 @@ _rl_history_set_point ()
}
void
-rl_replace_from_history (HIST_ENTRY *entry, int flags __attribute__((unused)))
+rl_replace_from_history (entry, flags)
+ HIST_ENTRY *entry;
+ int flags; /* currently unused */
{
/* Can't call with `1' because rl_undo_list might point to an undo list
from a history entry, just like we're setting up here. */
@@ -339,15 +439,16 @@ rl_replace_from_history (HIST_ENTRY *entry, int flags __attribute__((unused)))
/* Meta-< goes to the start of the history. */
int
-rl_beginning_of_history (int count __attribute__((unused)), int key)
+rl_beginning_of_history (count, key)
+ int count, key;
{
return (rl_get_previous_history (1 + where_history (), key));
}
/* Meta-> goes to the end of the history. (The current line). */
int
-rl_end_of_history (int count __attribute__((unused)),
- int key __attribute__((unused)))
+rl_end_of_history (count, key)
+ int count, key;
{
rl_maybe_replace_line ();
using_history ();
@@ -451,7 +552,8 @@ rl_get_previous_history (count, key)
/* **************************************************************** */
/* How to toggle back and forth between editing modes. */
int
-rl_vi_editing_mode (int count __attribute__((unused)), int key)
+rl_vi_editing_mode (count, key)
+ int count, key;
{
#if defined (VI_MODE)
_rl_set_insert_mode (RL_IM_INSERT, 1); /* vi mode ignores insert mode */
@@ -463,8 +565,8 @@ rl_vi_editing_mode (int count __attribute__((unused)), int key)
}
int
-rl_emacs_editing_mode (int count __attribute__((unused)),
- int key __attribute__((unused)))
+rl_emacs_editing_mode (count, key)
+ int count, key;
{
rl_editing_mode = emacs_mode;
_rl_set_insert_mode (RL_IM_INSERT, 1); /* emacs mode default is insert mode */
@@ -474,7 +576,8 @@ rl_emacs_editing_mode (int count __attribute__((unused)),
/* Function for the rest of the library to use to set insert/overwrite mode. */
void
-_rl_set_insert_mode (int im, int force __attribute__((unused)))
+_rl_set_insert_mode (im, force)
+ int im, force;
{
#ifdef CURSOR_MODE
_rl_set_cursor (im, force);
@@ -486,7 +589,8 @@ _rl_set_insert_mode (int im, int force __attribute__((unused)))
/* Toggle overwrite mode. A positive explicit argument selects overwrite
mode. A negative or zero explicit argument selects insert mode. */
int
-rl_overwrite_mode (int count, int key __attribute__((unused)))
+rl_overwrite_mode (count, key)
+ int count, key;
{
if (rl_explicit_arg == 0)
_rl_set_insert_mode (rl_insert_mode ^ 1, 0);
diff --git a/cmd-line-utils/readline/nls.c b/cmd-line-utils/readline/nls.c
index 73ad0227195..bcee87561aa 100644
--- a/cmd-line-utils/readline/nls.c
+++ b/cmd-line-utils/readline/nls.c
@@ -21,7 +21,9 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#include <sys/types.h>
@@ -111,7 +113,7 @@ _rl_init_eightbit ()
if (lspec == 0 || *lspec == 0)
lspec = setlocale (LC_CTYPE, (char *)NULL);
if (lspec == 0)
- lspec = (char*) "";
+ lspec = "";
t = setlocale (LC_CTYPE, lspec);
if (t && *t && (t[0] != 'C' || t[1]) && (STREQ (t, "POSIX") == 0))
diff --git a/cmd-line-utils/readline/parens.c b/cmd-line-utils/readline/parens.c
index bb893ac1bfb..737f7675e93 100644
--- a/cmd-line-utils/readline/parens.c
+++ b/cmd-line-utils/readline/parens.c
@@ -27,7 +27,9 @@
#include "rlconf.h"
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#include <stdio.h>
#include <sys/types.h>
diff --git a/cmd-line-utils/readline/readline.c b/cmd-line-utils/readline/readline.c
index dd3724a86d7..c2b74006b05 100644
--- a/cmd-line-utils/readline/readline.c
+++ b/cmd-line-utils/readline/readline.c
@@ -1,7 +1,7 @@
/* readline.c -- a general facility for reading lines of input
with emacs style editing and completion. */
-/* Copyright (C) 1987-2002 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2005 Free Software Foundation, Inc.
This file is part of the GNU Readline Library, a library for
reading lines of text with interactive input and history editing.
@@ -22,7 +22,9 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#include <sys/types.h>
#include "posixstat.h"
@@ -47,6 +49,11 @@
#include <stdio.h>
#include "posixjmp.h"
+#include <errno.h>
+
+#if !defined (errno)
+extern int errno;
+#endif /* !errno */
/* System-specific feature definitions and include files. */
#include "rldefs.h"
@@ -66,11 +73,11 @@
#include "xmalloc.h"
#ifndef RL_LIBRARY_VERSION
-# define RL_LIBRARY_VERSION "5.0"
+# define RL_LIBRARY_VERSION "5.1"
#endif
#ifndef RL_READLINE_VERSION
-# define RL_READLINE_VERSION 0x0500
+# define RL_READLINE_VERSION 0x0501
#endif
extern void _rl_free_history_entry PARAMS((HIST_ENTRY *));
@@ -83,9 +90,10 @@ static void bind_arrow_keys_internal PARAMS((Keymap));
static void bind_arrow_keys PARAMS((void));
static void readline_default_bindings PARAMS((void));
-#ifdef NOT_USED
static void reset_default_bindings PARAMS((void));
-#endif
+
+static int _rl_subseq_result PARAMS((int, Keymap, int, int));
+static int _rl_subseq_getchar PARAMS((int));
/* **************************************************************** */
/* */
@@ -104,6 +112,7 @@ int rl_gnu_readline_p = 1;
By default, it is the standard emacs keymap. */
Keymap _rl_keymap = emacs_standard_keymap;
+
/* The current style of editing. */
int rl_editing_mode = emacs_mode;
@@ -219,6 +228,9 @@ char *_rl_comment_begin;
/* Keymap holding the function currently being executed. */
Keymap rl_executing_keymap;
+/* Keymap we're currently using to dispatch. */
+Keymap _rl_dispatching_keymap;
+
/* Non-zero means to erase entire line, including prompt, on empty input lines. */
int rl_erase_empty_line = 0;
@@ -230,6 +242,9 @@ int rl_num_chars_to_read;
char *rl_line_buffer = (char *)NULL;
int rl_line_buffer_len = 0;
+/* Key sequence `contexts' */
+_rl_keyseq_cxt *_rl_kscxt = 0;
+
/* Forward declarations used by the display, termcap, and history code. */
/* **************************************************************** */
@@ -251,6 +266,10 @@ int _rl_convert_meta_chars_to_ascii = 1;
rather than as a meta-prefixed escape sequence. */
int _rl_output_meta_chars = 0;
+/* Non-zero means to look at the termios special characters and bind
+ them to equivalent readline functions at startup. */
+int _rl_bind_stty_chars = 1;
+
/* **************************************************************** */
/* */
/* Top Level Functions */
@@ -268,6 +287,7 @@ rl_set_prompt (prompt)
{
FREE (rl_prompt);
rl_prompt = prompt ? savestring (prompt) : (char *)NULL;
+ rl_display_prompt = rl_prompt ? rl_prompt : "";
rl_visible_prompt_length = rl_expand_prompt (rl_prompt);
return 0;
@@ -291,14 +311,16 @@ readline (prompt)
rl_set_prompt (prompt);
rl_initialize ();
- (*rl_prep_term_function) (_rl_meta_flag);
+ if (rl_prep_term_function)
+ (*rl_prep_term_function) (_rl_meta_flag);
#if defined (HANDLE_SIGNALS)
rl_set_signals ();
#endif
value = readline_internal ();
- (*rl_deprep_term_function) ();
+ if (rl_deprep_term_function)
+ (*rl_deprep_term_function) ();
#if defined (HANDLE_SIGNALS)
rl_clear_signals ();
@@ -388,6 +410,36 @@ readline_internal_teardown (eof)
return (eof ? (char *)NULL : savestring (the_line));
}
+void
+_rl_internal_char_cleanup ()
+{
+#if defined (VI_MODE)
+ /* In vi mode, when you exit insert mode, the cursor moves back
+ over the previous character. We explicitly check for that here. */
+ if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap)
+ rl_vi_check ();
+#endif /* VI_MODE */
+
+ if (rl_num_chars_to_read && rl_end >= rl_num_chars_to_read)
+ {
+ (*rl_redisplay_function) ();
+ _rl_want_redisplay = 0;
+ rl_newline (1, '\n');
+ }
+
+ if (rl_done == 0)
+ {
+ (*rl_redisplay_function) ();
+ _rl_want_redisplay = 0;
+ }
+
+ /* If the application writer has told us to erase the entire line if
+ the only character typed was something bound to rl_newline, do so. */
+ if (rl_erase_empty_line && rl_done && rl_last_func == rl_newline &&
+ rl_point == 0 && rl_end == 0)
+ _rl_erase_entire_line ();
+}
+
STATIC_CALLBACK int
#if defined (READLINE_CALLBACKS)
readline_internal_char ()
@@ -410,12 +462,21 @@ readline_internal_charloop ()
code = setjmp (readline_top_level);
if (code)
- (*rl_redisplay_function) ();
+ {
+ (*rl_redisplay_function) ();
+ _rl_want_redisplay = 0;
+ /* If we get here, we're not being called from something dispatched
+ from _rl_callback_read_char(), which sets up its own value of
+ readline_top_level (saving and restoring the old, of course), so
+ we can just return here. */
+ if (RL_ISSTATE (RL_STATE_CALLBACK))
+ return (0);
+ }
if (rl_pending_input == 0)
{
/* Then initialize the argument and number of keys read. */
- _rl_init_argument ();
+ _rl_reset_argument ();
rl_key_sequence_length = 0;
}
@@ -423,6 +484,20 @@ readline_internal_charloop ()
c = rl_read_key ();
RL_UNSETSTATE(RL_STATE_READCMD);
+ /* look at input.c:rl_getc() for the circumstances under which this will
+ be returned; punt immediately on read error without converting it to
+ a newline. */
+ if (c == READERR)
+ {
+#if defined (READLINE_CALLBACKS)
+ RL_SETSTATE(RL_STATE_DONE);
+ return (rl_done = 1);
+#else
+ eof_found = 1;
+ break;
+#endif
+ }
+
/* EOF typed to a non-blank line is a <NL>. */
if (c == EOF && rl_end)
c = NEWLINE;
@@ -449,27 +524,7 @@ readline_internal_charloop ()
if (rl_pending_input == 0 && lk == _rl_last_command_was_kill)
_rl_last_command_was_kill = 0;
-#if defined (VI_MODE)
- /* In vi mode, when you exit insert mode, the cursor moves back
- over the previous character. We explicitly check for that here. */
- if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap)
- rl_vi_check ();
-#endif /* VI_MODE */
-
- if (rl_num_chars_to_read && rl_end >= rl_num_chars_to_read)
- {
- (*rl_redisplay_function) ();
- rl_newline (1, '\n');
- }
-
- if (rl_done == 0)
- (*rl_redisplay_function) ();
-
- /* If the application writer has told us to erase the entire line if
- the only character typed was something bound to rl_newline, do so. */
- if (rl_erase_empty_line && rl_done && rl_last_func == rl_newline &&
- rl_point == 0 && rl_end == 0)
- _rl_erase_entire_line ();
+ _rl_internal_char_cleanup ();
#if defined (READLINE_CALLBACKS)
return 0;
@@ -519,6 +574,107 @@ _rl_set_the_line ()
the_line = rl_line_buffer;
}
+#if defined (READLINE_CALLBACKS)
+_rl_keyseq_cxt *
+_rl_keyseq_cxt_alloc ()
+{
+ _rl_keyseq_cxt *cxt;
+
+ cxt = (_rl_keyseq_cxt *)xmalloc (sizeof (_rl_keyseq_cxt));
+
+ cxt->flags = cxt->subseq_arg = cxt->subseq_retval = 0;
+
+ cxt->okey = 0;
+ cxt->ocxt = _rl_kscxt;
+ cxt->childval = 42; /* sentinel value */
+
+ return cxt;
+}
+
+void
+_rl_keyseq_cxt_dispose (cxt)
+ _rl_keyseq_cxt *cxt;
+{
+ free (cxt);
+}
+
+void
+_rl_keyseq_chain_dispose ()
+{
+ _rl_keyseq_cxt *cxt;
+
+ while (_rl_kscxt)
+ {
+ cxt = _rl_kscxt;
+ _rl_kscxt = _rl_kscxt->ocxt;
+ _rl_keyseq_cxt_dispose (cxt);
+ }
+}
+#endif
+
+static int
+_rl_subseq_getchar (key)
+ int key;
+{
+ int k;
+
+ if (key == ESC)
+ RL_SETSTATE(RL_STATE_METANEXT);
+ RL_SETSTATE(RL_STATE_MOREINPUT);
+ k = rl_read_key ();
+ RL_UNSETSTATE(RL_STATE_MOREINPUT);
+ if (key == ESC)
+ RL_UNSETSTATE(RL_STATE_METANEXT);
+
+ return k;
+}
+
+#if defined (READLINE_CALLBACKS)
+int
+_rl_dispatch_callback (cxt)
+ _rl_keyseq_cxt *cxt;
+{
+ int nkey, r;
+
+ /* For now */
+#if 1
+ /* The first time this context is used, we want to read input and dispatch
+ on it. When traversing the chain of contexts back `up', we want to use
+ the value from the next context down. We're simulating recursion using
+ a chain of contexts. */
+ if ((cxt->flags & KSEQ_DISPATCHED) == 0)
+ {
+ nkey = _rl_subseq_getchar (cxt->okey);
+ r = _rl_dispatch_subseq (nkey, cxt->dmap, cxt->subseq_arg);
+ cxt->flags |= KSEQ_DISPATCHED;
+ }
+ else
+ r = cxt->childval;
+#else
+ r = _rl_dispatch_subseq (nkey, cxt->dmap, cxt->subseq_arg);
+#endif
+
+ /* For now */
+ r = _rl_subseq_result (r, cxt->oldmap, cxt->okey, (cxt->flags & KSEQ_SUBSEQ));
+
+ if (r == 0) /* success! */
+ {
+ _rl_keyseq_chain_dispose ();
+ RL_UNSETSTATE (RL_STATE_MULTIKEY);
+ return r;
+ }
+
+ if (r != -3) /* magic value that says we added to the chain */
+ _rl_kscxt = cxt->ocxt;
+ if (_rl_kscxt)
+ _rl_kscxt->childval = r;
+ if (r != -3)
+ _rl_keyseq_cxt_dispose (cxt);
+
+ return r;
+}
+#endif /* READLINE_CALLBACKS */
+
/* Do the command associated with KEY in MAP.
If the associated command is really a keymap, then read
another key, and dispatch into that map. */
@@ -527,6 +683,7 @@ _rl_dispatch (key, map)
register int key;
Keymap map;
{
+ _rl_dispatching_keymap = map;
return _rl_dispatch_subseq (key, map, 0);
}
@@ -539,6 +696,9 @@ _rl_dispatch_subseq (key, map, got_subseq)
int r, newkey;
char *macro;
rl_command_func_t *func;
+#if defined (READLINE_CALLBACKS)
+ _rl_keyseq_cxt *cxt;
+#endif
if (META_CHAR (key) && _rl_convert_meta_chars_to_ascii)
{
@@ -572,13 +732,9 @@ _rl_dispatch_subseq (key, map, got_subseq)
rl_executing_keymap = map;
-#if 0
- _rl_suppress_redisplay = (map[key].function == rl_insert) && _rl_input_available ();
-#endif
-
rl_dispatching = 1;
RL_SETSTATE(RL_STATE_DISPATCHING);
- r = (*map[key].function)(rl_numeric_arg * rl_arg_sign, key);
+ (*map[key].function)(rl_numeric_arg * rl_arg_sign, key);
RL_UNSETSTATE(RL_STATE_DISPATCHING);
rl_dispatching = 0;
@@ -607,6 +763,10 @@ _rl_dispatch_subseq (key, map, got_subseq)
}
else
{
+#if defined (READLINE_CALLBACKS)
+ RL_UNSETSTATE (RL_STATE_MULTIKEY);
+ _rl_keyseq_chain_dispose ();
+#endif
_rl_abort_internal ();
return -1;
}
@@ -628,58 +788,43 @@ _rl_dispatch_subseq (key, map, got_subseq)
#endif
rl_key_sequence_length++;
+ _rl_dispatching_keymap = FUNCTION_TO_KEYMAP (map, key);
- if (key == ESC)
- RL_SETSTATE(RL_STATE_METANEXT);
- RL_SETSTATE(RL_STATE_MOREINPUT);
- newkey = rl_read_key ();
- RL_UNSETSTATE(RL_STATE_MOREINPUT);
- if (key == ESC)
- RL_UNSETSTATE(RL_STATE_METANEXT);
+ /* Allocate new context here. Use linked contexts (linked through
+ cxt->ocxt) to simulate recursion */
+#if defined (READLINE_CALLBACKS)
+ if (RL_ISSTATE (RL_STATE_CALLBACK))
+ {
+ /* Return 0 only the first time, to indicate success to
+ _rl_callback_read_char. The rest of the time, we're called
+ from _rl_dispatch_callback, so we return 3 to indicate
+ special handling is necessary. */
+ r = RL_ISSTATE (RL_STATE_MULTIKEY) ? -3 : 0;
+ cxt = _rl_keyseq_cxt_alloc ();
+
+ if (got_subseq)
+ cxt->flags |= KSEQ_SUBSEQ;
+ cxt->okey = key;
+ cxt->oldmap = map;
+ cxt->dmap = _rl_dispatching_keymap;
+ cxt->subseq_arg = got_subseq || cxt->dmap[ANYOTHERKEY].function;
+
+ RL_SETSTATE (RL_STATE_MULTIKEY);
+ _rl_kscxt = cxt;
+
+ return r; /* don't indicate immediate success */
+ }
+#endif
+ newkey = _rl_subseq_getchar (key);
if (newkey < 0)
{
_rl_abort_internal ();
return -1;
}
- r = _rl_dispatch_subseq (newkey, FUNCTION_TO_KEYMAP (map, key), got_subseq || map[ANYOTHERKEY].function);
-
- if (r == -2)
- /* We didn't match anything, and the keymap we're indexed into
- shadowed a function previously bound to that prefix. Call
- the function. The recursive call to _rl_dispatch_subseq has
- already taken care of pushing any necessary input back onto
- the input queue with _rl_unget_char. */
- {
-#if 0
- r = _rl_dispatch (ANYOTHERKEY, FUNCTION_TO_KEYMAP (map, key));
-#else
- /* XXX - experimental code -- might never be executed. Save
- for later. */
- Keymap m = FUNCTION_TO_KEYMAP (map, key);
- int type = m[ANYOTHERKEY].type;
- func = m[ANYOTHERKEY].function;
- if (type == ISFUNC && func == rl_do_lowercase_version)
- r = _rl_dispatch (_rl_to_lower (key), map);
- else
- r = _rl_dispatch (ANYOTHERKEY, m);
-#endif
- }
- else if (r && map[ANYOTHERKEY].function)
- {
- /* We didn't match (r is probably -1), so return something to
- tell the caller that it should try ANYOTHERKEY for an
- overridden function. */
- _rl_unget_char (key);
- return -2;
- }
- else if (r && got_subseq)
- {
- /* OK, back up the chain. */
- _rl_unget_char (key);
- return -1;
- }
+ r = _rl_dispatch_subseq (newkey, _rl_dispatching_keymap, got_subseq || map[ANYOTHERKEY].function);
+ return _rl_subseq_result (r, map, key, got_subseq);
}
else
{
@@ -703,9 +848,69 @@ _rl_dispatch_subseq (key, map, got_subseq)
_rl_vi_textmod_command (key))
_rl_vi_set_last (key, rl_numeric_arg, rl_arg_sign);
#endif
+
return (r);
}
+static int
+_rl_subseq_result (r, map, key, got_subseq)
+ int r;
+ Keymap map;
+ int key, got_subseq;
+{
+ Keymap m;
+ int type, nt;
+ rl_command_func_t *func, *nf;
+
+ if (r == -2)
+ /* We didn't match anything, and the keymap we're indexed into
+ shadowed a function previously bound to that prefix. Call
+ the function. The recursive call to _rl_dispatch_subseq has
+ already taken care of pushing any necessary input back onto
+ the input queue with _rl_unget_char. */
+ {
+ m = _rl_dispatching_keymap;
+ type = m[ANYOTHERKEY].type;
+ func = m[ANYOTHERKEY].function;
+ if (type == ISFUNC && func == rl_do_lowercase_version)
+ r = _rl_dispatch (_rl_to_lower (key), map);
+ else if (type == ISFUNC && func == rl_insert)
+ {
+ /* If the function that was shadowed was self-insert, we
+ somehow need a keymap with map[key].func == self-insert.
+ Let's use this one. */
+ nt = m[key].type;
+ nf = m[key].function;
+
+ m[key].type = type;
+ m[key].function = func;
+ r = _rl_dispatch (key, m);
+ m[key].type = nt;
+ m[key].function = nf;
+ }
+ else
+ r = _rl_dispatch (ANYOTHERKEY, m);
+ }
+ else if (r && map[ANYOTHERKEY].function)
+ {
+ /* We didn't match (r is probably -1), so return something to
+ tell the caller that it should try ANYOTHERKEY for an
+ overridden function. */
+ _rl_unget_char (key);
+ _rl_dispatching_keymap = map;
+ return -2;
+ }
+ else if (r && got_subseq)
+ {
+ /* OK, back up the chain. */
+ _rl_unget_char (key);
+ _rl_dispatching_keymap = map;
+ return -1;
+ }
+
+ return r;
+}
+
/* **************************************************************** */
/* */
/* Initializations */
@@ -863,19 +1068,21 @@ readline_initialize_everything ()
static void
readline_default_bindings ()
{
- rl_tty_set_default_bindings (_rl_keymap);
+ if (_rl_bind_stty_chars)
+ rl_tty_set_default_bindings (_rl_keymap);
}
/* Reset the default bindings for the terminal special characters we're
interested in back to rl_insert and read the new ones. */
-#ifdef NOT_USED
static void
reset_default_bindings ()
{
- rl_tty_unset_default_bindings (_rl_keymap);
- rl_tty_set_default_bindings (_rl_keymap);
+ if (_rl_bind_stty_chars)
+ {
+ rl_tty_unset_default_bindings (_rl_keymap);
+ rl_tty_set_default_bindings (_rl_keymap);
+ }
}
-#endif
/* Bind some common arrow key sequences in MAP. */
static void
@@ -908,6 +1115,13 @@ bind_arrow_keys_internal (map)
rl_bind_keyseq_if_unbound ("\033OH", rl_beg_of_line);
rl_bind_keyseq_if_unbound ("\033OF", rl_end_of_line);
+#if defined (__MINGW32__)
+ rl_bind_keyseq_if_unbound ("\340H", rl_get_previous_history);
+ rl_bind_keyseq_if_unbound ("\340P", rl_get_next_history);
+ rl_bind_keyseq_if_unbound ("\340M", rl_forward_char);
+ rl_bind_keyseq_if_unbound ("\340K", rl_backward_char);
+#endif
+
_rl_keymap = xkeymap;
}
diff --git a/cmd-line-utils/readline/readline.h b/cmd-line-utils/readline/readline.h
index 222b317c4a8..b71bf98d204 100644
--- a/cmd-line-utils/readline/readline.h
+++ b/cmd-line-utils/readline/readline.h
@@ -1,6 +1,6 @@
/* Readline.h -- the names of functions callable from within readline. */
-/* Copyright (C) 1987-2004 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2005 Free Software Foundation, Inc.
This file is part of the GNU Readline Library, a library for
reading lines of text with interactive input and history editing.
@@ -40,9 +40,9 @@ extern "C" {
#endif
/* Hex-encoded Readline version number. */
-#define RL_READLINE_VERSION 0x0500 /* Readline 5.0 */
+#define RL_READLINE_VERSION 0x0502 /* Readline 5.2 */
#define RL_VERSION_MAJOR 5
-#define RL_VERSION_MINOR 0
+#define RL_VERSION_MINOR 2
/* Readline data structures. */
@@ -241,6 +241,7 @@ extern int rl_vi_column PARAMS((int, int));
extern int rl_vi_delete_to PARAMS((int, int));
extern int rl_vi_change_to PARAMS((int, int));
extern int rl_vi_yank_to PARAMS((int, int));
+extern int rl_vi_rubout PARAMS((int, int));
extern int rl_vi_delete PARAMS((int, int));
extern int rl_vi_back_to_indent PARAMS((int, int));
extern int rl_vi_first_print PARAMS((int, int));
@@ -302,6 +303,8 @@ extern int rl_bind_keyseq_in_map PARAMS((const char *, rl_command_func_t *, Keym
extern int rl_bind_keyseq_if_unbound PARAMS((const char *, rl_command_func_t *));
extern int rl_bind_keyseq_if_unbound_in_map PARAMS((const char *, rl_command_func_t *, Keymap));
extern int rl_generic_bind PARAMS((int, const char *, char *, Keymap));
+
+extern char *rl_variable_value PARAMS((const char *));
extern int rl_variable_bind PARAMS((const char *, const char *));
/* Backwards compatibility, use rl_bind_keyseq_in_map instead. */
@@ -401,6 +404,7 @@ extern int rl_reset_terminal PARAMS((const char *));
extern void rl_resize_terminal PARAMS((void));
extern void rl_set_screen_size PARAMS((int, int));
extern void rl_get_screen_size PARAMS((int *, int *));
+extern void rl_reset_screen_size PARAMS((void));
extern char *rl_get_termcap PARAMS((const char *));
@@ -528,6 +532,11 @@ extern const char *rl_terminal_name;
extern FILE *rl_instream;
extern FILE *rl_outstream;
+/* If non-zero, Readline gives values of LINES and COLUMNS from the environment
+ greater precedence than values fetched from the kernel when computing the
+ screen dimensions. */
+extern int rl_prefer_env_winsize;
+
/* If non-zero, then this is the address of a function to call just
before readline_internal () prints the first prompt. */
extern rl_hook_func_t *rl_startup_hook;
@@ -748,6 +757,10 @@ extern int rl_ignore_completion_duplicates;
completion character will be inserted as any other. */
extern int rl_inhibit_completion;
+/* Input error; can be returned by (*rl_getc_function) if readline is reading
+ a top-level command (RL_ISSTATE (RL_STATE_READCMD)). */
+#define READERR (-2)
+
/* Definitions available for use by readline clients. */
#define RL_PROMPT_START_IGNORE '\001'
#define RL_PROMPT_END_IGNORE '\002'
@@ -759,29 +772,33 @@ extern int rl_inhibit_completion;
#define MULT_MATCH 2
/* Possible state values for rl_readline_state */
-#define RL_STATE_NONE 0x00000 /* no state; before first call */
-
-#define RL_STATE_INITIALIZING 0x00001 /* initializing */
-#define RL_STATE_INITIALIZED 0x00002 /* initialization done */
-#define RL_STATE_TERMPREPPED 0x00004 /* terminal is prepped */
-#define RL_STATE_READCMD 0x00008 /* reading a command key */
-#define RL_STATE_METANEXT 0x00010 /* reading input after ESC */
-#define RL_STATE_DISPATCHING 0x00020 /* dispatching to a command */
-#define RL_STATE_MOREINPUT 0x00040 /* reading more input in a command function */
-#define RL_STATE_ISEARCH 0x00080 /* doing incremental search */
-#define RL_STATE_NSEARCH 0x00100 /* doing non-inc search */
-#define RL_STATE_SEARCH 0x00200 /* doing a history search */
-#define RL_STATE_NUMERICARG 0x00400 /* reading numeric argument */
-#define RL_STATE_MACROINPUT 0x00800 /* getting input from a macro */
-#define RL_STATE_MACRODEF 0x01000 /* defining keyboard macro */
-#define RL_STATE_OVERWRITE 0x02000 /* overwrite mode */
-#define RL_STATE_COMPLETING 0x04000 /* doing completion */
-#define RL_STATE_SIGHANDLER 0x08000 /* in readline sighandler */
-#define RL_STATE_UNDOING 0x10000 /* doing an undo */
-#define RL_STATE_INPUTPENDING 0x20000 /* rl_execute_next called */
-#define RL_STATE_TTYCSAVED 0x40000 /* tty special chars saved */
-
-#define RL_STATE_DONE 0x80000 /* done; accepted line */
+#define RL_STATE_NONE 0x000000 /* no state; before first call */
+
+#define RL_STATE_INITIALIZING 0x000001 /* initializing */
+#define RL_STATE_INITIALIZED 0x000002 /* initialization done */
+#define RL_STATE_TERMPREPPED 0x000004 /* terminal is prepped */
+#define RL_STATE_READCMD 0x000008 /* reading a command key */
+#define RL_STATE_METANEXT 0x000010 /* reading input after ESC */
+#define RL_STATE_DISPATCHING 0x000020 /* dispatching to a command */
+#define RL_STATE_MOREINPUT 0x000040 /* reading more input in a command function */
+#define RL_STATE_ISEARCH 0x000080 /* doing incremental search */
+#define RL_STATE_NSEARCH 0x000100 /* doing non-inc search */
+#define RL_STATE_SEARCH 0x000200 /* doing a history search */
+#define RL_STATE_NUMERICARG 0x000400 /* reading numeric argument */
+#define RL_STATE_MACROINPUT 0x000800 /* getting input from a macro */
+#define RL_STATE_MACRODEF 0x001000 /* defining keyboard macro */
+#define RL_STATE_OVERWRITE 0x002000 /* overwrite mode */
+#define RL_STATE_COMPLETING 0x004000 /* doing completion */
+#define RL_STATE_SIGHANDLER 0x008000 /* in readline sighandler */
+#define RL_STATE_UNDOING 0x010000 /* doing an undo */
+#define RL_STATE_INPUTPENDING 0x020000 /* rl_execute_next called */
+#define RL_STATE_TTYCSAVED 0x040000 /* tty special chars saved */
+#define RL_STATE_CALLBACK 0x080000 /* using the callback interface */
+#define RL_STATE_VIMOTION 0x100000 /* reading vi motion arg */
+#define RL_STATE_MULTIKEY 0x200000 /* reading multiple-key command */
+#define RL_STATE_VICMDONCE 0x400000 /* entered vi command mode at least once */
+
+#define RL_STATE_DONE 0x800000 /* done; accepted line */
#define RL_SETSTATE(x) (rl_readline_state |= (x))
#define RL_UNSETSTATE(x) (rl_readline_state &= ~(x))
diff --git a/cmd-line-utils/readline/rlconf.h b/cmd-line-utils/readline/rlconf.h
index c651fd8b41f..ff3929e0bf5 100644
--- a/cmd-line-utils/readline/rlconf.h
+++ b/cmd-line-utils/readline/rlconf.h
@@ -37,9 +37,12 @@
/* Ugly but working hack for binding prefix meta. */
#define PREFIX_META_HACK
-/* The final, last-ditch effort file name for an init file. */
+/* The next-to-last-ditch effort file name for a user-specific init file. */
#define DEFAULT_INPUTRC "~/.inputrc"
+/* The ultimate last-ditch filenname for an init file -- system-wide. */
+#define SYS_INPUTRC "/etc/inputrc"
+
/* If defined, expand tabs to spaces. */
#define DISPLAY_TABS
diff --git a/cmd-line-utils/readline/rldefs.h b/cmd-line-utils/readline/rldefs.h
index 0d600407b5f..0f6c87446dd 100644
--- a/cmd-line-utils/readline/rldefs.h
+++ b/cmd-line-utils/readline/rldefs.h
@@ -2,7 +2,7 @@
for readline. This should be included after any files that define
system-specific constants like _POSIX_VERSION or USG. */
-/* Copyright (C) 1987,1989 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2005 Free Software Foundation, Inc.
This file contains the Readline Library (the Library), a set of
routines for providing Emacs style line input to programs that ask
@@ -38,7 +38,11 @@
# if defined (HAVE_TERMIO_H)
# define TERMIO_TTY_DRIVER
# else
-# define NEW_TTY_DRIVER
+# if !defined (__MINGW32__)
+# define NEW_TTY_DRIVER
+# else
+# define NO_TTY_DRIVER
+# endif
# endif
#endif
diff --git a/cmd-line-utils/readline/rlmbutil.h b/cmd-line-utils/readline/rlmbutil.h
index 77cc026e3e8..dd317e2a090 100644
--- a/cmd-line-utils/readline/rlmbutil.h
+++ b/cmd-line-utils/readline/rlmbutil.h
@@ -32,10 +32,19 @@
/* For platforms which support the ISO C amendement 1 functionality we
support user defined character classes. */
/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
-#if defined (HAVE_WCTYPE_H) && defined (HAVE_WCHAR_H)
+#if defined (HAVE_WCTYPE_H) && defined (HAVE_WCHAR_H) && defined (HAVE_LOCALE_H)
# include <wchar.h>
# include <wctype.h>
-# if defined (HAVE_MBSRTOWCS) && defined (HAVE_MBRTOWC) && defined (HAVE_MBRLEN) && defined (HAVE_WCWIDTH)
+# if defined (HAVE_ISWCTYPE) && \
+ defined (HAVE_ISWLOWER) && \
+ defined (HAVE_ISWUPPER) && \
+ defined (HAVE_MBSRTOWCS) && \
+ defined (HAVE_MBRTOWC) && \
+ defined (HAVE_MBRLEN) && \
+ defined (HAVE_TOWLOWER) && \
+ defined (HAVE_TOWUPPER) && \
+ defined (HAVE_WCHAR_T) && \
+ defined (HAVE_WCWIDTH)
/* system is supposed to support XPG5 */
# define HANDLE_MULTIBYTE 1
# endif
@@ -97,6 +106,21 @@ extern int _rl_read_mbstring PARAMS((int, char *, int));
extern int _rl_is_mbchar_matched PARAMS((char *, int, int, char *, int));
+extern wchar_t _rl_char_value PARAMS((char *, int));
+extern int _rl_walphabetic PARAMS((wchar_t));
+
+#define _rl_to_wupper(wc) (iswlower (wc) ? towupper (wc) : (wc))
+#define _rl_to_wlower(wc) (iswupper (wc) ? towlower (wc) : (wc))
+
+#define MB_NEXTCHAR(b,s,c,f) \
+ ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) \
+ ? _rl_find_next_mbchar ((b), (s), (c), (f)) \
+ : ((s) + (c)))
+#define MB_PREVCHAR(b,s,f) \
+ ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) \
+ ? _rl_find_prev_mbchar ((b), (s), (f)) \
+ : ((s) - 1))
+
#define MB_INVALIDCH(x) ((x) == (size_t)-1 || (x) == (size_t)-2)
#define MB_NULLWCH(x) ((x) == 0)
@@ -111,6 +135,16 @@ extern int _rl_is_mbchar_matched PARAMS((char *, int, int, char *, int));
#define _rl_find_prev_mbchar(b, i, f) (((i) == 0) ? (i) : ((i) - 1))
#define _rl_find_next_mbchar(b, i1, i2, f) ((i1) + (i2))
+#define _rl_char_value(buf,ind) ((buf)[(ind)])
+
+#define _rl_walphabetic(c) (rl_alphabetic (c))
+
+#define _rl_to_wupper(c) (_rl_to_upper (c))
+#define _rl_to_wlower(c) (_rl_to_lower (c))
+
+#define MB_NEXTCHAR(b,s,c,f) ((s) + (c))
+#define MB_PREVCHAR(b,s,f) ((s) - 1)
+
#define MB_INVALIDCH(x) (0)
#define MB_NULLWCH(x) (0)
diff --git a/cmd-line-utils/readline/rlprivate.h b/cmd-line-utils/readline/rlprivate.h
index c3cee917b76..64aa7bdd3fa 100644
--- a/cmd-line-utils/readline/rlprivate.h
+++ b/cmd-line-utils/readline/rlprivate.h
@@ -1,7 +1,7 @@
/* rlprivate.h -- functions and variables global to the readline library,
but not intended for use by applications. */
-/* Copyright (C) 1999-2004 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2005 Free Software Foundation, Inc.
This file is part of the GNU Readline Library, a library for
reading lines of text with interactive input and history editing.
@@ -30,6 +30,95 @@
/*************************************************************************
* *
+ * Global structs undocumented in texinfo manual and not in readline.h *
+ * *
+ *************************************************************************/
+/* search types */
+#define RL_SEARCH_ISEARCH 0x01 /* incremental search */
+#define RL_SEARCH_NSEARCH 0x02 /* non-incremental search */
+#define RL_SEARCH_CSEARCH 0x04 /* intra-line char search */
+
+/* search flags */
+#define SF_REVERSE 0x01
+#define SF_FOUND 0x02
+#define SF_FAILED 0x04
+
+typedef struct __rl_search_context
+{
+ int type;
+ int sflags;
+
+ char *search_string;
+ int search_string_index;
+ int search_string_size;
+
+ char **lines;
+ char *allocated_line;
+ int hlen;
+ int hindex;
+
+ int save_point;
+ int save_mark;
+ int save_line;
+ int last_found_line;
+ char *prev_line_found;
+
+ UNDO_LIST *save_undo_list;
+
+ int history_pos;
+ int direction;
+
+ int lastc;
+#if defined (HANDLE_MULTIBYTE)
+ char mb[MB_LEN_MAX];
+#endif
+
+ char *sline;
+ int sline_len;
+ int sline_index;
+
+ char *search_terminators;
+} _rl_search_cxt;
+
+/* Callback data for reading numeric arguments */
+#define NUM_SAWMINUS 0x01
+#define NUM_SAWDIGITS 0x02
+#define NUM_READONE 0x04
+
+typedef int _rl_arg_cxt;
+
+/* A context for reading key sequences longer than a single character when
+ using the callback interface. */
+#define KSEQ_DISPATCHED 0x01
+#define KSEQ_SUBSEQ 0x02
+#define KSEQ_RECURSIVE 0x04
+
+typedef struct __rl_keyseq_context
+{
+ int flags;
+ int subseq_arg;
+ int subseq_retval; /* XXX */
+ Keymap dmap;
+
+ Keymap oldmap;
+ int okey;
+ struct __rl_keyseq_context *ocxt;
+ int childval;
+} _rl_keyseq_cxt;
+
+ /* fill in more as needed */
+/* `Generic' callback data and functions */
+typedef struct __rl_callback_generic_arg
+{
+ int count;
+ int i1, i2;
+ /* add here as needed */
+} _rl_callback_generic_arg;
+
+typedef int _rl_callback_func_t PARAMS((_rl_callback_generic_arg *));
+
+/*************************************************************************
+ * *
* Global functions undocumented in texinfo manual and not in readline.h *
* *
*************************************************************************/
@@ -54,6 +143,8 @@ extern int readline_echoing_p;
extern int rl_key_sequence_length;
extern int rl_byte_oriented;
+extern _rl_keyseq_cxt *_rl_kscxt;
+
/* display.c */
extern int rl_display_fixed;
@@ -100,6 +191,16 @@ extern void readline_internal_setup PARAMS((void));
extern char *readline_internal_teardown PARAMS((int));
extern int readline_internal_char PARAMS((void));
+extern _rl_keyseq_cxt *_rl_keyseq_cxt_alloc PARAMS((void));
+extern void _rl_keyseq_cxt_dispose PARAMS((_rl_keyseq_cxt *));
+extern void _rl_keyseq_chain_dispose PARAMS((void));
+
+extern int _rl_dispatch_callback PARAMS((_rl_keyseq_cxt *));
+
+/* callback.c */
+extern _rl_callback_generic_arg *_rl_callback_data_alloc PARAMS((int));
+extern void _rl_callback_data_dispose PARAMS((_rl_callback_generic_arg *));
+
#endif /* READLINE_CALLBACKS */
/* bind.c */
@@ -132,6 +233,15 @@ extern void _rl_insert_typein PARAMS((int));
extern int _rl_unget_char PARAMS((int));
extern int _rl_pushed_input_available PARAMS((void));
+/* isearch.c */
+extern _rl_search_cxt *_rl_scxt_alloc PARAMS((int, int));
+extern void _rl_scxt_dispose PARAMS((_rl_search_cxt *, int));
+
+extern int _rl_isearch_dispatch PARAMS((_rl_search_cxt *, int));
+extern int _rl_isearch_callback PARAMS((_rl_search_cxt *));
+
+extern int _rl_search_getchar PARAMS((_rl_search_cxt *));
+
/* macro.c */
extern void _rl_with_macro_input PARAMS((char *));
extern int _rl_next_macro_key PARAMS((void));
@@ -141,7 +251,12 @@ extern void _rl_add_macro_char PARAMS((int));
extern void _rl_kill_kbd_macro PARAMS((void));
/* misc.c */
-extern int _rl_init_argument PARAMS((void));
+extern int _rl_arg_overflow PARAMS((void));
+extern void _rl_arg_init PARAMS((void));
+extern int _rl_arg_getchar PARAMS((void));
+extern int _rl_arg_callback PARAMS((_rl_arg_cxt));
+extern void _rl_reset_argument PARAMS((void));
+
extern void _rl_start_using_history PARAMS((void));
extern int _rl_free_saved_history_line PARAMS((void));
extern void _rl_set_insert_mode PARAMS((int, int));
@@ -157,11 +272,15 @@ extern void _rl_init_line_state PARAMS((void));
extern void _rl_set_the_line PARAMS((void));
extern int _rl_dispatch PARAMS((int, Keymap));
extern int _rl_dispatch_subseq PARAMS((int, Keymap, int));
+extern void _rl_internal_char_cleanup PARAMS((void));
/* rltty.c */
extern int _rl_disable_tty_signals PARAMS((void));
extern int _rl_restore_tty_signals PARAMS((void));
+/* search.c */
+extern int _rl_nsearch_callback PARAMS((_rl_search_cxt *));
+
/* terminal.c */
extern void _rl_get_screen_size PARAMS((int, int));
extern int _rl_init_terminal_io PARAMS((const char *));
@@ -190,6 +309,10 @@ extern int _rl_char_search_internal PARAMS((int, int, int));
#endif
extern int _rl_set_mark_at_pos PARAMS((int));
+/* undo.c */
+extern UNDO_LIST *_rl_copy_undo_entry PARAMS((UNDO_LIST *));
+extern UNDO_LIST *_rl_copy_undo_list PARAMS((UNDO_LIST *));
+
/* util.c */
extern int _rl_abort_internal PARAMS((void));
extern char *_rl_strindex PARAMS((const char *, const char *));
@@ -217,6 +340,10 @@ extern void _rl_vi_done_inserting PARAMS((void));
extern const char *_rl_possible_control_prefixes[];
extern const char *_rl_possible_meta_prefixes[];
+/* callback.c */
+extern _rl_callback_func_t *_rl_callback_func;
+extern _rl_callback_generic_arg *_rl_callback_data;
+
/* complete.c */
extern int _rl_complete_show_all;
extern int _rl_complete_show_unmodified;
@@ -231,11 +358,14 @@ extern int _rl_page_completions;
extern int _rl_vis_botlin;
extern int _rl_last_c_pos;
extern int _rl_suppress_redisplay;
+extern int _rl_want_redisplay;
extern char *rl_display_prompt;
/* isearch.c */
extern char *_rl_isearch_terminators;
+extern _rl_search_cxt *_rl_iscxt;
+
/* macro.c */
extern char *_rl_executing_macro;
@@ -243,6 +373,8 @@ extern char *_rl_executing_macro;
extern int _rl_history_preserve_point;
extern int _rl_history_saved_point;
+extern _rl_arg_cxt _rl_argcxt;
+
/* readline.c */
extern int _rl_horizontal_scroll_mode;
extern int _rl_mark_modified_lines;
@@ -250,6 +382,7 @@ extern int _rl_bell_preference;
extern int _rl_meta_flag;
extern int _rl_convert_meta_chars_to_ascii;
extern int _rl_output_meta_chars;
+extern int _rl_bind_stty_chars;
extern char *_rl_comment_begin;
extern unsigned char _rl_parsing_conditionalized_out;
extern Keymap _rl_keymap;
@@ -259,6 +392,9 @@ extern int _rl_last_command_was_kill;
extern int _rl_eof_char;
extern procenv_t readline_top_level;
+/* search.c */
+extern _rl_search_cxt *_rl_nscxt;
+
/* terminal.c */
extern int _rl_enable_keypad;
extern int _rl_enable_meta;
@@ -272,6 +408,7 @@ extern char *_rl_term_up;
extern char *_rl_term_dc;
extern char *_rl_term_cr;
extern char *_rl_term_IC;
+extern char *_rl_term_forward_char;
extern int _rl_screenheight;
extern int _rl_screenwidth;
extern int _rl_screenchars;
diff --git a/cmd-line-utils/readline/rltty.c b/cmd-line-utils/readline/rltty.c
index ffbae1e08af..0a570f85840 100644
--- a/cmd-line-utils/readline/rltty.c
+++ b/cmd-line-utils/readline/rltty.c
@@ -1,7 +1,7 @@
/* rltty.c -- functions to prepare and restore the terminal for readline's
use. */
-/* Copyright (C) 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2005 Free Software Foundation, Inc.
This file is part of the GNU Readline Library, a library for
reading lines of text with interactive input and history editing.
@@ -22,7 +22,9 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#include <sys/types.h>
#include <signal.h>
@@ -150,7 +152,9 @@ set_winsize (tty)
#endif /* TIOCGWINSZ */
}
-#if defined (NEW_TTY_DRIVER)
+#if defined (NO_TTY_DRIVER)
+/* Nothing */
+#elif defined (NEW_TTY_DRIVER)
/* Values for the `flags' field of a struct bsdtty. This tells which
elements of the struct bsdtty have been fetched from the system and
@@ -231,6 +235,7 @@ get_tty_settings (tty, tiop)
tiop->flags = tiop->lflag = 0;
+ errno = 0;
if (ioctl (tty, TIOCGETP, &(tiop->sgttyb)) < 0)
return -1;
tiop->flags |= SGTTY_SET;
@@ -516,6 +521,7 @@ get_tty_settings (tty, tiop)
{
set_winsize (tty);
+ errno = 0;
if (_get_tty_settings (tty, tiop) < 0)
return -1;
@@ -629,9 +635,23 @@ prepare_terminal_settings (meta_flag, oldtio, tiop)
#endif /* TERMIOS_TTY_DRIVER && _POSIX_VDISABLE */
}
-#endif /* NEW_TTY_DRIVER */
+#endif /* !NEW_TTY_DRIVER */
/* Put the terminal in CBREAK mode so that we can detect key presses. */
+#if defined (NO_TTY_DRIVER)
+void
+rl_prep_terminal (meta_flag)
+ int meta_flag;
+{
+ readline_echoing_p = 1;
+}
+
+void
+rl_deprep_terminal ()
+{
+}
+
+#else /* ! NO_TTY_DRIVER */
void
rl_prep_terminal (meta_flag)
int meta_flag;
@@ -649,16 +669,43 @@ rl_prep_terminal (meta_flag)
if (get_tty_settings (tty, &tio) < 0)
{
+#if defined (ENOTSUP)
+ /* MacOS X, at least, lies about the value of errno if tcgetattr fails. */
+ if (errno == ENOTTY || errno == ENOTSUP)
+#else
+ if (errno == ENOTTY)
+#endif
+ readline_echoing_p = 1; /* XXX */
release_sigint ();
return;
}
otio = tio;
- rl_tty_unset_default_bindings (_rl_keymap);
+ if (_rl_bind_stty_chars)
+ {
+#if defined (VI_MODE)
+ /* If editing in vi mode, make sure we restore the bindings in the
+ insertion keymap no matter what keymap we ended up in. */
+ if (rl_editing_mode == vi_mode)
+ rl_tty_unset_default_bindings (vi_insertion_keymap);
+ else
+#endif
+ rl_tty_unset_default_bindings (_rl_keymap);
+ }
save_tty_chars (&otio);
RL_SETSTATE(RL_STATE_TTYCSAVED);
- _rl_bind_tty_special_chars (_rl_keymap, tio);
+ if (_rl_bind_stty_chars)
+ {
+#if defined (VI_MODE)
+ /* If editing in vi mode, make sure we set the bindings in the
+ insertion keymap no matter what keymap we ended up in. */
+ if (rl_editing_mode == vi_mode)
+ _rl_bind_tty_special_chars (vi_insertion_keymap, tio);
+ else
+#endif
+ _rl_bind_tty_special_chars (_rl_keymap, tio);
+ }
prepare_terminal_settings (meta_flag, otio, &tio);
@@ -708,6 +755,7 @@ rl_deprep_terminal ()
release_sigint ();
}
+#endif /* !NO_TTY_DRIVER */
/* **************************************************************** */
/* */
@@ -716,8 +764,13 @@ rl_deprep_terminal ()
/* **************************************************************** */
int
-rl_restart_output(int count __attribute__((unused)), int key __attribute__((unused)))
+rl_restart_output (count, key)
+ int count, key;
{
+#if defined (__MINGW32__)
+ return 0;
+#else /* !__MING32__ */
+
int fildes = fileno (rl_outstream);
#if defined (TIOCSTART)
#if defined (apollo)
@@ -745,11 +798,17 @@ rl_restart_output(int count __attribute__((unused)), int key __attribute__((unus
#endif /* !TIOCSTART */
return 0;
+#endif /* !__MINGW32__ */
}
int
-rl_stop_output(int count __attribute__((unused)), int key __attribute__((unused)))
+rl_stop_output (count, key)
+ int count, key;
{
+#if defined (__MINGW32__)
+ return 0;
+#else
+
int fildes = fileno (rl_instream);
#if defined (TIOCSTOP)
@@ -772,6 +831,7 @@ rl_stop_output(int count __attribute__((unused)), int key __attribute__((unused)
#endif /* !TIOCSTOP */
return 0;
+#endif /* !__MINGW32__ */
}
/* **************************************************************** */
@@ -780,9 +840,16 @@ rl_stop_output(int count __attribute__((unused)), int key __attribute__((unused)
/* */
/* **************************************************************** */
+#if !defined (NO_TTY_DRIVER)
#define SET_SPECIAL(sc, func) set_special_char(kmap, &ttybuff, sc, func)
+#endif
-#if defined (NEW_TTY_DRIVER)
+#if defined (NO_TTY_DRIVER)
+
+#define SET_SPECIAL(sc, func)
+#define RESET_SPECIAL(c)
+
+#elif defined (NEW_TTY_DRIVER)
static void
set_special_char (kmap, tiop, sc, func)
Keymap kmap;
@@ -863,6 +930,7 @@ void
rltty_set_default_bindings (kmap)
Keymap kmap;
{
+#if !defined (NO_TTY_DRIVER)
TIOTYPE ttybuff;
int tty;
@@ -870,6 +938,7 @@ rltty_set_default_bindings (kmap)
if (get_tty_settings (tty, &ttybuff) == 0)
_rl_bind_tty_special_chars (kmap, ttybuff);
+#endif
}
/* New public way to set the system default editing chars to their readline
@@ -907,7 +976,7 @@ rl_tty_unset_default_bindings (kmap)
#if defined (HANDLE_SIGNALS)
-#if defined (NEW_TTY_DRIVER)
+#if defined (NEW_TTY_DRIVER) || defined (NO_TTY_DRIVER)
int
_rl_disable_tty_signals ()
{
diff --git a/cmd-line-utils/readline/savestring.c b/cmd-line-utils/readline/savestring.c
index ae605374d13..820428d8881 100644
--- a/cmd-line-utils/readline/savestring.c
+++ b/cmd-line-utils/readline/savestring.c
@@ -21,8 +21,7 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#include "config_readline.h"
-
+#include <config.h>
#ifdef HAVE_STRING_H
# include <string.h>
#endif
diff --git a/cmd-line-utils/readline/search.c b/cmd-line-utils/readline/search.c
index 6479427be2f..33cc4fc1e73 100644
--- a/cmd-line-utils/readline/search.c
+++ b/cmd-line-utils/readline/search.c
@@ -1,6 +1,6 @@
/* search.c - code for non-incremental searching in emacs and vi modes. */
-/* Copyright (C) 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2005 Free Software Foundation, Inc.
This file is part of the Readline Library (the Library), a set of
routines for providing Emacs style line input to programs that ask
@@ -22,7 +22,9 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#include <sys/types.h>
#include <stdio.h>
@@ -51,6 +53,8 @@
#endif
#define abs(x) (((x) >= 0) ? (x) : -(x))
+_rl_search_cxt *_rl_nscxt = 0;
+
extern HIST_ENTRY *_rl_saved_line_for_history;
/* Functions imported from the rest of the library. */
@@ -68,11 +72,16 @@ static int history_string_size;
static void make_history_line_current PARAMS((HIST_ENTRY *));
static int noninc_search_from_pos PARAMS((char *, int, int));
-static void noninc_dosearch PARAMS((char *, int));
-static void noninc_search PARAMS((int, int));
+static int noninc_dosearch PARAMS((char *, int));
+static int noninc_search PARAMS((int, int));
static int rl_history_search_internal PARAMS((int, int));
static void rl_history_search_reinit PARAMS((void));
+static _rl_search_cxt *_rl_nsearch_init PARAMS((int, int));
+static int _rl_nsearch_cleanup PARAMS((_rl_search_cxt *, int));
+static void _rl_nsearch_abort PARAMS((_rl_search_cxt *));
+static int _rl_nsearch_dispatch PARAMS((_rl_search_cxt *, int));
+
/* Make the data from the history entry ENTRY be the contents of the
current line. This doesn't do anything with rl_point; the caller
must set it. */
@@ -80,12 +89,15 @@ static void
make_history_line_current (entry)
HIST_ENTRY *entry;
{
-#if 0
- rl_replace_line (entry->line, 1);
- rl_undo_list = (UNDO_LIST *)entry->data;
-#else
_rl_replace_text (entry->line, 0, rl_end);
_rl_fix_point (1);
+#if defined (VI_MODE)
+ if (rl_editing_mode == vi_mode)
+ /* POSIX.2 says that the `U' command doesn't affect the copy of any
+ command lines to the edit line. We're going to implement that by
+ making the undo list start after the matching line is copied to the
+ current editing buffer. */
+ rl_free_undo_list ();
#endif
if (_rl_saved_line_for_history)
@@ -128,8 +140,8 @@ noninc_search_from_pos (string, pos, dir)
/* Search for a line in the history containing STRING. If DIR is < 0, the
search is backwards through previous entries, else through subsequent
- entries. */
-static void
+ entries. Returns 1 if the search was successful, 0 otherwise. */
+static int
noninc_dosearch (string, dir)
char *string;
int dir;
@@ -140,7 +152,7 @@ noninc_dosearch (string, dir)
if (string == 0 || *string == '\0' || noninc_history_pos < 0)
{
rl_ding ();
- return;
+ return 0;
}
pos = noninc_search_from_pos (string, noninc_history_pos + dir, dir);
@@ -151,7 +163,7 @@ noninc_dosearch (string, dir)
rl_clear_message ();
rl_point = 0;
rl_ding ();
- return;
+ return 0;
}
noninc_history_pos = pos;
@@ -162,7 +174,7 @@ noninc_dosearch (string, dir)
#if defined (VI_MODE)
if (rl_editing_mode != vi_mode)
#endif
- history_set_pos (oldpos);
+ history_set_pos (oldpos);
make_history_line_current (entry);
@@ -170,27 +182,24 @@ noninc_dosearch (string, dir)
rl_mark = rl_end;
rl_clear_message ();
+ return 1;
}
-/* Search non-interactively through the history list. DIR < 0 means to
- search backwards through the history of previous commands; otherwise
- the search is for commands subsequent to the current position in the
- history list. PCHAR is the character to use for prompting when reading
- the search string; if not specified (0), it defaults to `:'. */
-static void
-noninc_search (dir, pchar)
- int dir;
- int pchar;
+static _rl_search_cxt *
+_rl_nsearch_init (dir, pchar)
+ int dir, pchar;
{
- int saved_point, saved_mark, c;
+ _rl_search_cxt *cxt;
char *p;
-#if defined (HANDLE_MULTIBYTE)
- char mb[MB_LEN_MAX];
-#endif
+
+ cxt = _rl_scxt_alloc (RL_SEARCH_NSEARCH, 0);
+ if (dir < 0)
+ cxt->sflags |= SF_REVERSE; /* not strictly needed */
+
+ cxt->direction = dir;
+ cxt->history_pos = cxt->save_line;
rl_maybe_save_line ();
- saved_point = rl_point;
- saved_mark = rl_mark;
/* Clear the undo list, since reading the search string should create its
own undo list, and the whole list will end up being freed when we
@@ -202,152 +211,243 @@ noninc_search (dir, pchar)
rl_end = rl_point = 0;
p = _rl_make_prompt_for_search (pchar ? pchar : ':');
- rl_message (p, 0, 0);
+ rl_message ("%s", p, 0);
free (p);
-#define SEARCH_RETURN rl_restore_prompt (); RL_UNSETSTATE(RL_STATE_NSEARCH); return
-
RL_SETSTATE(RL_STATE_NSEARCH);
- /* Read the search string. */
- while (1)
+
+ _rl_nscxt = cxt;
+
+ return cxt;
+}
+
+static int
+_rl_nsearch_cleanup (cxt, r)
+ _rl_search_cxt *cxt;
+ int r;
+{
+ _rl_scxt_dispose (cxt, 0);
+ _rl_nscxt = 0;
+
+ RL_UNSETSTATE(RL_STATE_NSEARCH);
+
+ return (r != 1);
+}
+
+static void
+_rl_nsearch_abort (cxt)
+ _rl_search_cxt *cxt;
+{
+ rl_maybe_unsave_line ();
+ rl_clear_message ();
+ rl_point = cxt->save_point;
+ rl_mark = cxt->save_mark;
+ rl_restore_prompt ();
+
+ RL_UNSETSTATE (RL_STATE_NSEARCH);
+}
+
+/* Process just-read character C according to search context CXT. Return -1
+ if the caller should abort the search, 0 if we should break out of the
+ loop, and 1 if we should continue to read characters. */
+static int
+_rl_nsearch_dispatch (cxt, c)
+ _rl_search_cxt *cxt;
+ int c;
+{
+ switch (c)
{
- RL_SETSTATE(RL_STATE_MOREINPUT);
- c = rl_read_key ();
- RL_UNSETSTATE(RL_STATE_MOREINPUT);
+ case CTRL('W'):
+ rl_unix_word_rubout (1, c);
+ break;
-#if defined (HANDLE_MULTIBYTE)
- if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
- c = _rl_read_mbstring (c, mb, MB_LEN_MAX);
-#endif
+ case CTRL('U'):
+ rl_unix_line_discard (1, c);
+ break;
- if (c == 0)
- break;
+ case RETURN:
+ case NEWLINE:
+ return 0;
- switch (c)
+ case CTRL('H'):
+ case RUBOUT:
+ if (rl_point == 0)
{
- case CTRL('H'):
- case RUBOUT:
- if (rl_point == 0)
- {
- rl_maybe_unsave_line ();
- rl_clear_message ();
- rl_point = saved_point;
- rl_mark = saved_mark;
- SEARCH_RETURN;
- }
- _rl_rubout_char (1, c);
- break;
-
- case CTRL('W'):
- rl_unix_word_rubout (1, c);
- break;
-
- case CTRL('U'):
- rl_unix_line_discard (1, c);
- break;
-
- case RETURN:
- case NEWLINE:
- goto dosearch;
- /* NOTREACHED */
- break;
-
- case CTRL('C'):
- case CTRL('G'):
- rl_maybe_unsave_line ();
- rl_clear_message ();
- rl_point = saved_point;
- rl_mark = saved_mark;
- rl_ding ();
- SEARCH_RETURN;
+ _rl_nsearch_abort (cxt);
+ return -1;
+ }
+ _rl_rubout_char (1, c);
+ break;
+
+ case CTRL('C'):
+ case CTRL('G'):
+ rl_ding ();
+ _rl_nsearch_abort (cxt);
+ return -1;
- default:
+ default:
#if defined (HANDLE_MULTIBYTE)
- if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
- rl_insert_text (mb);
- else
+ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
+ rl_insert_text (cxt->mb);
+ else
#endif
- _rl_insert_char (1, c);
- break;
- }
- (*rl_redisplay_function) ();
+ _rl_insert_char (1, c);
+ break;
}
- dosearch:
- rl_mark = saved_mark;
+ (*rl_redisplay_function) ();
+ return 1;
+}
+
+/* Perform one search according to CXT, using NONINC_SEARCH_STRING. Return
+ -1 if the search should be aborted, any other value means to clean up
+ using _rl_nsearch_cleanup (). Returns 1 if the search was successful,
+ 0 otherwise. */
+static int
+_rl_nsearch_dosearch (cxt)
+ _rl_search_cxt *cxt;
+{
+ rl_mark = cxt->save_mark;
/* If rl_point == 0, we want to re-use the previous search string and
start from the saved history position. If there's no previous search
string, punt. */
if (rl_point == 0)
{
- if (!noninc_search_string)
+ if (noninc_search_string == 0)
{
rl_ding ();
- SEARCH_RETURN;
+ rl_restore_prompt ();
+ RL_UNSETSTATE (RL_STATE_NSEARCH);
+ return -1;
}
}
else
{
/* We want to start the search from the current history position. */
- noninc_history_pos = where_history ();
+ noninc_history_pos = cxt->save_line;
FREE (noninc_search_string);
noninc_search_string = savestring (rl_line_buffer);
+
+ /* If we don't want the subsequent undo list generated by the search
+ matching a history line to include the contents of the search string,
+ we need to clear rl_line_buffer here. For now, we just clear the
+ undo list generated by reading the search string. (If the search
+ fails, the old undo list will be restored by rl_maybe_unsave_line.) */
+ rl_free_undo_list ();
}
rl_restore_prompt ();
- noninc_dosearch (noninc_search_string, dir);
- RL_UNSETSTATE(RL_STATE_NSEARCH);
+ return (noninc_dosearch (noninc_search_string, cxt->direction));
+}
+
+/* Search non-interactively through the history list. DIR < 0 means to
+ search backwards through the history of previous commands; otherwise
+ the search is for commands subsequent to the current position in the
+ history list. PCHAR is the character to use for prompting when reading
+ the search string; if not specified (0), it defaults to `:'. */
+static int
+noninc_search (dir, pchar)
+ int dir;
+ int pchar;
+{
+ _rl_search_cxt *cxt;
+ int c, r;
+
+ cxt = _rl_nsearch_init (dir, pchar);
+
+ if (RL_ISSTATE (RL_STATE_CALLBACK))
+ return (0);
+
+ /* Read the search string. */
+ r = 0;
+ while (1)
+ {
+ c = _rl_search_getchar (cxt);
+
+ if (c == 0)
+ break;
+
+ r = _rl_nsearch_dispatch (cxt, c);
+ if (r < 0)
+ return 1;
+ else if (r == 0)
+ break;
+ }
+
+ r = _rl_nsearch_dosearch (cxt);
+ return ((r >= 0) ? _rl_nsearch_cleanup (cxt, r) : (r != 1));
}
/* Search forward through the history list for a string. If the vi-mode
code calls this, KEY will be `?'. */
int
-rl_noninc_forward_search (int count __attribute__((unused)), int key)
+rl_noninc_forward_search (count, key)
+ int count, key;
{
- noninc_search (1, (key == '?') ? '?' : 0);
- return 0;
+ return noninc_search (1, (key == '?') ? '?' : 0);
}
/* Reverse search the history list for a string. If the vi-mode code
calls this, KEY will be `/'. */
int
-rl_noninc_reverse_search (int count __attribute__((unused)), int key)
+rl_noninc_reverse_search (count, key)
+ int count, key;
{
- noninc_search (-1, (key == '/') ? '/' : 0);
- return 0;
+ return noninc_search (-1, (key == '/') ? '/' : 0);
}
/* Search forward through the history list for the last string searched
for. If there is no saved search string, abort. */
int
-rl_noninc_forward_search_again (int count __attribute__((unused)),
- int key __attribute__((unused)))
+rl_noninc_forward_search_again (count, key)
+ int count, key;
{
+ int r;
+
if (!noninc_search_string)
{
rl_ding ();
return (-1);
}
- noninc_dosearch (noninc_search_string, 1);
- return 0;
+ r = noninc_dosearch (noninc_search_string, 1);
+ return (r != 1);
}
/* Reverse search in the history list for the last string searched
for. If there is no saved search string, abort. */
int
-rl_noninc_reverse_search_again (int count __attribute__((unused)),
- int key __attribute__((unused)))
+rl_noninc_reverse_search_again (count, key)
+ int count, key;
{
+ int r;
+
if (!noninc_search_string)
{
rl_ding ();
return (-1);
}
- noninc_dosearch (noninc_search_string, -1);
- return 0;
+ r = noninc_dosearch (noninc_search_string, -1);
+ return (r != 1);
}
+#if defined (READLINE_CALLBACKS)
+int
+_rl_nsearch_callback (cxt)
+ _rl_search_cxt *cxt;
+{
+ int c, r;
+
+ c = _rl_search_getchar (cxt);
+ r = _rl_nsearch_dispatch (cxt, c);
+ if (r != 0)
+ return 1;
+
+ r = _rl_nsearch_dosearch (cxt);
+ return ((r >= 0) ? _rl_nsearch_cleanup (cxt, r) : (r != 1));
+}
+#endif
+
static int
rl_history_search_internal (count, dir)
int count, dir;
diff --git a/cmd-line-utils/readline/shell.c b/cmd-line-utils/readline/shell.c
index 41668d70ab5..346f8113d43 100644
--- a/cmd-line-utils/readline/shell.c
+++ b/cmd-line-utils/readline/shell.c
@@ -22,7 +22,9 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#include <sys/types.h>
@@ -46,8 +48,12 @@
# include <limits.h>
#endif
+#if defined (HAVE_FCNTL_H)
#include <fcntl.h>
+#endif
+#if defined (HAVE_PWD_H)
#include <pwd.h>
+#endif
#include <stdio.h>
@@ -55,9 +61,9 @@
#include "rlshell.h"
#include "xmalloc.h"
-#if !defined (HAVE_GETPW_DECLS)
+#if defined (HAVE_GETPWUID) && !defined (HAVE_GETPW_DECLS)
extern struct passwd *getpwuid PARAMS((uid_t));
-#endif /* !HAVE_GETPW_DECLS */
+#endif /* HAVE_GETPWUID && !HAVE_GETPW_DECLS */
#ifndef NULL
# define NULL 0
@@ -120,16 +126,7 @@ sh_set_lines_and_columns (lines, cols)
{
char *b;
-#if defined (HAVE_PUTENV)
- b = (char *)xmalloc (INT_STRLEN_BOUND (int) + sizeof ("LINES=") + 1);
- sprintf (b, "LINES=%d", lines);
- putenv (b);
-
- b = (char *)xmalloc (INT_STRLEN_BOUND (int) + sizeof ("COLUMNS=") + 1);
- sprintf (b, "COLUMNS=%d", cols);
- putenv (b);
-#else /* !HAVE_PUTENV */
-# if defined (HAVE_SETENV)
+#if defined (HAVE_SETENV)
b = (char *)xmalloc (INT_STRLEN_BOUND (int) + 1);
sprintf (b, "%d", lines);
setenv ("LINES", b, 1);
@@ -139,8 +136,17 @@ sh_set_lines_and_columns (lines, cols)
sprintf (b, "%d", cols);
setenv ("COLUMNS", b, 1);
free (b);
-# endif /* HAVE_SETENV */
-#endif /* !HAVE_PUTENV */
+#else /* !HAVE_SETENV */
+# if defined (HAVE_PUTENV)
+ b = (char *)xmalloc (INT_STRLEN_BOUND (int) + sizeof ("LINES=") + 1);
+ sprintf (b, "LINES=%d", lines);
+ putenv (b);
+
+ b = (char *)xmalloc (INT_STRLEN_BOUND (int) + sizeof ("COLUMNS=") + 1);
+ sprintf (b, "COLUMNS=%d", cols);
+ putenv (b);
+# endif /* HAVE_PUTENV */
+#endif /* !HAVE_SETENV */
}
char *
@@ -157,9 +163,11 @@ sh_get_home_dir ()
struct passwd *entry;
home_dir = (char *)NULL;
+#if defined (HAVE_GETPWUID)
entry = getpwuid (getuid ());
if (entry)
home_dir = entry->pw_dir;
+#endif
return (home_dir);
}
@@ -173,6 +181,7 @@ int
sh_unset_nodelay_mode (fd)
int fd;
{
+#if defined (HAVE_FCNTL)
int flags, bflags;
if ((flags = fcntl (fd, F_GETFL, 0)) < 0)
@@ -193,6 +202,7 @@ sh_unset_nodelay_mode (fd)
flags &= ~bflags;
return (fcntl (fd, F_SETFL, flags));
}
+#endif
return 0;
}
diff --git a/cmd-line-utils/readline/signals.c b/cmd-line-utils/readline/signals.c
index be1150f6c54..54f2a642846 100644
--- a/cmd-line-utils/readline/signals.c
+++ b/cmd-line-utils/readline/signals.c
@@ -1,6 +1,6 @@
/* signals.c -- signal handling support for readline. */
-/* Copyright (C) 1987, 1989, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2005 Free Software Foundation, Inc.
This file is part of the GNU Readline Library, a library for
reading lines of text with interactive input and history editing.
@@ -21,7 +21,9 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#include <stdio.h> /* Just for NULL. Yuck. */
#include <sys/types.h>
@@ -129,7 +131,11 @@ rl_signal_handler (sig)
#if !defined (HAVE_BSD_SIGNALS) && !defined (HAVE_POSIX_SIGNALS)
/* Since the signal will not be blocked while we are in the signal
handler, ignore it until rl_clear_signals resets the catcher. */
+# if defined (SIGALRM)
if (sig == SIGINT || sig == SIGALRM)
+# else
+ if (sig == SIGINT)
+# endif
rl_set_sighandler (sig, SIG_IGN, &dummy_cxt);
#endif /* !HAVE_BSD_SIGNALS && !HAVE_POSIX_SIGNALS */
@@ -139,17 +145,22 @@ rl_signal_handler (sig)
rl_free_line_state ();
/* FALLTHROUGH */
+ case SIGTERM:
#if defined (SIGTSTP)
case SIGTSTP:
case SIGTTOU:
case SIGTTIN:
#endif /* SIGTSTP */
+#if defined (SIGALRM)
case SIGALRM:
- case SIGTERM:
+#endif
+#if defined (SIGQUIT)
case SIGQUIT:
+#endif
rl_cleanup_after_signal ();
#if defined (HAVE_POSIX_SIGNALS)
+ sigemptyset (&set);
sigprocmask (SIG_BLOCK, (sigset_t *)NULL, &set);
sigdelset (&set, sig);
#else /* !HAVE_POSIX_SIGNALS */
@@ -162,7 +173,11 @@ rl_signal_handler (sig)
signal (sig, SIG_ACK);
#endif
+#if defined (HAVE_KILL)
kill (getpid (), sig);
+#else
+ raise (sig); /* assume we have raise */
+#endif
/* Let the signal that we just sent through. */
#if defined (HAVE_POSIX_SIGNALS)
@@ -274,13 +289,51 @@ rl_set_signals ()
{
sighandler_cxt dummy;
SigHandler *oh;
+#if defined (HAVE_POSIX_SIGNALS)
+ static int sigmask_set = 0;
+ static sigset_t bset, oset;
+#endif
+
+#if defined (HAVE_POSIX_SIGNALS)
+ if (rl_catch_signals && sigmask_set == 0)
+ {
+ sigemptyset (&bset);
+
+ sigaddset (&bset, SIGINT);
+ sigaddset (&bset, SIGINT);
+#if defined (SIGQUIT)
+ sigaddset (&bset, SIGQUIT);
+#endif
+#if defined (SIGALRM)
+ sigaddset (&bset, SIGALRM);
+#endif
+#if defined (SIGTSTP)
+ sigaddset (&bset, SIGTSTP);
+#endif
+#if defined (SIGTTIN)
+ sigaddset (&bset, SIGTTIN);
+#endif
+#if defined (SIGTTOU)
+ sigaddset (&bset, SIGTTOU);
+#endif
+ sigmask_set = 1;
+ }
+#endif /* HAVE_POSIX_SIGNALS */
if (rl_catch_signals && signals_set_flag == 0)
{
+#if defined (HAVE_POSIX_SIGNALS)
+ sigemptyset (&oset);
+ sigprocmask (SIG_BLOCK, &bset, &oset);
+#endif
+
rl_maybe_set_sighandler (SIGINT, rl_signal_handler, &old_int);
rl_maybe_set_sighandler (SIGTERM, rl_signal_handler, &old_term);
+#if defined (SIGQUIT)
rl_maybe_set_sighandler (SIGQUIT, rl_signal_handler, &old_quit);
+#endif
+#if defined (SIGALRM)
oh = rl_set_sighandler (SIGALRM, rl_signal_handler, &old_alrm);
if (oh == (SigHandler *)SIG_IGN)
rl_sigaction (SIGALRM, &old_alrm, &dummy);
@@ -292,6 +345,7 @@ rl_set_signals ()
if (oh != (SigHandler *)SIG_DFL && (old_alrm.sa_flags & SA_RESTART))
rl_sigaction (SIGALRM, &old_alrm, &dummy);
#endif /* HAVE_POSIX_SIGNALS */
+#endif /* SIGALRM */
#if defined (SIGTSTP)
rl_maybe_set_sighandler (SIGTSTP, rl_signal_handler, &old_tstp);
@@ -306,6 +360,10 @@ rl_set_signals ()
#endif /* SIGTTIN */
signals_set_flag = 1;
+
+#if defined (HAVE_POSIX_SIGNALS)
+ sigprocmask (SIG_SETMASK, &oset, (sigset_t *)NULL);
+#endif
}
#if defined (SIGWINCH)
@@ -330,8 +388,12 @@ rl_clear_signals ()
rl_sigaction (SIGINT, &old_int, &dummy);
rl_sigaction (SIGTERM, &old_term, &dummy);
+#if defined (SIGQUIT)
rl_sigaction (SIGQUIT, &old_quit, &dummy);
+#endif
+#if defined (SIGALRM)
rl_sigaction (SIGALRM, &old_alrm, &dummy);
+#endif
#if defined (SIGTSTP)
rl_sigaction (SIGTSTP, &old_tstp, &dummy);
@@ -366,16 +428,18 @@ void
rl_cleanup_after_signal ()
{
_rl_clean_up_for_exit ();
- (*rl_deprep_term_function) ();
- rl_clear_signals ();
+ if (rl_deprep_term_function)
+ (*rl_deprep_term_function) ();
rl_clear_pending_input ();
+ rl_clear_signals ();
}
/* Reset the terminal and readline state after a signal handler returns. */
void
rl_reset_after_signal ()
{
- (*rl_prep_term_function) (_rl_meta_flag);
+ if (rl_prep_term_function)
+ (*rl_prep_term_function) (_rl_meta_flag);
rl_set_signals ();
}
@@ -396,7 +460,7 @@ rl_free_line_state ()
_rl_kill_kbd_macro ();
rl_clear_message ();
- _rl_init_argument ();
+ _rl_reset_argument ();
}
#endif /* HANDLE_SIGNALS */
diff --git a/cmd-line-utils/readline/terminal.c b/cmd-line-utils/readline/terminal.c
index 4b900c5d860..547f6f5dfe5 100644
--- a/cmd-line-utils/readline/terminal.c
+++ b/cmd-line-utils/readline/terminal.c
@@ -1,6 +1,6 @@
/* terminal.c -- controlling the terminal with termcap. */
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2006 Free Software Foundation, Inc.
This file is part of the GNU Readline Library, a library for
reading lines of text with interactive input and history editing.
@@ -21,7 +21,9 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#include <sys/types.h>
#include "posixstat.h"
@@ -64,9 +66,25 @@
#include "rlshell.h"
#include "xmalloc.h"
+#if defined (__MINGW32__)
+# include <windows.h>
+# include <wincon.h>
+
+static void _win_get_screensize PARAMS((int *, int *));
+#endif
+
+#if defined (__EMX__)
+static void _emx_get_screensize PARAMS((int *, int *));
+#endif
+
#define CUSTOM_REDISPLAY_FUNC() (rl_redisplay_function != rl_redisplay)
#define CUSTOM_INPUT_FUNC() (rl_getc_function != rl_getc)
+/* If the calling application sets this to a non-zero value, readline will
+ use the $LINES and $COLUMNS environment variables to set its idea of the
+ window size before interrogating the kernel. */
+int rl_prefer_env_winsize = 0;
+
/* **************************************************************** */
/* */
/* Terminal and Termcap */
@@ -107,9 +125,7 @@ char *_rl_term_IC;
char *_rl_term_dc;
char *_rl_term_DC;
-#if defined (HACK_TERMCAP_MOTION)
char *_rl_term_forward_char;
-#endif /* HACK_TERMCAP_MOTION */
/* How to go up a line. */
char *_rl_term_up;
@@ -118,7 +134,7 @@ char *_rl_term_up;
static char *_rl_visible_bell;
/* Non-zero means the terminal can auto-wrap lines. */
-int _rl_term_autowrap;
+int _rl_term_autowrap = -1;
/* Non-zero means that this terminal has a meta key. */
static int term_has_meta;
@@ -143,6 +159,9 @@ static char *_rl_term_kh;
static char *_rl_term_kH;
static char *_rl_term_at7; /* @7 */
+/* Delete key */
+static char *_rl_term_kD;
+
/* Insert key */
static char *_rl_term_kI;
@@ -177,6 +196,26 @@ _emx_get_screensize (swp, shp)
}
#endif
+#if defined (__MINGW32__)
+static void
+_win_get_screensize (swp, shp)
+ int *swp, *shp;
+{
+ HANDLE hConOut;
+ CONSOLE_SCREEN_BUFFER_INFO scr;
+
+ hConOut = GetStdHandle (STD_OUTPUT_HANDLE);
+ if (hConOut != INVALID_HANDLE_VALUE)
+ {
+ if (GetConsoleScreenBufferInfo (hConOut, &scr))
+ {
+ *swp = scr.dwSize.X;
+ *shp = scr.srWindow.Bottom - scr.srWindow.Top + 1;
+ }
+ }
+}
+#endif
+
/* Get readline's idea of the screen size. TTY is a file descriptor open
to the terminal. If IGNORE_ENV is true, we do not pay attention to the
values of $LINES and $COLUMNS. The tests for TERM_STRING_BUFFER being
@@ -189,26 +228,42 @@ _rl_get_screen_size (tty, ignore_env)
#if defined (TIOCGWINSZ)
struct winsize window_size;
#endif /* TIOCGWINSZ */
+ int wr, wc;
+ wr = wc = -1;
#if defined (TIOCGWINSZ)
if (ioctl (tty, TIOCGWINSZ, &window_size) == 0)
{
- _rl_screenwidth = (int) window_size.ws_col;
- _rl_screenheight = (int) window_size.ws_row;
+ wc = (int) window_size.ws_col;
+ wr = (int) window_size.ws_row;
}
#endif /* TIOCGWINSZ */
#if defined (__EMX__)
- _emx_get_screensize (&_rl_screenwidth, &_rl_screenheight);
+ _emx_get_screensize (&wc, &wr);
+#elif defined (__MINGW32__)
+ _win_get_screensize (&wc, &wr);
#endif
+ if (ignore_env || rl_prefer_env_winsize == 0)
+ {
+ _rl_screenwidth = wc;
+ _rl_screenheight = wr;
+ }
+ else
+ _rl_screenwidth = _rl_screenheight = -1;
+
/* Environment variable COLUMNS overrides setting of "co" if IGNORE_ENV
- is unset. */
+ is unset. If we prefer the environment, check it first before
+ assigning the value returned by the kernel. */
if (_rl_screenwidth <= 0)
{
if (ignore_env == 0 && (ss = sh_get_env_value ("COLUMNS")))
_rl_screenwidth = atoi (ss);
+ if (_rl_screenwidth <= 0)
+ _rl_screenwidth = wc;
+
#if !defined (__DJGPP__)
if (_rl_screenwidth <= 0 && term_string_buffer)
_rl_screenwidth = tgetnum ("co");
@@ -222,6 +277,9 @@ _rl_get_screen_size (tty, ignore_env)
if (ignore_env == 0 && (ss = sh_get_env_value ("LINES")))
_rl_screenheight = atoi (ss);
+ if (_rl_screenheight <= 0)
+ _rl_screenheight = wr;
+
#if !defined (__DJGPP__)
if (_rl_screenheight <= 0 && term_string_buffer)
_rl_screenheight = tgetnum ("li");
@@ -250,16 +308,20 @@ void
_rl_set_screen_size (rows, cols)
int rows, cols;
{
- if (rows == 0 || cols == 0)
- return;
-
- _rl_screenheight = rows;
- _rl_screenwidth = cols;
+ if (_rl_term_autowrap == -1)
+ _rl_init_terminal_io (rl_terminal_name);
- if (_rl_term_autowrap == 0)
- _rl_screenwidth--;
+ if (rows > 0)
+ _rl_screenheight = rows;
+ if (cols > 0)
+ {
+ _rl_screenwidth = cols;
+ if (_rl_term_autowrap == 0)
+ _rl_screenwidth--;
+ }
- _rl_screenchars = _rl_screenwidth * _rl_screenheight;
+ if (rows > 0 || cols > 0)
+ _rl_screenchars = _rl_screenwidth * _rl_screenheight;
}
void
@@ -278,6 +340,12 @@ rl_get_screen_size (rows, cols)
if (cols)
*cols = _rl_screenwidth;
}
+
+void
+rl_reset_screen_size ()
+{
+ _rl_get_screen_size (fileno (rl_instream), 0);
+}
void
rl_resize_terminal ()
@@ -311,6 +379,7 @@ static struct _tc_string tc_strings[] =
{ "ei", &_rl_term_ei },
{ "ic", &_rl_term_ic },
{ "im", &_rl_term_im },
+ { "kD", &_rl_term_kD }, /* delete */
{ "kH", &_rl_term_kH }, /* home down ?? */
{ "kI", &_rl_term_kI }, /* insert */
{ "kd", &_rl_term_kd },
@@ -323,9 +392,7 @@ static struct _tc_string tc_strings[] =
{ "le", &_rl_term_backspace },
{ "mm", &_rl_term_mm },
{ "mo", &_rl_term_mo },
-#if defined (HACK_TERMCAP_MOTION)
{ "nd", &_rl_term_forward_char },
-#endif
{ "pc", &_rl_term_pc },
{ "up", &_rl_term_up },
{ "vb", &_rl_visible_bell },
@@ -344,7 +411,7 @@ get_term_capabilities (bp)
#if !defined (__DJGPP__) /* XXX - doesn't DJGPP have a termcap library? */
register int i;
- for (i = 0; i < (int) NUM_TC_STRINGS; i++)
+ for (i = 0; i < NUM_TC_STRINGS; i++)
*(tc_strings[i].tc_value) = tgetstr ((char *)tc_strings[i].tc_var, bp);
#endif
tcap_initialized = 1;
@@ -361,7 +428,6 @@ _rl_init_terminal_io (terminal_name)
term = terminal_name ? terminal_name : sh_get_env_value ("TERM");
_rl_term_clrpag = _rl_term_cr = _rl_term_clreol = (char *)NULL;
tty = rl_instream ? fileno (rl_instream) : 0;
- _rl_screenwidth = _rl_screenheight = 0;
if (term == 0)
term = "dumb";
@@ -394,12 +460,17 @@ _rl_init_terminal_io (terminal_name)
_rl_term_autowrap = 0; /* used by _rl_get_screen_size */
+ /* Allow calling application to set default height and width, using
+ rl_set_screen_size */
+ if (_rl_screenwidth <= 0 || _rl_screenheight <= 0)
+ {
#if defined (__EMX__)
- _emx_get_screensize (&_rl_screenwidth, &_rl_screenheight);
- _rl_screenwidth--;
+ _emx_get_screensize (&_rl_screenwidth, &_rl_screenheight);
+ _rl_screenwidth--;
#else /* !__EMX__ */
- _rl_get_screen_size (tty, 0);
+ _rl_get_screen_size (tty, 0);
#endif /* !__EMX__ */
+ }
/* Defaults. */
if (_rl_screenwidth <= 0 || _rl_screenheight <= 0)
@@ -410,24 +481,22 @@ _rl_init_terminal_io (terminal_name)
/* Everything below here is used by the redisplay code (tputs). */
_rl_screenchars = _rl_screenwidth * _rl_screenheight;
- _rl_term_cr = (char*) "\r";
+ _rl_term_cr = "\r";
_rl_term_im = _rl_term_ei = _rl_term_ic = _rl_term_IC = (char *)NULL;
_rl_term_up = _rl_term_dc = _rl_term_DC = _rl_visible_bell = (char *)NULL;
_rl_term_ku = _rl_term_kd = _rl_term_kl = _rl_term_kr = (char *)NULL;
- _rl_term_kh = _rl_term_kH = _rl_term_kI = (char *)NULL;
+ _rl_term_kh = _rl_term_kH = _rl_term_kI = _rl_term_kD = (char *)NULL;
_rl_term_ks = _rl_term_ke = _rl_term_at7 = (char *)NULL;
_rl_term_mm = _rl_term_mo = (char *)NULL;
_rl_term_ve = _rl_term_vs = (char *)NULL;
-#if defined (HACK_TERMCAP_MOTION)
- term_forward_char = (char *)NULL;
-#endif
+ _rl_term_forward_char = (char *)NULL;
_rl_terminal_can_insert = term_has_meta = 0;
/* Reasonable defaults for tgoto(). Readline currently only uses
tgoto if _rl_term_IC or _rl_term_DC is defined, but just in case we
change that later... */
PC = '\0';
- BC = _rl_term_backspace = (char*) "\b";
+ BC = _rl_term_backspace = "\b";
UP = _rl_term_up;
return 0;
@@ -442,11 +511,14 @@ _rl_init_terminal_io (terminal_name)
UP = _rl_term_up;
if (!_rl_term_cr)
- _rl_term_cr = (char*) "\r";
+ _rl_term_cr = "\r";
_rl_term_autowrap = tgetflag ("am") && tgetflag ("xn");
- _rl_get_screen_size (tty, 0);
+ /* Allow calling application to set default height and width, using
+ rl_set_screen_size */
+ if (_rl_screenwidth <= 0 || _rl_screenheight <= 0)
+ _rl_get_screen_size (tty, 0);
/* "An application program can assume that the terminal can do
character insertion if *any one of* the capabilities `IC',
@@ -491,6 +563,8 @@ bind_termcap_arrow_keys (map)
rl_bind_keyseq_if_unbound (_rl_term_kh, rl_beg_of_line); /* Home */
rl_bind_keyseq_if_unbound (_rl_term_at7, rl_end_of_line); /* End */
+ rl_bind_keyseq_if_unbound (_rl_term_kD, rl_delete);
+
_rl_keymap = xkeymap;
}
@@ -502,7 +576,7 @@ rl_get_termcap (cap)
if (tcap_initialized == 0)
return ((char *)NULL);
- for (i = 0; i < (int) NUM_TC_STRINGS; i++)
+ for (i = 0; i < NUM_TC_STRINGS; i++)
{
if (tc_strings[i].tc_var[0] == cap[0] && strcmp (tc_strings[i].tc_var, cap) == 0)
return *(tc_strings[i].tc_value);
@@ -516,6 +590,7 @@ int
rl_reset_terminal (terminal_name)
const char *terminal_name;
{
+ _rl_screenwidth = _rl_screenheight = 0;
_rl_init_terminal_io (terminal_name);
return 0;
}
diff --git a/cmd-line-utils/readline/text.c b/cmd-line-utils/readline/text.c
index cf9223df844..399a48c5f1e 100644
--- a/cmd-line-utils/readline/text.c
+++ b/cmd-line-utils/readline/text.c
@@ -1,6 +1,6 @@
/* text.c -- text handling commands for readline. */
-/* Copyright (C) 1987-2004 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2005 Free Software Foundation, Inc.
This file is part of the GNU Readline Library, a library for
reading lines of text with interactive input and history editing.
@@ -21,7 +21,9 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#if defined (HAVE_UNISTD_H)
# include <unistd.h>
@@ -60,6 +62,11 @@
static int rl_change_case PARAMS((int, int));
static int _rl_char_search PARAMS((int, int, int));
+#if defined (READLINE_CALLBACKS)
+static int _rl_insert_next_callback PARAMS((_rl_callback_generic_arg *));
+static int _rl_char_search_callback PARAMS((_rl_callback_generic_arg *));
+#endif
+
/* **************************************************************** */
/* */
/* Insert and Delete */
@@ -402,7 +409,8 @@ rl_backward (count, key)
/* Move to the beginning of the line. */
int
-rl_beg_of_line (int count __attribute__((unused)), int key __attribute__((unused)))
+rl_beg_of_line (count, key)
+ int count, key;
{
rl_point = 0;
return 0;
@@ -410,14 +418,14 @@ rl_beg_of_line (int count __attribute__((unused)), int key __attribute__((unused
/* Move to the end of the line. */
int
-rl_end_of_line (int count __attribute__((unused)), int key __attribute__((unused)))
+rl_end_of_line (count, key)
+ int count, key;
{
rl_point = rl_end;
return 0;
}
-/* XXX - these might need changes for multibyte characters */
-/* Move forward a word. We do what Emacs does. */
+/* Move forward a word. We do what Emacs does. Handles multibyte chars. */
int
rl_forward_word (count, key)
int count, key;
@@ -434,68 +442,80 @@ rl_forward_word (count, key)
/* If we are not in a word, move forward until we are in one.
Then, move forward until we hit a non-alphabetic character. */
- c = rl_line_buffer[rl_point];
- if (rl_alphabetic (c) == 0)
+ c = _rl_char_value (rl_line_buffer, rl_point);
+
+ if (_rl_walphabetic (c) == 0)
{
- while (++rl_point < rl_end)
+ rl_point = MB_NEXTCHAR (rl_line_buffer, rl_point, 1, MB_FIND_NONZERO);
+ while (rl_point < rl_end)
{
- c = rl_line_buffer[rl_point];
- if (rl_alphabetic (c))
+ c = _rl_char_value (rl_line_buffer, rl_point);
+ if (_rl_walphabetic (c))
break;
+ rl_point = MB_NEXTCHAR (rl_line_buffer, rl_point, 1, MB_FIND_NONZERO);
}
}
if (rl_point == rl_end)
return 0;
- while (++rl_point < rl_end)
+ rl_point = MB_NEXTCHAR (rl_line_buffer, rl_point, 1, MB_FIND_NONZERO);
+ while (rl_point < rl_end)
{
- c = rl_line_buffer[rl_point];
- if (rl_alphabetic (c) == 0)
+ c = _rl_char_value (rl_line_buffer, rl_point);
+ if (_rl_walphabetic (c) == 0)
break;
+ rl_point = MB_NEXTCHAR (rl_line_buffer, rl_point, 1, MB_FIND_NONZERO);
}
+
--count;
}
return 0;
}
-/* Move backward a word. We do what Emacs does. */
+/* Move backward a word. We do what Emacs does. Handles multibyte chars. */
int
rl_backward_word (count, key)
int count, key;
{
- int c;
+ int c, p;
if (count < 0)
return (rl_forward_word (-count, key));
while (count)
{
- if (!rl_point)
+ if (rl_point == 0)
return 0;
/* Like rl_forward_word (), except that we look at the characters
just before point. */
- c = rl_line_buffer[rl_point - 1];
- if (rl_alphabetic (c) == 0)
+ p = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_NONZERO);
+ c = _rl_char_value (rl_line_buffer, p);
+
+ if (_rl_walphabetic (c) == 0)
{
- while (--rl_point)
+ rl_point = p;
+ while (rl_point > 0)
{
- c = rl_line_buffer[rl_point - 1];
- if (rl_alphabetic (c))
+ p = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_NONZERO);
+ c = _rl_char_value (rl_line_buffer, p);
+ if (_rl_walphabetic (c))
break;
+ rl_point = p;
}
}
while (rl_point)
{
- c = rl_line_buffer[rl_point - 1];
- if (rl_alphabetic (c) == 0)
+ p = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_NONZERO);
+ c = _rl_char_value (rl_line_buffer, p);
+ if (_rl_walphabetic (c) == 0)
break;
else
- --rl_point;
+ rl_point = p;
}
--count;
@@ -506,7 +526,8 @@ rl_backward_word (count, key)
/* Clear the current line. Numeric argument to C-l does this. */
int
-rl_refresh_line (int count __attribute__((unused)), int key __attribute__((unused)))
+rl_refresh_line (ignore1, ignore2)
+ int ignore1, ignore2;
{
int curr_line;
@@ -544,7 +565,8 @@ rl_clear_screen (count, key)
}
int
-rl_arrow_keys (int count, int c __attribute__((unused)))
+rl_arrow_keys (count, c)
+ int count, c;
{
int ch;
@@ -592,7 +614,7 @@ rl_arrow_keys (int count, int c __attribute__((unused)))
#ifdef HANDLE_MULTIBYTE
static char pending_bytes[MB_LEN_MAX];
static int pending_bytes_length = 0;
-static mbstate_t ps;
+static mbstate_t ps = {0};
#endif
/* Insert the character C at the current location, moving point forward.
@@ -750,10 +772,8 @@ _rl_insert_char (count, c)
return 0;
}
-#if defined (HANDLE_MULTIBYTE)
if (MB_CUR_MAX == 1 || rl_byte_oriented)
{
-#endif
/* We are inserting a single character.
If there is pending input, then make a string of all of the
pending characters that are bound to rl_insert, and insert
@@ -769,8 +789,8 @@ _rl_insert_char (count, c)
str[0] = c;
rl_insert_text (str);
}
-#if defined (HANDLE_MULTIBYTE)
}
+#if defined (HANDLE_MULTIBYTE)
else
{
rl_insert_text (incoming);
@@ -827,29 +847,67 @@ rl_insert (count, c)
}
/* Insert the next typed character verbatim. */
-int
-rl_quoted_insert (int count, int key __attribute__((unused)))
+static int
+_rl_insert_next (count)
+ int count;
{
int c;
-#if defined (HANDLE_SIGNALS)
- _rl_disable_tty_signals ();
-#endif
-
RL_SETSTATE(RL_STATE_MOREINPUT);
c = rl_read_key ();
RL_UNSETSTATE(RL_STATE_MOREINPUT);
#if defined (HANDLE_SIGNALS)
- _rl_restore_tty_signals ();
+ if (RL_ISSTATE (RL_STATE_CALLBACK) == 0)
+ _rl_restore_tty_signals ();
#endif
return (_rl_insert_char (count, c));
}
+#if defined (READLINE_CALLBACKS)
+static int
+_rl_insert_next_callback (data)
+ _rl_callback_generic_arg *data;
+{
+ int count;
+
+ count = data->count;
+
+ /* Deregister function, let rl_callback_read_char deallocate data */
+ _rl_callback_func = 0;
+ _rl_want_redisplay = 1;
+
+ return _rl_insert_next (count);
+}
+#endif
+
+int
+rl_quoted_insert (count, key)
+ int count, key;
+{
+ /* Let's see...should the callback interface futz with signal handling? */
+#if defined (HANDLE_SIGNALS)
+ if (RL_ISSTATE (RL_STATE_CALLBACK) == 0)
+ _rl_disable_tty_signals ();
+#endif
+
+#if defined (READLINE_CALLBACKS)
+ if (RL_ISSTATE (RL_STATE_CALLBACK))
+ {
+ _rl_callback_data = _rl_callback_data_alloc (count);
+ _rl_callback_func = _rl_insert_next_callback;
+ return (0);
+ }
+#endif
+
+ return _rl_insert_next (count);
+}
+
/* Insert a tab character. */
int
-rl_tab_insert (int count, int key __attribute__((unused)))
+rl_tab_insert (count, key)
+ int count, key;
{
return (_rl_insert_char (count, '\t'));
}
@@ -858,7 +916,8 @@ rl_tab_insert (int count, int key __attribute__((unused)))
KEY is the key that invoked this command. I guess it could have
meaning in the future. */
int
-rl_newline (int count __attribute__((unused)), int key __attribute__((unused)))
+rl_newline (count, key)
+ int count, key;
{
rl_done = 1;
@@ -891,8 +950,8 @@ rl_newline (int count __attribute__((unused)), int key __attribute__((unused)))
is just a stub, you bind keys to it and the code in _rl_dispatch ()
is special cased. */
int
-rl_do_lowercase_version (int count __attribute__((unused)),
- int key __attribute__((unused)))
+rl_do_lowercase_version (ignore1, ignore2)
+ int ignore1, ignore2;
{
return 0;
}
@@ -979,43 +1038,17 @@ _rl_rubout_char (count, key)
return -1;
}
+ orig_point = rl_point;
if (count > 1 || rl_explicit_arg)
{
- orig_point = rl_point;
-#if defined (HANDLE_MULTIBYTE)
- if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
- rl_backward_char (count, key);
- else
-#endif
- rl_backward_byte (count, key);
+ rl_backward_char (count, key);
rl_kill_text (orig_point, rl_point);
}
- else
+ else if (MB_CUR_MAX == 1 || rl_byte_oriented)
{
-#if defined (HANDLE_MULTIBYTE)
- if (MB_CUR_MAX == 1 || rl_byte_oriented)
- {
-#endif
- c = rl_line_buffer[--rl_point];
- rl_delete_text (rl_point, rl_point + 1);
-#if defined (HANDLE_MULTIBYTE)
- }
- else
- {
- int orig_point2;
-
- orig_point2 = rl_point;
- rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_NONZERO);
- c = rl_line_buffer[rl_point];
- rl_delete_text (rl_point, orig_point2);
- }
-#endif /* HANDLE_MULTIBYTE */
-
- /* I don't think that the hack for end of line is needed for
- multibyte chars. */
-#if defined (HANDLE_MULTIBYTE)
- if (MB_CUR_MAX == 1 || rl_byte_oriented)
-#endif
+ c = rl_line_buffer[--rl_point];
+ rl_delete_text (rl_point, orig_point);
+ /* The erase-at-end-of-line hack is of questionable merit now. */
if (rl_point == rl_end && ISPRINT (c) && _rl_last_c_pos)
{
int l;
@@ -1023,6 +1056,11 @@ _rl_rubout_char (count, key)
_rl_erase_at_end_of_line (l);
}
}
+ else
+ {
+ rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_NONZERO);
+ rl_delete_text (rl_point, orig_point);
+ }
return 0;
}
@@ -1033,7 +1071,7 @@ int
rl_delete (count, key)
int count, key;
{
- int r;
+ int xpoint;
if (count < 0)
return (_rl_rubout_char (-count, key));
@@ -1046,28 +1084,21 @@ rl_delete (count, key)
if (count > 1 || rl_explicit_arg)
{
- int orig_point = rl_point;
-#if defined (HANDLE_MULTIBYTE)
+ xpoint = rl_point;
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
rl_forward_char (count, key);
else
-#endif
rl_forward_byte (count, key);
- r = rl_kill_text (orig_point, rl_point);
- rl_point = orig_point;
- return r;
+ rl_kill_text (xpoint, rl_point);
+ rl_point = xpoint;
}
else
{
- int new_point;
- if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
- new_point = _rl_find_next_mbchar (rl_line_buffer, rl_point, 1, MB_FIND_NONZERO);
- else
- new_point = rl_point + 1;
-
- return (rl_delete_text (rl_point, new_point));
+ xpoint = MB_NEXTCHAR (rl_line_buffer, rl_point, 1, MB_FIND_NONZERO);
+ rl_delete_text (rl_point, xpoint);
}
+ return 0;
}
/* Delete the character under the cursor, unless the insertion
@@ -1086,8 +1117,8 @@ rl_rubout_or_delete (count, key)
/* Delete all spaces and tabs around point. */
int
-rl_delete_horizontal_space (int count __attribute__((unused)),
- int key __attribute__((unused)))
+rl_delete_horizontal_space (count, ignore)
+ int count, ignore;
{
int start = rl_point;
@@ -1104,6 +1135,10 @@ rl_delete_horizontal_space (int count __attribute__((unused)),
rl_delete_text (start, rl_point);
rl_point = start;
}
+
+ if (rl_point < 0)
+ rl_point = 0;
+
return 0;
}
@@ -1127,13 +1162,14 @@ rl_delete_or_show_completions (count, key)
/* Turn the current line into a comment in shell history.
A K*rn shell style function. */
int
-rl_insert_comment (int count __attribute__((unused)), int key)
+rl_insert_comment (count, key)
+ int count, key;
{
char *rl_comment_text;
int rl_comment_len;
rl_beg_of_line (1, key);
- rl_comment_text = _rl_comment_begin ? _rl_comment_begin : (char*) RL_COMMENT_BEGIN_DEFAULT;
+ rl_comment_text = _rl_comment_begin ? _rl_comment_begin : RL_COMMENT_BEGIN_DEFAULT;
if (rl_explicit_arg == 0)
rl_insert_text (rl_comment_text);
@@ -1165,21 +1201,24 @@ rl_insert_comment (int count __attribute__((unused)), int key)
/* Uppercase the word at point. */
int
-rl_upcase_word (int count, int key __attribute__((unused)))
+rl_upcase_word (count, key)
+ int count, key;
{
return (rl_change_case (count, UpCase));
}
/* Lowercase the word at point. */
int
-rl_downcase_word (int count, int key __attribute__((unused)))
+rl_downcase_word (count, key)
+ int count, key;
{
return (rl_change_case (count, DownCase));
}
/* Upcase the first letter, downcase the rest. */
int
-rl_capitalize_word (int count, int key __attribute__((unused)))
+rl_capitalize_word (count, key)
+ int count, key;
{
return (rl_change_case (count, CapCase));
}
@@ -1193,42 +1232,80 @@ static int
rl_change_case (count, op)
int count, op;
{
- register int start, end;
- int inword, c;
+ int start, next, end;
+ int inword, c, nc, nop;
+#if defined (HANDLE_MULTIBYTE)
+ wchar_t wc, nwc;
+ char mb[MB_LEN_MAX+1];
+ int mlen;
+ mbstate_t mps;
+#endif
start = rl_point;
rl_forward_word (count, 0);
end = rl_point;
+ if (op != UpCase && op != DownCase && op != CapCase)
+ {
+ rl_ding ();
+ return -1;
+ }
+
if (count < 0)
SWAP (start, end);
+#if defined (HANDLE_MULTIBYTE)
+ memset (&mps, 0, sizeof (mbstate_t));
+#endif
+
/* We are going to modify some text, so let's prepare to undo it. */
rl_modifying (start, end);
- for (inword = 0; start < end; start++)
+ inword = 0;
+ while (start < end)
{
- c = rl_line_buffer[start];
- switch (op)
- {
- case UpCase:
- rl_line_buffer[start] = _rl_to_upper (c);
- break;
+ c = _rl_char_value (rl_line_buffer, start);
+ /* This assumes that the upper and lower case versions are the same width. */
+ next = MB_NEXTCHAR (rl_line_buffer, start, 1, MB_FIND_NONZERO);
- case DownCase:
- rl_line_buffer[start] = _rl_to_lower (c);
- break;
-
- case CapCase:
- rl_line_buffer[start] = (inword == 0) ? _rl_to_upper (c) : _rl_to_lower (c);
- inword = rl_alphabetic (rl_line_buffer[start]);
- break;
+ if (_rl_walphabetic (c) == 0)
+ {
+ inword = 0;
+ start = next;
+ continue;
+ }
- default:
- rl_ding ();
- return -1;
+ if (op == CapCase)
+ {
+ nop = inword ? DownCase : UpCase;
+ inword = 1;
+ }
+ else
+ nop = op;
+ if (MB_CUR_MAX == 1 || rl_byte_oriented || isascii (c))
+ {
+ nc = (nop == UpCase) ? _rl_to_upper (c) : _rl_to_lower (c);
+ rl_line_buffer[start] = nc;
+ }
+#if defined (HANDLE_MULTIBYTE)
+ else
+ {
+ mbrtowc (&wc, rl_line_buffer + start, end - start, &mps);
+ nwc = (nop == UpCase) ? _rl_to_wupper (wc) : _rl_to_wlower (wc);
+ if (nwc != wc) /* just skip unchanged characters */
+ {
+ mlen = wcrtomb (mb, nwc, &mps);
+ if (mlen > 0)
+ mb[mlen] = '\0';
+ /* Assume the same width */
+ strncpy (rl_line_buffer + start, mb, mlen);
+ }
}
+#endif
+
+ start = next;
}
+
rl_point = end;
return 0;
}
@@ -1303,15 +1380,16 @@ rl_transpose_words (count, key)
/* Transpose the characters at point. If point is at the end of the line,
then transpose the characters before point. */
int
-rl_transpose_chars (int count, int key __attribute__((unused)))
+rl_transpose_chars (count, key)
+ int count, key;
{
#if defined (HANDLE_MULTIBYTE)
char *dummy;
- int i, prev_point;
+ int i;
#else
char dummy[2];
#endif
- int char_length;
+ int char_length, prev_point;
if (count == 0)
return 0;
@@ -1326,20 +1404,12 @@ rl_transpose_chars (int count, int key __attribute__((unused)))
if (rl_point == rl_end)
{
- if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
- rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_NONZERO);
- else
- --rl_point;
+ rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_NONZERO);
count = 1;
}
-#if defined (HANDLE_MULTIBYTE)
prev_point = rl_point;
- if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
- rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_NONZERO);
- else
-#endif
- rl_point--;
+ rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_NONZERO);
#if defined (HANDLE_MULTIBYTE)
char_length = prev_point - rl_point;
@@ -1473,15 +1543,51 @@ _rl_char_search (count, fdir, bdir)
}
#endif /* !HANDLE_MULTIBYTE */
+#if defined (READLINE_CALLBACKS)
+static int
+_rl_char_search_callback (data)
+ _rl_callback_generic_arg *data;
+{
+ _rl_callback_func = 0;
+ _rl_want_redisplay = 1;
+
+ return (_rl_char_search (data->count, data->i1, data->i2));
+}
+#endif
+
int
-rl_char_search (int count, int key __attribute__((unused)))
+rl_char_search (count, key)
+ int count, key;
{
+#if defined (READLINE_CALLBACKS)
+ if (RL_ISSTATE (RL_STATE_CALLBACK))
+ {
+ _rl_callback_data = _rl_callback_data_alloc (count);
+ _rl_callback_data->i1 = FFIND;
+ _rl_callback_data->i2 = BFIND;
+ _rl_callback_func = _rl_char_search_callback;
+ return (0);
+ }
+#endif
+
return (_rl_char_search (count, FFIND, BFIND));
}
int
-rl_backward_char_search (int count, int key __attribute__((unused)))
+rl_backward_char_search (count, key)
+ int count, key;
{
+#if defined (READLINE_CALLBACKS)
+ if (RL_ISSTATE (RL_STATE_CALLBACK))
+ {
+ _rl_callback_data = _rl_callback_data_alloc (count);
+ _rl_callback_data->i1 = BFIND;
+ _rl_callback_data->i2 = FFIND;
+ _rl_callback_func = _rl_char_search_callback;
+ return (0);
+ }
+#endif
+
return (_rl_char_search (count, BFIND, FFIND));
}
@@ -1505,15 +1611,16 @@ _rl_set_mark_at_pos (position)
/* A bindable command to set the mark. */
int
-rl_set_mark (int count, int key __attribute__((unused)))
+rl_set_mark (count, key)
+ int count, key;
{
return (_rl_set_mark_at_pos (rl_explicit_arg ? count : rl_point));
}
/* Exchange the position of mark and point. */
int
-rl_exchange_point_and_mark (int count __attribute__((unused)),
- int key __attribute__((unused)))
+rl_exchange_point_and_mark (count, key)
+ int count, key;
{
if (rl_mark > rl_end)
rl_mark = -1;
diff --git a/cmd-line-utils/readline/tilde.c b/cmd-line-utils/readline/tilde.c
index 91eead0d9e2..1b76c9f2404 100644
--- a/cmd-line-utils/readline/tilde.c
+++ b/cmd-line-utils/readline/tilde.c
@@ -19,9 +19,9 @@
along with Readline; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
-#define READLINE_LIBRARY
-
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#if defined (HAVE_UNISTD_H)
# ifdef _MINIX
@@ -43,7 +43,9 @@
#endif /* HAVE_STDLIB_H */
#include <sys/types.h>
+#if defined (HAVE_PWD_H)
#include <pwd.h>
+#endif
#include "tilde.h"
@@ -54,8 +56,12 @@ static void *xmalloc (), *xrealloc ();
#endif /* TEST || STATIC_MALLOC */
#if !defined (HAVE_GETPW_DECLS)
+# if defined (HAVE_GETPWUID)
extern struct passwd *getpwuid PARAMS((uid_t));
+# endif
+# if defined (HAVE_GETPWNAM)
extern struct passwd *getpwnam PARAMS((const char *));
+# endif
#endif /* !HAVE_GETPW_DECLS */
#if !defined (savestring)
@@ -190,7 +196,7 @@ tilde_expand (string)
int result_size, result_index;
result_index = result_size = 0;
- if ((result = strchr (string, '~')))
+ if (result = strchr (string, '~'))
result = (char *)xmalloc (result_size = (strlen (string) + 16));
else
result = (char *)xmalloc (result_size = (strlen (string) + 1));
@@ -277,6 +283,39 @@ isolate_tilde_prefix (fname, lenp)
return ret;
}
+#if 0
+/* Public function to scan a string (FNAME) beginning with a tilde and find
+ the portion of the string that should be passed to the tilde expansion
+ function. Right now, it just calls tilde_find_suffix and allocates new
+ memory, but it can be expanded to do different things later. */
+char *
+tilde_find_word (fname, flags, lenp)
+ const char *fname;
+ int flags, *lenp;
+{
+ int x;
+ char *r;
+
+ x = tilde_find_suffix (fname);
+ if (x == 0)
+ {
+ r = savestring (fname);
+ if (lenp)
+ *lenp = 0;
+ }
+ else
+ {
+ r = (char *)xmalloc (1 + x);
+ strncpy (r, fname, x);
+ r[x] = '\0';
+ if (lenp)
+ *lenp = x;
+ }
+
+ return r;
+}
+#endif
+
/* Return a string that is PREFIX concatenated with SUFFIX starting at
SUFFIND. */
static char *
@@ -347,7 +386,11 @@ tilde_expand_word (filename)
/* No preexpansion hook, or the preexpansion hook failed. Look in the
password database. */
dirname = (char *)NULL;
+#if defined (HAVE_GETPWNAM)
user_entry = getpwnam (username);
+#else
+ user_entry = 0;
+#endif
if (user_entry == 0)
{
/* If the calling program has a special syntax for expanding tildes,
@@ -361,19 +404,20 @@ tilde_expand_word (filename)
free (expansion);
}
}
- free (username);
/* If we don't have a failure hook, or if the failure hook did not
expand the tilde, return a copy of what we were passed. */
if (dirname == 0)
dirname = savestring (filename);
}
+#if defined (HAVE_GETPWENT)
else
- {
- free (username);
- dirname = glue_prefix_and_suffix (user_entry->pw_dir, filename, user_len);
- }
+ dirname = glue_prefix_and_suffix (user_entry->pw_dir, filename, user_len);
+#endif
+ free (username);
+#if defined (HAVE_GETPWENT)
endpwent ();
+#endif
return (dirname);
}
diff --git a/cmd-line-utils/readline/tilde.h b/cmd-line-utils/readline/tilde.h
index f8182c999d9..c58ce20e7a2 100644
--- a/cmd-line-utils/readline/tilde.h
+++ b/cmd-line-utils/readline/tilde.h
@@ -71,6 +71,9 @@ extern char *tilde_expand PARAMS((const char *));
tilde. If there is no expansion, call tilde_expansion_failure_hook. */
extern char *tilde_expand_word PARAMS((const char *));
+/* Find the portion of the string beginning with ~ that should be expanded. */
+extern char *tilde_find_word PARAMS((const char *, int, int *));
+
#ifdef __cplusplus
}
#endif
diff --git a/cmd-line-utils/readline/undo.c b/cmd-line-utils/readline/undo.c
index 4d256f492b8..9d9bd25ba8f 100644
--- a/cmd-line-utils/readline/undo.c
+++ b/cmd-line-utils/readline/undo.c
@@ -1,7 +1,7 @@
/* readline.c -- a general facility for reading lines of input
with emacs style editing and completion. */
-/* Copyright (C) 1987, 1989, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1987, 1989, 1992, 2006 Free Software Foundation, Inc.
This file is part of the GNU Readline Library, a library for
reading lines of text with interactive input and history editing.
@@ -22,7 +22,9 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#include <sys/types.h>
@@ -48,6 +50,8 @@
#include "rlprivate.h"
#include "xmalloc.h"
+extern void replace_history_data PARAMS((int, histdata_t *, histdata_t *));
+
/* Non-zero tells rl_delete_text and rl_insert_text to not add to
the undo list. */
int _rl_doing_an_undo = 0;
@@ -64,19 +68,35 @@ UNDO_LIST *rl_undo_list = (UNDO_LIST *)NULL;
/* */
/* **************************************************************** */
-/* Remember how to undo something. Concatenate some undos if that
- seems right. */
-void
-rl_add_undo (what, start, end, text)
+static UNDO_LIST *
+alloc_undo_entry (what, start, end, text)
enum undo_code what;
int start, end;
char *text;
{
- UNDO_LIST *temp = (UNDO_LIST *)xmalloc (sizeof (UNDO_LIST));
+ UNDO_LIST *temp;
+
+ temp = (UNDO_LIST *)xmalloc (sizeof (UNDO_LIST));
temp->what = what;
temp->start = start;
temp->end = end;
temp->text = text;
+
+ temp->next = (UNDO_LIST *)NULL;
+ return temp;
+}
+
+/* Remember how to undo something. Concatenate some undos if that
+ seems right. */
+void
+rl_add_undo (what, start, end, text)
+ enum undo_code what;
+ int start, end;
+ char *text;
+{
+ UNDO_LIST *temp;
+
+ temp = alloc_undo_entry (what, start, end, text);
temp->next = rl_undo_list;
rl_undo_list = temp;
}
@@ -85,9 +105,12 @@ rl_add_undo (what, start, end, text)
void
rl_free_undo_list ()
{
+ UNDO_LIST *release, *orig_list;
+
+ orig_list = rl_undo_list;
while (rl_undo_list)
{
- UNDO_LIST *release = rl_undo_list;
+ release = rl_undo_list;
rl_undo_list = rl_undo_list->next;
if (release->what == UNDO_DELETE)
@@ -96,6 +119,43 @@ rl_free_undo_list ()
free (release);
}
rl_undo_list = (UNDO_LIST *)NULL;
+ replace_history_data (-1, (histdata_t *)orig_list, (histdata_t *)NULL);
+}
+
+UNDO_LIST *
+_rl_copy_undo_entry (entry)
+ UNDO_LIST *entry;
+{
+ UNDO_LIST *new;
+
+ new = alloc_undo_entry (entry->what, entry->start, entry->end, (char *)NULL);
+ new->text = entry->text ? savestring (entry->text) : 0;
+ return new;
+}
+
+UNDO_LIST *
+_rl_copy_undo_list (head)
+ UNDO_LIST *head;
+{
+ UNDO_LIST *list, *new, *roving, *c;
+
+ list = head;
+ new = 0;
+ while (list)
+ {
+ c = _rl_copy_undo_entry (list);
+ if (new == 0)
+ roving = new = c;
+ else
+ {
+ roving->next = c;
+ roving = roving->next;
+ }
+ list = list->next;
+ }
+
+ roving->next = 0;
+ return new;
}
/* Undo the next thing in the list. Return 0 if there
@@ -159,6 +219,8 @@ rl_do_undo ()
release = rl_undo_list;
rl_undo_list = rl_undo_list->next;
+ replace_history_data (-1, (histdata_t *)release, (histdata_t *)rl_undo_list);
+
free (release);
}
while (waiting_for_begin);
@@ -175,7 +237,7 @@ _rl_fix_last_undo_of_type (type, start, end)
for (rl = rl_undo_list; rl; rl = rl->next)
{
- if (rl->what == (unsigned int) type)
+ if (rl->what == type)
{
rl->start = start;
rl->end = end;
@@ -226,7 +288,8 @@ rl_modifying (start, end)
/* Revert the current line to its previous state. */
int
-rl_revert_line (int count __attribute__((unused)), int key __attribute__((unused)))
+rl_revert_line (count, key)
+ int count, key;
{
if (!rl_undo_list)
rl_ding ();
@@ -234,13 +297,19 @@ rl_revert_line (int count __attribute__((unused)), int key __attribute__((unuse
{
while (rl_undo_list)
rl_do_undo ();
+#if defined (VI_MODE)
+ if (rl_editing_mode == vi_mode)
+ rl_point = rl_mark = 0; /* rl_end should be set correctly */
+#endif
}
+
return 0;
}
/* Do some undoing of things that were done. */
int
-rl_undo_command (int count, int key __attribute__((unused)))
+rl_undo_command (count, key)
+ int count, key;
{
if (count < 0)
return 0; /* Nothing to do. */
diff --git a/cmd-line-utils/readline/util.c b/cmd-line-utils/readline/util.c
index d5fe51a7bf2..e44ef64349d 100644
--- a/cmd-line-utils/readline/util.c
+++ b/cmd-line-utils/readline/util.c
@@ -1,6 +1,6 @@
/* util.c -- readline utility functions */
-/* Copyright (C) 1987, 1989, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2005 Free Software Foundation, Inc.
This file is part of the GNU Readline Library, a library for
reading lines of text with interactive input and history editing.
@@ -21,7 +21,9 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#include <sys/types.h>
#include <fcntl.h>
@@ -42,6 +44,7 @@
/* System-specific feature definitions and include files. */
#include "rldefs.h"
+#include "rlmbutil.h"
#if defined (TIOCSTAT_IN_SYS_IOCTL)
# include <sys/ioctl.h>
@@ -76,13 +79,29 @@ rl_alphabetic (c)
strchr (pathname_alphabetic_chars, c) != NULL);
}
+#if defined (HANDLE_MULTIBYTE)
+int
+_rl_walphabetic (wc)
+ wchar_t wc;
+{
+ int c;
+
+ if (iswalnum (wc))
+ return (1);
+
+ c = wc & 0177;
+ return (_rl_allow_pathname_alphabetic_chars &&
+ strchr (pathname_alphabetic_chars, c) != NULL);
+}
+#endif
+
/* How to abort things. */
int
_rl_abort_internal ()
{
rl_ding ();
rl_clear_message ();
- _rl_init_argument ();
+ _rl_reset_argument ();
rl_clear_pending_input ();
RL_UNSETSTATE (RL_STATE_MACRODEF);
@@ -95,13 +114,15 @@ _rl_abort_internal ()
}
int
-rl_abort (int count __attribute__((unused)), int key __attribute__((unused)))
+rl_abort (count, key)
+ int count, key;
{
return (_rl_abort_internal ());
}
int
-rl_tty_status (int count __attribute__((unused)), int key __attribute__((unused)))
+rl_tty_status (count, key)
+ int count, key;
{
#if defined (TIOCSTAT)
ioctl (1, TIOCSTAT, (char *)0);
@@ -150,7 +171,8 @@ rl_extend_line_buffer (len)
/* A function for simple tilde expansion. */
int
-rl_tilde_expand (int ignore __attribute__((unused)), int key __attribute__((unused)))
+rl_tilde_expand (ignore, key)
+ int ignore, key;
{
register int start, end;
char *homedir, *temp;
diff --git a/cmd-line-utils/readline/vi_keymap.c b/cmd-line-utils/readline/vi_keymap.c
index 53a67c674ce..4b48c75cc5d 100644
--- a/cmd-line-utils/readline/vi_keymap.c
+++ b/cmd-line-utils/readline/vi_keymap.c
@@ -130,7 +130,7 @@ KEYMAP_ENTRY_ARRAY vi_movement_keymap = {
{ ISFUNC, rl_revert_line }, /* U */
{ ISFUNC, (rl_command_func_t *)0x0 }, /* V */
{ ISFUNC, rl_vi_next_word }, /* W */
- { ISFUNC, rl_rubout }, /* X */
+ { ISFUNC, rl_vi_rubout }, /* X */
{ ISFUNC, rl_vi_yank_to }, /* Y */
{ ISFUNC, (rl_command_func_t *)0x0 }, /* Z */
diff --git a/cmd-line-utils/readline/vi_mode.c b/cmd-line-utils/readline/vi_mode.c
index a277fe2c237..d0b7e330adc 100644
--- a/cmd-line-utils/readline/vi_mode.c
+++ b/cmd-line-utils/readline/vi_mode.c
@@ -1,7 +1,7 @@
/* vi_mode.c -- A vi emulation mode for Bash.
Derived from code written by Jeff Sparkes (jsparkes@bnr.ca). */
-/* Copyright (C) 1987-2004 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2005 Free Software Foundation, Inc.
This file is part of the GNU Readline Library, a library for
reading lines of text with interactive input and history editing.
@@ -31,7 +31,9 @@
#if defined (VI_MODE)
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+# include <config.h>
+#endif
#include <sys/types.h>
@@ -88,6 +90,7 @@ static int _rl_vi_last_arg_sign = 1;
static int _rl_vi_last_motion;
#if defined (HANDLE_MULTIBYTE)
static char _rl_vi_last_search_mbchar[MB_LEN_MAX];
+static int _rl_vi_last_search_mblen;
#else
static int _rl_vi_last_search_char;
#endif
@@ -105,15 +108,35 @@ static int vi_mark_chars['z' - 'a' + 1];
static void _rl_vi_stuff_insert PARAMS((int));
static void _rl_vi_save_insert PARAMS((UNDO_LIST *));
+
+static void _rl_vi_backup PARAMS((void));
+
+static int _rl_vi_arg_dispatch PARAMS((int));
static int rl_digit_loop1 PARAMS((void));
+static int _rl_vi_set_mark PARAMS((void));
+static int _rl_vi_goto_mark PARAMS((void));
+
+static void _rl_vi_append_forward PARAMS((int));
+
+static int _rl_vi_callback_getchar PARAMS((char *, int));
+
+#if defined (READLINE_CALLBACKS)
+static int _rl_vi_callback_set_mark PARAMS((_rl_callback_generic_arg *));
+static int _rl_vi_callback_goto_mark PARAMS((_rl_callback_generic_arg *));
+static int _rl_vi_callback_change_char PARAMS((_rl_callback_generic_arg *));
+static int _rl_vi_callback_char_search PARAMS((_rl_callback_generic_arg *));
+#endif
+
void
_rl_vi_initialize_line ()
{
register int i;
- for (i = 0; i < (int) (sizeof (vi_mark_chars) / sizeof (int)); i++)
+ for (i = 0; i < sizeof (vi_mark_chars) / sizeof (int); i++)
vi_mark_chars[i] = -1;
+
+ RL_UNSETSTATE(RL_STATE_VICMDONCE);
}
void
@@ -166,7 +189,8 @@ _rl_vi_stuff_insert (count)
redo a text modification command. The default for _rl_vi_last_command
puts you back into insert mode. */
int
-rl_vi_redo (int count, int c __attribute__((unused)))
+rl_vi_redo (count, c)
+ int count, c;
{
int r;
@@ -185,7 +209,16 @@ rl_vi_redo (int count, int c __attribute__((unused)))
_rl_vi_stuff_insert (count);
/* And back up point over the last character inserted. */
if (rl_point > 0)
- rl_point--;
+ _rl_vi_backup ();
+ }
+ /* Ditto for redoing an insert with `a', but move forward a character first
+ like the `a' command does. */
+ else if (_rl_vi_last_command == 'a' && vi_insert_buffer && *vi_insert_buffer)
+ {
+ _rl_vi_append_forward ('a');
+ _rl_vi_stuff_insert (count);
+ if (rl_point > 0)
+ _rl_vi_backup ();
}
else
r = _rl_dispatch (_rl_vi_last_command, _rl_keymap);
@@ -204,7 +237,8 @@ rl_vi_undo (count, key)
/* Yank the nth arg from the previous line into this line at point. */
int
-rl_vi_yank_arg (int count, int key __attribute__((unused)))
+rl_vi_yank_arg (count, key)
+ int count, key;
{
/* Readline thinks that the first word on a line is the 0th, while vi
thinks the first word on a line is the 1st. Compensate. */
@@ -268,10 +302,12 @@ rl_vi_search (count, key)
switch (key)
{
case '?':
+ _rl_free_saved_history_line ();
rl_noninc_forward_search (count, key);
break;
case '/':
+ _rl_free_saved_history_line ();
rl_noninc_reverse_search (count, key);
break;
@@ -284,7 +320,8 @@ rl_vi_search (count, key)
/* Completion, from vi's point of view. */
int
-rl_vi_complete (int ignore __attribute__((unused)), int key)
+rl_vi_complete (ignore, key)
+ int ignore, key;
{
if ((rl_point < rl_end) && (!whitespace (rl_line_buffer[rl_point])))
{
@@ -310,7 +347,8 @@ rl_vi_complete (int ignore __attribute__((unused)), int key)
/* Tilde expansion for vi mode. */
int
-rl_vi_tilde_expand (int ignore __attribute__((unused)), int key)
+rl_vi_tilde_expand (ignore, key)
+ int ignore, key;
{
rl_tilde_expand (0, key);
rl_vi_start_inserting (key, 1, rl_arg_sign);
@@ -380,7 +418,8 @@ rl_vi_end_word (count, key)
/* Move forward a word the way that 'W' does. */
int
-rl_vi_fWord (int count, int ignore __attribute__((unused)))
+rl_vi_fWord (count, ignore)
+ int count, ignore;
{
while (count-- && rl_point < (rl_end - 1))
{
@@ -396,7 +435,8 @@ rl_vi_fWord (int count, int ignore __attribute__((unused)))
}
int
-rl_vi_bWord (int count, int ignore __attribute__((unused)))
+rl_vi_bWord (count, ignore)
+ int count, ignore;
{
while (count-- && rl_point > 0)
{
@@ -419,7 +459,8 @@ rl_vi_bWord (int count, int ignore __attribute__((unused)))
}
int
-rl_vi_eWord(int count, int ignore __attribute__((unused)))
+rl_vi_eWord (count, ignore)
+ int count, ignore;
{
while (count-- && rl_point < (rl_end - 1))
{
@@ -449,7 +490,8 @@ rl_vi_eWord(int count, int ignore __attribute__((unused)))
}
int
-rl_vi_fword (int count, int ignore __attribute__((unused)))
+rl_vi_fword (count, ignore)
+ int count, ignore;
{
while (count-- && rl_point < (rl_end - 1))
{
@@ -474,7 +516,8 @@ rl_vi_fword (int count, int ignore __attribute__((unused)))
}
int
-rl_vi_bword (int count, int ignore __attribute__((unused)))
+rl_vi_bword (count, ignore)
+ int count, ignore;
{
while (count-- && rl_point > 0)
{
@@ -512,7 +555,8 @@ rl_vi_bword (int count, int ignore __attribute__((unused)))
}
int
-rl_vi_eword (int count, int ignore __attribute__((unused)))
+rl_vi_eword (count, ignore)
+ int count, ignore;
{
while (count-- && rl_point < rl_end - 1)
{
@@ -536,34 +580,46 @@ rl_vi_eword (int count, int ignore __attribute__((unused)))
}
int
-rl_vi_insert_beg (int count __attribute__((unused)), int key)
+rl_vi_insert_beg (count, key)
+ int count, key;
{
rl_beg_of_line (1, key);
rl_vi_insertion_mode (1, key);
return (0);
}
-int
-rl_vi_append_mode (int count __attribute__((unused)), int key)
+static void
+_rl_vi_append_forward (key)
+ int key;
{
+ int point;
+
if (rl_point < rl_end)
{
if (MB_CUR_MAX == 1 || rl_byte_oriented)
rl_point++;
else
{
- int point = rl_point;
+ point = rl_point;
rl_forward_char (1, key);
if (point == rl_point)
rl_point = rl_end;
}
}
- rl_vi_insertion_mode (1, key);
+}
+
+int
+rl_vi_append_mode (count, key)
+ int count, key;
+{
+ _rl_vi_append_forward (key);
+ rl_vi_start_inserting (key, 1, rl_arg_sign);
return (0);
}
int
-rl_vi_append_eol (int count __attribute__((unused)), int key)
+rl_vi_append_eol (count, key)
+ int count, key;
{
rl_end_of_line (1, key);
rl_vi_append_mode (1, key);
@@ -572,7 +628,8 @@ rl_vi_append_eol (int count __attribute__((unused)), int key)
/* What to do in the case of C-d. */
int
-rl_vi_eof_maybe (int count __attribute__((unused)), int c __attribute__((unused)))
+rl_vi_eof_maybe (count, c)
+ int count, c;
{
return (rl_newline (1, '\n'));
}
@@ -582,7 +639,8 @@ rl_vi_eof_maybe (int count __attribute__((unused)), int c __attribute__((unused)
/* Switching from one mode to the other really just involves
switching keymaps. */
int
-rl_vi_insertion_mode (int count __attribute__((unused)), int key)
+rl_vi_insertion_mode (count, key)
+ int count, key;
{
_rl_keymap = vi_insertion_keymap;
_rl_vi_last_key_before_insert = key;
@@ -595,7 +653,7 @@ _rl_vi_save_insert (up)
{
int len, start, end;
- if (up == 0)
+ if (up == 0 || up->what != UNDO_INSERT)
{
if (vi_insert_buffer_size >= 1)
vi_insert_buffer[0] = '\0';
@@ -644,13 +702,21 @@ _rl_vi_done_inserting ()
}
int
-rl_vi_movement_mode (int count __attribute__((unused)), int key)
+rl_vi_movement_mode (count, key)
+ int count, key;
{
if (rl_point > 0)
rl_backward_char (1, key);
_rl_keymap = vi_movement_keymap;
_rl_vi_done_inserting ();
+
+ /* This is how POSIX.2 says `U' should behave -- everything up until the
+ first time you go into command mode should not be undone. */
+ if (RL_ISSTATE (RL_STATE_VICMDONCE) == 0)
+ rl_free_undo_list ();
+
+ RL_SETSTATE (RL_STATE_VICMDONCE);
return (0);
}
@@ -672,7 +738,7 @@ _rl_vi_change_mbchar_case (count)
{
wchar_t wc;
char mb[MB_LEN_MAX+1];
- int local_mblen;
+ int mlen, p;
mbstate_t ps;
memset (&ps, 0, sizeof (mbstate_t));
@@ -695,11 +761,14 @@ _rl_vi_change_mbchar_case (count)
/* Vi is kind of strange here. */
if (wc)
{
- local_mblen = wcrtomb (mb, wc, &ps);
- if (local_mblen >= 0)
- mb[local_mblen] = '\0';
+ p = rl_point;
+ mlen = wcrtomb (mb, wc, &ps);
+ if (mlen >= 0)
+ mb[mlen] = '\0';
rl_begin_undo_group ();
- rl_delete (1, 0);
+ rl_vi_delete (1, 0);
+ if (rl_point < p) /* Did we retreat at EOL? */
+ rl_point++; /* XXX - should we advance more than 1 for mbchar? */
rl_insert_text (mb);
rl_end_undo_group ();
rl_vi_check ();
@@ -713,7 +782,8 @@ _rl_vi_change_mbchar_case (count)
#endif
int
-rl_vi_change_case (int count, int ignore __attribute__((unused)))
+rl_vi_change_case (count, ignore)
+ int count, ignore;
{
int c, p;
@@ -772,6 +842,15 @@ rl_vi_put (count, key)
return (0);
}
+static void
+_rl_vi_backup ()
+{
+ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
+ rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_NONZERO);
+ else
+ rl_point--;
+}
+
int
rl_vi_check ()
{
@@ -816,7 +895,9 @@ rl_vi_domove (key, nextkey)
save = rl_numeric_arg;
rl_numeric_arg = _rl_digit_value (c);
rl_explicit_arg = 1;
+ RL_SETSTATE (RL_STATE_NUMERICARG|RL_STATE_VIMOTION);
rl_digit_loop1 ();
+ RL_UNSETSTATE (RL_STATE_VIMOTION);
rl_numeric_arg *= save;
RL_SETSTATE(RL_STATE_MOREINPUT);
c = rl_read_key (); /* real command */
@@ -889,52 +970,59 @@ rl_vi_domove (key, nextkey)
return (0);
}
+/* Process C as part of the current numeric argument. Return -1 if the
+ argument should be aborted, 0 if we should not read any more chars, and
+ 1 if we should continue to read chars. */
+static int
+_rl_vi_arg_dispatch (c)
+ int c;
+{
+ int key;
+
+ key = c;
+ if (c >= 0 && _rl_keymap[c].type == ISFUNC && _rl_keymap[c].function == rl_universal_argument)
+ {
+ rl_numeric_arg *= 4;
+ return 1;
+ }
+
+ c = UNMETA (c);
+
+ if (_rl_digit_p (c))
+ {
+ if (rl_explicit_arg)
+ rl_numeric_arg = (rl_numeric_arg * 10) + _rl_digit_value (c);
+ else
+ rl_numeric_arg = _rl_digit_value (c);
+ rl_explicit_arg = 1;
+ return 1;
+ }
+ else
+ {
+ rl_clear_message ();
+ rl_stuff_char (key);
+ return 0;
+ }
+}
+
/* A simplified loop for vi. Don't dispatch key at end.
Don't recognize minus sign?
Should this do rl_save_prompt/rl_restore_prompt? */
static int
rl_digit_loop1 ()
{
- int key, c;
+ int c, r;
- RL_SETSTATE(RL_STATE_NUMERICARG);
while (1)
{
- if (rl_numeric_arg > 1000000)
- {
- rl_explicit_arg = rl_numeric_arg = 0;
- rl_ding ();
- rl_clear_message ();
- RL_UNSETSTATE(RL_STATE_NUMERICARG);
- return 1;
- }
- rl_message ("(arg: %d) ", rl_arg_sign * rl_numeric_arg);
- RL_SETSTATE(RL_STATE_MOREINPUT);
- key = c = rl_read_key ();
- RL_UNSETSTATE(RL_STATE_MOREINPUT);
+ if (_rl_arg_overflow ())
+ return 1;
- if (c >= 0 && _rl_keymap[c].type == ISFUNC &&
- _rl_keymap[c].function == rl_universal_argument)
- {
- rl_numeric_arg *= 4;
- continue;
- }
+ c = _rl_arg_getchar ();
- c = UNMETA (c);
- if (_rl_digit_p (c))
- {
- if (rl_explicit_arg)
- rl_numeric_arg = (rl_numeric_arg * 10) + _rl_digit_value (c);
- else
- rl_numeric_arg = _rl_digit_value (c);
- rl_explicit_arg = 1;
- }
- else
- {
- rl_clear_message ();
- rl_stuff_char (key);
- break;
- }
+ r = _rl_vi_arg_dispatch (c);
+ if (r <= 0)
+ break;
}
RL_UNSETSTATE(RL_STATE_NUMERICARG);
@@ -942,7 +1030,8 @@ rl_digit_loop1 ()
}
int
-rl_vi_delete_to (int count __attribute__((unused)), int key)
+rl_vi_delete_to (count, key)
+ int count, key;
{
int c;
@@ -967,7 +1056,8 @@ rl_vi_delete_to (int count __attribute__((unused)), int key)
}
int
-rl_vi_change_to (int count __attribute__((unused)), int key)
+rl_vi_change_to (count, key)
+ int count, key;
{
int c, start_pos;
@@ -1019,10 +1109,12 @@ rl_vi_change_to (int count __attribute__((unused)), int key)
}
int
-rl_vi_yank_to (int count __attribute__((unused)), int key)
+rl_vi_yank_to (count, key)
+ int count, key;
{
- int c, save = rl_point;
+ int c, save;
+ save = rl_point;
if (_rl_uppercase_p (key))
rl_stuff_char ('$');
@@ -1047,11 +1139,45 @@ rl_vi_yank_to (int count __attribute__((unused)), int key)
}
int
+rl_vi_rubout (count, key)
+ int count, key;
+{
+ int opoint;
+
+ if (count < 0)
+ return (rl_vi_delete (-count, key));
+
+ if (rl_point == 0)
+ {
+ rl_ding ();
+ return -1;
+ }
+
+ opoint = rl_point;
+ if (count > 1 && MB_CUR_MAX > 1 && rl_byte_oriented == 0)
+ rl_backward_char (count, key);
+ else if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
+ rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_NONZERO);
+ else
+ rl_point -= count;
+
+ if (rl_point < 0)
+ rl_point = 0;
+
+ rl_kill_text (rl_point, opoint);
+
+ return (0);
+}
+
+int
rl_vi_delete (count, key)
int count, key;
{
int end;
+ if (count < 0)
+ return (rl_vi_rubout (-count, key));
+
if (rl_end == 0)
{
rl_ding ();
@@ -1070,11 +1196,13 @@ rl_vi_delete (count, key)
if (rl_point > 0 && rl_point == rl_end)
rl_backward_char (1, key);
+
return (0);
}
int
-rl_vi_back_to_indent (int count __attribute__((unused)), int key)
+rl_vi_back_to_indent (count, key)
+ int count, key;
{
rl_beg_of_line (1, key);
while (rl_point < rl_end && whitespace (rl_line_buffer[rl_point]))
@@ -1083,75 +1211,115 @@ rl_vi_back_to_indent (int count __attribute__((unused)), int key)
}
int
-rl_vi_first_print (int count __attribute__((unused)), int key)
+rl_vi_first_print (count, key)
+ int count, key;
{
return (rl_vi_back_to_indent (1, key));
}
+static int _rl_cs_dir, _rl_cs_orig_dir;
+
+#if defined (READLINE_CALLBACKS)
+static int
+_rl_vi_callback_char_search (data)
+ _rl_callback_generic_arg *data;
+{
+#if defined (HANDLE_MULTIBYTE)
+ _rl_vi_last_search_mblen = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX);
+#else
+ RL_SETSTATE(RL_STATE_MOREINPUT);
+ _rl_vi_last_search_char = rl_read_key ();
+ RL_UNSETSTATE(RL_STATE_MOREINPUT);
+#endif
+
+ _rl_callback_func = 0;
+ _rl_want_redisplay = 1;
+
+#if defined (HANDLE_MULTIBYTE)
+ return (_rl_char_search_internal (data->count, _rl_cs_dir, _rl_vi_last_search_mbchar, _rl_vi_last_search_mblen));
+#else
+ return (_rl_char_search_internal (data->count, _rl_cs_dir, _rl_vi_last_search_char));
+#endif
+}
+#endif
+
int
rl_vi_char_search (count, key)
int count, key;
{
#if defined (HANDLE_MULTIBYTE)
static char *target;
- static int mb_len;
+ static int tlen;
#else
static char target;
#endif
- static int orig_dir, dir;
if (key == ';' || key == ',')
- dir = key == ';' ? orig_dir : -orig_dir;
+ _rl_cs_dir = (key == ';') ? _rl_cs_orig_dir : -_rl_cs_orig_dir;
else
{
- if (vi_redoing)
-#if defined (HANDLE_MULTIBYTE)
- target = _rl_vi_last_search_mbchar;
-#else
- target = _rl_vi_last_search_char;
-#endif
- else
- {
-#if defined (HANDLE_MULTIBYTE)
- mb_len = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX);
- target = _rl_vi_last_search_mbchar;
-#else
- RL_SETSTATE(RL_STATE_MOREINPUT);
- _rl_vi_last_search_char = target = rl_read_key ();
- RL_UNSETSTATE(RL_STATE_MOREINPUT);
-#endif
- }
-
switch (key)
{
case 't':
- orig_dir = dir = FTO;
+ _rl_cs_orig_dir = _rl_cs_dir = FTO;
break;
case 'T':
- orig_dir = dir = BTO;
+ _rl_cs_orig_dir = _rl_cs_dir = BTO;
break;
case 'f':
- orig_dir = dir = FFIND;
+ _rl_cs_orig_dir = _rl_cs_dir = FFIND;
break;
case 'F':
- orig_dir = dir = BFIND;
+ _rl_cs_orig_dir = _rl_cs_dir = BFIND;
break;
}
+
+ if (vi_redoing)
+ {
+ /* set target and tlen below */
+ }
+#if defined (READLINE_CALLBACKS)
+ else if (RL_ISSTATE (RL_STATE_CALLBACK))
+ {
+ _rl_callback_data = _rl_callback_data_alloc (count);
+ _rl_callback_data->i1 = _rl_cs_dir;
+ _rl_callback_func = _rl_vi_callback_char_search;
+ return (0);
+ }
+#endif
+ else
+ {
+#if defined (HANDLE_MULTIBYTE)
+ _rl_vi_last_search_mblen = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX);
+#else
+ RL_SETSTATE(RL_STATE_MOREINPUT);
+ _rl_vi_last_search_char = rl_read_key ();
+ RL_UNSETSTATE(RL_STATE_MOREINPUT);
+#endif
+ }
}
#if defined (HANDLE_MULTIBYTE)
- return (_rl_char_search_internal (count, dir, target, mb_len));
+ target = _rl_vi_last_search_mbchar;
+ tlen = _rl_vi_last_search_mblen;
+#else
+ target = _rl_vi_last_search_char;
+#endif
+
+#if defined (HANDLE_MULTIBYTE)
+ return (_rl_char_search_internal (count, _rl_cs_dir, target, tlen));
#else
- return (_rl_char_search_internal (count, dir, target));
+ return (_rl_char_search_internal (count, _rl_cs_dir, target));
#endif
}
/* Match brackets */
int
-rl_vi_match (int ignore __attribute__((unused)), int key)
+rl_vi_match (ignore, key)
+ int ignore, key;
{
int count = 1, brack, pos, tmp, pre;
@@ -1255,24 +1423,12 @@ rl_vi_bracktype (c)
}
}
-/* XXX - think about reading an entire mbchar with _rl_read_mbchar and
- inserting it in one bunch instead of the loop below (like in
- rl_vi_char_search or _rl_vi_change_mbchar_case). Set c to mbchar[0]
- for test against 033 or ^C. Make sure that _rl_read_mbchar does
- this right. */
-int
-rl_vi_change_char (int count, int key __attribute__((unused)))
+static int
+_rl_vi_change_char (count, c, mb)
+ int count, c;
+ char *mb;
{
- int c, p;
-
- if (vi_redoing)
- c = _rl_vi_last_replacement;
- else
- {
- RL_SETSTATE(RL_STATE_MOREINPUT);
- _rl_vi_last_replacement = c = rl_read_key ();
- RL_UNSETSTATE(RL_STATE_MOREINPUT);
- }
+ int p;
if (c == '\033' || c == CTRL ('C'))
return -1;
@@ -1282,27 +1438,87 @@ rl_vi_change_char (int count, int key __attribute__((unused)))
{
p = rl_point;
rl_vi_delete (1, c);
+ if (rl_point < p) /* Did we retreat at EOL? */
+ rl_point++;
#if defined (HANDLE_MULTIBYTE)
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
- while (_rl_insert_char (1, c))
- {
- RL_SETSTATE (RL_STATE_MOREINPUT);
- c = rl_read_key ();
- RL_UNSETSTATE (RL_STATE_MOREINPUT);
- }
+ rl_insert_text (mb);
else
#endif
- {
- if (rl_point < p) /* Did we retreat at EOL? */
- rl_point++;
- _rl_insert_char (1, c);
- }
+ _rl_insert_char (1, c);
}
+
+ /* The cursor shall be left on the last character changed. */
+ rl_backward_char (1, c);
+
rl_end_undo_group ();
return (0);
}
+static int
+_rl_vi_callback_getchar (mb, mlen)
+ char *mb;
+ int mlen;
+{
+ int c;
+
+ RL_SETSTATE(RL_STATE_MOREINPUT);
+ c = rl_read_key ();
+ RL_UNSETSTATE(RL_STATE_MOREINPUT);
+
+#if defined (HANDLE_MULTIBYTE)
+ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
+ c = _rl_read_mbstring (c, mb, mlen);
+#endif
+
+ return c;
+}
+
+#if defined (READLINE_CALLBACKS)
+static int
+_rl_vi_callback_change_char (data)
+ _rl_callback_generic_arg *data;
+{
+ int c;
+ char mb[MB_LEN_MAX];
+
+ _rl_vi_last_replacement = c = _rl_vi_callback_getchar (mb, MB_LEN_MAX);
+
+ _rl_callback_func = 0;
+ _rl_want_redisplay = 1;
+
+ return (_rl_vi_change_char (data->count, c, mb));
+}
+#endif
+
+int
+rl_vi_change_char (count, key)
+ int count, key;
+{
+ int c;
+ char mb[MB_LEN_MAX];
+
+ if (vi_redoing)
+ {
+ c = _rl_vi_last_replacement;
+ mb[0] = c;
+ mb[1] = '\0';
+ }
+#if defined (READLINE_CALLBACKS)
+ else if (RL_ISSTATE (RL_STATE_CALLBACK))
+ {
+ _rl_callback_data = _rl_callback_data_alloc (count);
+ _rl_callback_func = _rl_vi_callback_change_char;
+ return (0);
+ }
+#endif
+ else
+ _rl_vi_last_replacement = c = _rl_vi_callback_getchar (mb, MB_LEN_MAX);
+
+ return (_rl_vi_change_char (count, c, mb));
+}
+
int
rl_vi_subst (count, key)
int count, key;
@@ -1365,7 +1581,8 @@ rl_vi_overstrike_delete (count, key)
}
int
-rl_vi_replace (int count __attribute__((unused)), int key __attribute__((unused)))
+rl_vi_replace (count, key)
+ int count, key;
{
int i;
@@ -1424,8 +1641,8 @@ rl_vi_possible_completions()
#endif
/* Functions to save and restore marks. */
-int
-rl_vi_set_mark (int count __attribute__((unused)), int key __attribute__((unused)))
+static int
+_rl_vi_set_mark ()
{
int ch;
@@ -1443,8 +1660,36 @@ rl_vi_set_mark (int count __attribute__((unused)), int key __attribute__((unused
return 0;
}
+#if defined (READLINE_CALLBACKS)
+static int
+_rl_vi_callback_set_mark (data)
+ _rl_callback_generic_arg *data;
+{
+ _rl_callback_func = 0;
+ _rl_want_redisplay = 1;
+
+ return (_rl_vi_set_mark ());
+}
+#endif
+
int
-rl_vi_goto_mark (int count __attribute__((unused)), int key __attribute__((unused)))
+rl_vi_set_mark (count, key)
+ int count, key;
+{
+#if defined (READLINE_CALLBACKS)
+ if (RL_ISSTATE (RL_STATE_CALLBACK))
+ {
+ _rl_callback_data = 0;
+ _rl_callback_func = _rl_vi_callback_set_mark;
+ return (0);
+ }
+#endif
+
+ return (_rl_vi_set_mark ());
+}
+
+static int
+_rl_vi_goto_mark ()
{
int ch;
@@ -1473,4 +1718,31 @@ rl_vi_goto_mark (int count __attribute__((unused)), int key __attribute__((unuse
return 0;
}
+#if defined (READLINE_CALLBACKS)
+static int
+_rl_vi_callback_goto_mark (data)
+ _rl_callback_generic_arg *data;
+{
+ _rl_callback_func = 0;
+ _rl_want_redisplay = 1;
+
+ return (_rl_vi_goto_mark ());
+}
+#endif
+
+int
+rl_vi_goto_mark (count, key)
+ int count, key;
+{
+#if defined (READLINE_CALLBACKS)
+ if (RL_ISSTATE (RL_STATE_CALLBACK))
+ {
+ _rl_callback_data = 0;
+ _rl_callback_func = _rl_vi_callback_goto_mark;
+ return (0);
+ }
+#endif
+
+ return (_rl_vi_goto_mark ());
+}
#endif /* VI_MODE */
diff --git a/cmd-line-utils/readline/xmalloc.c b/cmd-line-utils/readline/xmalloc.c
index 497936d3b43..8985d340d39 100644
--- a/cmd-line-utils/readline/xmalloc.c
+++ b/cmd-line-utils/readline/xmalloc.c
@@ -20,7 +20,9 @@
Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#include "config_readline.h"
+#if defined (HAVE_CONFIG_H)
+#include <config.h>
+#endif
#include <stdio.h>
@@ -39,7 +41,8 @@
/* **************************************************************** */
static void
-memory_error_and_abort(const char *fname)
+memory_error_and_abort (fname)
+ char *fname;
{
fprintf (stderr, "%s: out of virtual memory\n", fname);
exit (2);
@@ -56,7 +59,7 @@ xmalloc (bytes)
temp = malloc (bytes);
if (temp == 0)
- memory_error_and_abort("xmalloc");
+ memory_error_and_abort ("xmalloc");
return (temp);
}
@@ -70,7 +73,7 @@ xrealloc (pointer, bytes)
temp = pointer ? realloc (pointer, bytes) : malloc (bytes);
if (temp == 0)
- memory_error_and_abort("xrealloc");
+ memory_error_and_abort ("xrealloc");
return (temp);
}
diff --git a/config/ac-macros/large_file.m4 b/config/ac-macros/large_file.m4
index 2639cec5fb7..279ce6d60f1 100644
--- a/config/ac-macros/large_file.m4
+++ b/config/ac-macros/large_file.m4
@@ -128,8 +128,15 @@ AC_DEFUN([MYSQL_SYS_LARGEFILE],
ac_cv_sys_largefile_source=1 ;;
esac])
- # AIX 4.2 and later -- do nothing, include standards.h instead.
- # this goes for both GNU and IBM C and C++ compilers.
+ AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES,
+ ac_cv_sys_large_files,
+ [Large files support on AIX-style hosts.],
+ [case "$host_os" in
+ # Large file support on AIX is available starting from version 4.2
+ # Tested only on 5.2 and up
+ aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*)
+ ac_cv_sys_large_files=1 ;;
+ esac])
fi
])
diff --git a/configure.in b/configure.in
index 000bc69a967..5a9abece11d 100644
--- a/configure.in
+++ b/configure.in
@@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc)
AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line!
# remember to also change ndb version below and update version.c in ndb
-AM_INIT_AUTOMAKE(mysql, 5.0.51)
+AM_INIT_AUTOMAKE(mysql, 5.0.55)
AM_CONFIG_HEADER([include/config.h:config.h.in])
PROTOCOL_VERSION=10
@@ -23,7 +23,7 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0
# ndb version
NDB_VERSION_MAJOR=5
NDB_VERSION_MINOR=0
-NDB_VERSION_BUILD=51
+NDB_VERSION_BUILD=55
NDB_VERSION_STATUS=""
# Set all version vars based on $VERSION. How do we do this more elegant ?
@@ -124,6 +124,8 @@ case $MACHINE_TYPE in
esac
# Save some variables and the command line options for mysqlbug
+SAVE_CC="$CC"
+SAVE_CXX="$CXX"
SAVE_ASFLAGS="$ASFLAGS"
SAVE_CFLAGS="$CFLAGS"
SAVE_CXXFLAGS="$CXXFLAGS"
@@ -131,6 +133,8 @@ SAVE_LDFLAGS="$LDFLAGS"
SAVE_CXXLDFLAGS="$CXXLDFLAGS"
CONF_COMMAND="$0 $ac_configure_args"
AC_SUBST(CONF_COMMAND)
+AC_SUBST(SAVE_CC)
+AC_SUBST(SAVE_CXX)
AC_SUBST(SAVE_ASFLAGS)
AC_SUBST(SAVE_CFLAGS)
AC_SUBST(SAVE_CXXFLAGS)
@@ -373,6 +377,7 @@ AC_SUBST(CC)
AC_SUBST(CFLAGS)
AC_SUBST(CXX)
AC_SUBST(CXXFLAGS)
+AC_SUBST(ASFLAGS)
AC_SUBST(LD)
AC_SUBST(INSTALL_SCRIPT)
@@ -631,7 +636,7 @@ AC_SUBST(NOINST_LDFLAGS)
if test "$TARGET_LINUX" = "true" -a "$static_nss" = ""
then
- tmp=`nm /usr/lib/libc.a | grep _nss_files_getaliasent_r`
+ tmp=`nm /usr/lib*/libc.a | grep _nss_files_getaliasent_r`
if test -n "$tmp"
then
STATIC_NSS_FLAGS="-lc -lnss_files -lnss_dns -lresolv"
@@ -732,7 +737,34 @@ AC_ARG_WITH(tcp-port,
[ --with-tcp-port=port-number
Which port to use for MySQL services (default 3306)],
[ MYSQL_TCP_PORT=$withval ],
- [ MYSQL_TCP_PORT=$MYSQL_TCP_PORT_DEFAULT ]
+ [ MYSQL_TCP_PORT=$MYSQL_TCP_PORT_DEFAULT
+ # if we actually defaulted (as opposed to the pathological case of
+ # --with-tcp-port=<MYSQL_TCP_PORT_DEFAULT> which might in theory
+ # happen if whole batch of servers was built from a script), set
+ # the default to zero to indicate that; we don't lose information
+ # that way, because 0 obviously indicates that we can get the
+ # default value from MYSQL_TCP_PORT. this seems really evil, but
+ # testing for MYSQL_TCP_PORT==MYSQL_TCP_PORT_DEFAULT would make a
+ # a port of MYSQL_TCP_PORT_DEFAULT magic even if the builder did not
+ # intend it to mean "use the default, in fact, look up a good default
+ # from /etc/services if you can", but really, really meant 3306 when
+ # they passed in 3306. When they pass in a specific value, let them
+ # have it; don't second guess user and think we know better, this will
+ # just make people cross. this makes the the logic work like this
+ # (which is complicated enough):
+ #
+ # - if a port was set during build, use that as a default.
+ #
+ # - otherwise, try to look up a port in /etc/services; if that fails,
+ # use MYSQL_TCP_PORT_DEFAULT (at the time of this writing 3306)
+ #
+ # - allow the MYSQL_TCP_PORT environment variable to override that.
+ #
+ # - allow command-line parameters to override all of the above.
+ #
+ # the top-most MYSQL_TCP_PORT_DEFAULT is read from win/configure.js,
+ # so don't mess with that.
+ MYSQL_TCP_PORT_DEFAULT=0 ]
)
AC_SUBST(MYSQL_TCP_PORT)
# We might want to document the assigned port in the manual.
@@ -3002,7 +3034,6 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
cmd-line-utils/libedit/Makefile dnl
win/Makefile dnl
zlib/Makefile dnl
- debian/Makefile debian/defs.mk debian/control dnl
cmd-line-utils/readline/Makefile)
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
AC_OUTPUT
diff --git a/debian/Makefile.am b/debian/Makefile.am
deleted file mode 100644
index 14035865371..00000000000
--- a/debian/Makefile.am
+++ /dev/null
@@ -1,118 +0,0 @@
-# Copyright (C) 2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-## Process this file with automake to create Makefile.in
-EXTRA_DIST = \
- mysql-test-BASE.files.in \
- libndbclientNLIB-dev.files.in \
- mysql-server-BASE.config.in \
- libndbclientNLIB.README.Debian.in \
- mysql-server-BASE.postrm.in \
- mysql-server-BASE.NEWS.in \
- libndbclientNLIB.postinst.in \
- mysql-server-BASE.links.in \
- libndbclientNLIB.files.in \
- source.lintian-overrides.in \
- mysql-server-BASE.docs.in \
- libmysqlclientSLIBoff.files.in \
- mysql-server-BASE.files.in \
- libndbclientNLIB-dev.links.in \
- libmysqlclientSLIBoff.postinst.in \
- mysql-extra-BASE.dirs.in \
- libmysqlclientSLIB-dev.links.in \
- mysql-server-BASE.dirs.in \
- libmysqlclientSLIB-dev.examples.in \
- mysql-client-BASE.lintian-overrides.in \
- copyright.more \
- libndbclientNLIB-dev.dirs.in \
- mysql-server-BASE.README.Debian.in \
- libmysqlclientSLIBoff.docs.in \
- compat \
- mysql-test-BASE.dirs.in \
- libmysqlclientSLIB-dev.files.in \
- libmysqlclientSLIBoff.dirs.in \
- mysql-server-BASE.logcheck.ignore.server.in \
- mysql-storage-BASE.mysql-storage.init.in \
- libmysqlclientSLIBoff.README.Debian.in \
- mysql-client-BASE.README.Debian.in \
- Makefile.am \
- mysql-server-BASE.prerm.in \
- mysql-common.dirs.in \
- defs.mk \
- defs.mk.in \
- mysql-server-BASE.mysql-server.logrotate.in \
- mysql-common.README.Debian.in \
- copyright \
- mysql-storage-BASE.dirs.in \
- mysql-common.preinst.in \
- mysql-client-BASE.files.in \
- mysql-server-BASE.templates.in \
- mysql-tools-BASE.dirs.in \
- mysql-management-BASE.mysql-management.init.in \
- watch \
- mysql-common.postrm.in \
- mysql-server-BASE.preinst.in \
- README.Maintainer \
- mysql-tools-BASE.files.in \
- mysql-client-BASE.NEWS.in \
- mysql-server-BASE.lintian-overrides.in \
- changelog \
- mysql-server-BASE.logcheck.ignore.paranoid.in \
- mysql-common.files.in \
- mysql-server-BASE.logcheck.ignore.workstation.in \
- mysql-extra-BASE.files.in \
- mysql-management-BASE.files.in \
- mysql-client-BASE.docs.in \
- libmysqlclientSLIB-dev.README.Maintainer.in \
- mysql-storage-BASE.files.in \
- additions \
- additions/ndb_mgmd.cnf \
- additions/mysql-server.lintian-overrides \
- additions/my.cnf \
- mysql-server-BASE.postinst.in \
- libndbclientNLIB.dirs.in \
- po \
- po/fr.po \
- po/sv.po \
- po/da.po \
- po/es.po \
- po/ja.po \
- po/tr.po \
- po/nb.po \
- po/POTFILES.in.in \
- po/cs.po \
- po/pt.po \
- po/gl.po \
- po/pt_BR.po \
- po/nl.po \
- po/templates.pot \
- po/de.po \
- po/eu.po \
- po/ro.po \
- po/ru.po \
- po/it.po \
- po/ca.po \
- mysql-client-BASE.dirs.in \
- control.in \
- libmysqlclientSLIB-dev.dirs.in \
- mysql-server-PREV.preinst.in \
- mysql-server.preinst.in \
- mysql-management-BASE.dirs.in \
- rules \
- libmysqlclientSLIB-dev.docs.in
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
diff --git a/debian/README.Maintainer b/debian/README.Maintainer
deleted file mode 100644
index 80b484d7a6c..00000000000
--- a/debian/README.Maintainer
+++ /dev/null
@@ -1,99 +0,0 @@
-###########################################################################
-# Here are some information that are only of interest to the Debiani #
-# maintainers of MySQL. #
-###########################################################################
-
-#
-# Remarks to dependencies
-#
-libwrap0-dev (>= 7.6-8.3)
- According to bug report 114582 where where build problems on
- IA-64/sid with at least two prior versions.
-psmisc
- /usr/bin/killall in the initscript
-
-zlib1g in libmysqlclient-dev:
- "mysql_config --libs" adds "-lz"
-
-Build-Dep:
-
-debhelper (>=4.1.16):
- See po-debconf(7).
-
-autoconf (>= 2.13-20), automake1.7
- Try to get rid of them.
-
-doxygen, tetex-bin, tetex-extra, gs
- for ndb/docs/*tex
-
-mysql-server-5.0: Pre-Depends: mysql-common
- This was necessary as mysql-server-5.0.preinst checks for unmodified
- conffiles from mysql-server-4.1 and copies 5.0 ones over them to avoid
- unnecessary dpkg questions. As mysql-server-5.0 is not unpacked at its
- pre-inst stage, it had to copy those files from a package that is
- definetly already unpacked which does not have to be the case with Depends.
-
-#
-# Remarks to the start scripts
-#
-
-## initscripts rely on mysqladmin from a different package
-We have the problem that "/etc/init.d/mysql stop" relies on mysqladmin which
-is in another package (mysql-client) and a passwordless access that's maybe
-only available if the user configured his /root/.my.cnf. Can this be a problem?
-* normal mode: not because the user is required to have it. Else:
-* purge/remove: not, same as normal mode
-* upgrade: not, same as normal mode
-* first install: not, it depends on mysql-client which at least is unpacked
- so mysqladmin is there (to ping). It is not yet configured
- passwordles but if there's a server running then there's a
- /root/.my.cnf. Anyways, we simply kill anything that's mysqld.
-
-## Passwordless access for the maintainer scripts
-Another issue is that the scripts needs passwordless access. To ensure this
-a debian-sys-maint user is configured which has process and shutdown privs.
-The file with the randomly (that's important!) generated password must be
-present as long as the databases remain installed because else a new install
-would have no access. This file should be used like:
- mysqladmin --defaults-file=/etc/mysql/debian.cnf restart
-to avoid providing the password in plaintext on a commandline where it would
-be visible to any user via the "ps" command.
-
-## When to start the daemon?
-We aim to give the admin full control on when MySQL is running.
-Issues to be faced here:
-OLD:
- 1. Debconf asks whether MySQL should be started on boot so update-rc.d is
- only run if the answer has been yes. The admin is likely to forget
- this decision but update-rc.d checks for an existing line in
- /etc/runlevel.conf and leaves it intact.
- 2. On initial install, if the answer is yes, the daemon has to be started.
- 3. On upgrades it should only be started if it was already running, everything
- else is confusing. Especiall relying on an debconf decision made month ago
- is considered suboptimal. See bug #274264
- Implementation so far:
- prerm (called on upgrade before stopping the server):
- check for a running server and set flag if necessary
- preinst (called on initial install and before unpacking when upgrading):
- check for the debconf variable and set flag if necessary
- postinst (called on initial install and after each upgrade after unpacking):
- call update-rc.d if debconf says yes
- call invoce-rc.d if the flag has been set
- Problems remaining:
- dpkg-reconfigure and setting mysql start on boot to yes did not start mysql
- (ok "start on boot" literally does not mean "start now" so that might have been ok)
-NEW:
- 1. --- no debconf anymore for the sake of simplicity. We have runlevel.conf,
- the admin should use it
- 2. On initial install the server is started.
- 3. On upgrades the server is started exactly if it was running before so the
- runlevel configuration is irrelevant. It will be preserved by the mean of
- update-rc.d's builtin check.
- Implementation:
- prerm (called on upgrade before stopping the server):
- check for a running server and set flag if necessary
- preinst (called on initial install and before unpacking when upgrading):
- check for $1 beeing (initial) "install" and set flag
- postinst (called on initial install and after each upgrade after unpacking):
- call update-rc.d
- call invoce-rc.d if the flag has been set
diff --git a/debian/additions/my.cnf b/debian/additions/my.cnf
deleted file mode 100644
index a569c041401..00000000000
--- a/debian/additions/my.cnf
+++ /dev/null
@@ -1,134 +0,0 @@
-#
-# The MySQL database server configuration file.
-#
-# You can copy this to one of:
-# - "/etc/mysql/my.cnf" to set global options,
-# - "~/.my.cnf" to set user-specific options.
-#
-# One can use all long options that the program supports.
-# Run program with --help to get a list of available options and with
-# --print-defaults to see which it would actually understand and use.
-#
-# For explanations see
-# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
-
-# This will be passed to all mysql clients
-# It has been reported that passwords should be enclosed with ticks/quotes
-# escpecially if they contain "#" chars...
-# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
-[client]
-port = 3306
-socket = /var/run/mysqld/mysqld.sock
-
-# Here is entries for some specific programs
-# The following values assume you have at least 32M ram
-
-# This was formally known as [safe_mysqld]. Both versions are currently parsed.
-[mysqld_safe]
-socket = /var/run/mysqld/mysqld.sock
-nice = 0
-
-[mysqld]
-#
-# * Basic Settings
-#
-user = mysql
-pid-file = /var/run/mysqld/mysqld.pid
-socket = /var/run/mysqld/mysqld.sock
-port = 3306
-basedir = /usr
-datadir = /var/lib/mysql
-tmpdir = /tmp
-language = /usr/share/mysql/english
-skip-external-locking
-#
-# Instead of skip-networking the default is now to listen only on
-# localhost which is more compatible and is not less secure.
-bind-address = 127.0.0.1
-#
-# * Fine Tuning
-#
-key_buffer = 16M
-max_allowed_packet = 16M
-thread_stack = 128K
-thread_cache_size = 8
-#
-# * Query Cache Configuration
-#
-query_cache_limit = 1048576
-query_cache_size = 16777216
-query_cache_type = 1
-#
-# * Logging and Replication
-#
-# Both location gets rotated by the cronjob.
-# Be aware that this log type is a performance killer.
-#log = /var/log/mysql/mysql.log
-#
-# Error logging goes to syslog. This is a Debian improvement :)
-#
-# Here you can see queries with especially long duration
-#log_slow_queries = /var/log/mysql/mysql-slow.log
-#
-# The following can be used as easy to replay backup logs or for replication.
-#server-id = 1
-log_bin = /var/log/mysql/mysql-bin.log
-# WARNING: Using expire_logs_days without bin_log crashes the server! See README.Debian!
-expire_logs_days = 10
-max_binlog_size = 100M
-#binlog_do_db = include_database_name
-#binlog_ignore_db = include_database_name
-#
-# * BerkeleyDB
-#
-# Using BerkeleyDB is now discouraged as its support will cease in 5.1.12.
-skip-bdb
-#
-# * InnoDB
-#
-# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
-# Read the manual for more InnoDB related options. There are many!
-# You might want to disable InnoDB to shrink the mysqld process by circa 100MB.
-#skip-innodb
-#
-# * Security Features
-#
-# Read the manual, too, if you want chroot!
-# chroot = /var/lib/mysql/
-#
-# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
-#
-# ssl-ca=/etc/mysql/cacert.pem
-# ssl-cert=/etc/mysql/server-cert.pem
-# ssl-key=/etc/mysql/server-key.pem
-
-
-
-[mysqldump]
-quick
-quote-names
-max_allowed_packet = 16M
-
-[mysql]
-#no-auto-rehash # faster start of mysql but no tab completition
-
-[isamchk]
-key_buffer = 16M
-
-#
-# * NDB Cluster
-#
-# See /usr/share/doc/mysql-server-*/README.Debian for more information.
-#
-# The following configuration is read by the NDB Data Nodes (ndbd processes)
-# not from the NDB Management Nodes (ndb_mgmd processes).
-#
-# [MYSQL_CLUSTER]
-# ndb-connectstring=127.0.0.1
-
-
-#
-# * IMPORTANT: Additional settings that can override those from this file!
-#
-!includedir /etc/mysql/conf.d/
-
diff --git a/debian/additions/mysql-server.lintian-overrides b/debian/additions/mysql-server.lintian-overrides
deleted file mode 100644
index 9d741cf16e9..00000000000
--- a/debian/additions/mysql-server.lintian-overrides
+++ /dev/null
@@ -1,2 +0,0 @@
-W: mysql-dfsg source: maintainer-script-lacks-debhelper-token debian/mysql-server.postinst
-W: mysql-server: possible-bashism-in-maintainer-script postinst:68 'p{("a".."z","A".."Z",0..9)[int(rand(62))]}'
diff --git a/debian/additions/ndb_mgmd.cnf b/debian/additions/ndb_mgmd.cnf
deleted file mode 100644
index d94a28ff705..00000000000
--- a/debian/additions/ndb_mgmd.cnf
+++ /dev/null
@@ -1,35 +0,0 @@
-[NDBD DEFAULT]
-NoOfReplicas=2
-DataMemory=10MB
-IndexMemory=25MB
-MaxNoOfTables=256
-MaxNoOfOrderedIndexes=256
-MaxNoOfUniqueHashIndexes=128
-
-[MYSQLD DEFAULT]
-
-[NDB_MGMD DEFAULT]
-
-[TCP DEFAULT]
-
-[NDB_MGMD]
-Id=1 # the NDB Management Node (this one)
-HostName=127.0.0.1
-
-[NDBD]
-Id=2 # the first NDB Data Node
-HostName=127.0.0.1
-DataDir= /var/lib/mysql-cluster
-
-[NDBD]
-Id=3 # the second NDB Data Node
-HostName=127.0.0.1
-DataDir=/var/lib/mysql-cluster
-
-[MYSQLD]
-Id=4 # the first SQL node
-HostName=127.0.0.1
-
-# [MYSQLD]
-# Id=5 # the second SQL node
-# HostName=127.0.0.10
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100644
index 605619b605c..00000000000
--- a/debian/changelog
+++ /dev/null
@@ -1,3275 +0,0 @@
-mysql-5.0 (5.0.42) UNRELEASED; urgency=low
-
- * Upgraded to 5.0.42 branch.
-
- -- Monty Taylor <mtaylor@mysql.com> Thu, 19 Apr 2007 22:18:02 +0200
-
-mysql-5.0 (5.0.38) UNRELEASED; urgency=low
-
- * Imported packaging work from Debian.
- * Removed debian-start, mysqlreport and echo_stderr to align with official
- packages.
-
- -- Monty Taylor <mtaylor@mysql.com> Wed, 7 Mar 2007 07:52:55 +0800
-
-mysql-dfsg-5.0 (5.0.32-3etch1) testing-proposed-updates; urgency=high
-
- * Backported upstream patch for a bug that crashed the server when using
- certain join/group/limit combinations.
- Users of the Joomla CMS seemed to be affected by this. Closes: #403721
- * The debian-start script that runs on every server start now first upgrades
- the system tables (if neccessary) and then check them as it sometimes did
- not work the other way around (e.g. for MediaWiki). The script now uses
- mysql_update instead of mysql_update_script as recommended. Closes: 409780
- * The old_passwords setting that is set according to a Debconf question is
- now written to /etc/mysql/conf.d/old_passwords.cnf instead directly to the
- conffile /etc/mysql/my.cnf which would be fobidden by policy (thanks to
- Robert Bihlmeyer). Closes: #409750
- * Added bison to build dependencies.
- * Synced Debconf translations with 5.0.32-7.
-
- -- Christian Hammers <ch@debian.org> Sun, 18 Feb 2007 22:33:05 +0100
-
-mysql-dfsg-5.0 (5.0.32-3) unstable; urgency=high
-
- * mysql-server-5.0 pre-depends on adduser now and has --disabled-login
- explicitly added to be on the safe side (thanks to the puiparts team).
- Closes: #408362
- * Corrections the terminology regarding NDB in the comments of all config
- files and init scripts (thanks to Geert Vanderkelen of MySQL).
- * Updated Swedish Debconf translation (thanks to Andreas Henriksson).
- Closes: #407859
- * Updated Czech Debconf translation (thanks to Miroslav Kure).
- Closes: #407809
-
- -- Christian Hammers <ch@debian.org> Thu, 11 Jan 2007 11:18:47 +0100
-
-mysql-dfsg-5.0 (5.0.32-2) unstable; urgency=high
-
- * The last upload suffered from a regression that made NDB totally
- unusable and caused a dependency to libmysqlclient15-dev in the
- mysql-server-5.0 package. The relevant 85_* patch was re-added again.
- Closes: #406435
- * Added lintian-overrides for an error that does not affect our packages.
- There are now only warnings and not errors left.
-
- -- Christian Hammers <ch@debian.org> Tue, 9 Jan 2007 23:55:10 +0100
-
-mysql-dfsg-5.0 (5.0.32-1) unstable; urgency=high
-
- * New upstream version.
- * SECURITY: mysql_fix_privilege_tables.sql altered the
- table_privs.table_priv column to contain too few privileges, causing
- loss of the CREATE VIEW and SHOW VIEW privileges. (MySQL Bug#20589)
- * SECURITY (DoS): ALTER TABLE statements that performed both RENAME TO
- and {ENABLE|DISABLE} KEYS operations caused a server crash. (MySQL
- Bug#24089)
- * SECURITY (DoS): LAST_DAY('0000-00-00') could cause a server crash.
- (MySQL Bug#23653)
- * SECURITY (DoS): Using EXPLAIN caused a server crash for queries that
- selected from INFORMATION_SCHEMA in a subquery in the FROM clause.
- (MySQL Bug#22413)
- * SECURITY (DoS): Invalidating the query cache (e.g. when using stored procedures)
- caused a server crash for INSERT INTO ... SELECT statements that
- selected from a view. (MySQL Bug#20045)
- * Using mysql_upgrade with a password crashed the server. Closes: #406229
- * yaSSL crashed on pre-Pentium Intel and Cyrix CPUs. (MySQL Bug#21765)
- Closes: #383759
- * Lots of small fixes to the NDB cluster storage engine.
- * Updated Japanese Debconf template (thanks to Hideki Yamane).
- Closes: #405793
- * Fixed comment regarding "mycheck" in debian-start (thanks to
- Enrico Zini). Closes: #405787
-
- -- Christian Hammers <ch@debian.org> Sat, 6 Jan 2007 14:26:20 +0100
-
-mysql-dfsg-5.0 (5.0.30-3) unstable; urgency=low
-
- * Updated Brazilian Debconf translation (thanks to Andre Luis Lopes).
- Closes: #403821
- * Added Romanian Debconf translation (thanks to Stan Ioan-Eugen).
- Closes: #403943
- * Updated Spanish Debconf translation (thanks to Javier Fernandez-Sanguino
- Pena). Closes: #404084
- * Updated Galician Debconf translation (thanks to Jacobo Tarrio).
- Closes: #404318
- * Updated Dutch Debconf translation (thanks to Vincent Zweije).
- Closes: #404566
- * Updated Danish Debconf translation (thanks to Claus Hindsgaul).
- Closes: #405018
-
- -- Christian Hammers <ch@debian.org> Thu, 21 Dec 2006 21:35:09 +0100
-
-mysql-dfsg-5.0 (5.0.30-2) unstable; urgency=high
-
- * Fixed upstream regression in header files that lead to FTBFS for
- mysql-admin, mysql-query-browser and probably other pacakges.
- (thanks to Andreas Henriksson). Closes: #403081, #403082
- * Fixed some upstream scripts by replacing /etc by /etc/mysql (thanks to
- Julien Antony). Closes: #401083
- * Updated French Debconf translation (thanks to Christian Perrier).
- Closes: #401434
- * Added Spanish Debconf translation (thanks to Javier Fernandez-Sanguino
- Pena). Closes: #401953
- * Marked a Debconf question that is just a dummy and only internally
- used as not-needing-translation. Closes: #403163
- * Fixed mysqlslowdump patch to not remove the usage() function (thanks
- to Monty Tailor).
-
- -- Christian Hammers <ch@debian.org> Sun, 3 Dec 2006 19:20:10 +0100
-
-mysql-dfsg-5.0 (5.0.30-1) unstable; urgency=low
-
- * New upstream version (switch to the MySQL Enterprise branch).
- * Upstream bugfix for the Innodb performance bug:
- "Very poor performance with multiple queries running
- concurrently (Bug#15815)".
- * Upstream bugfix for a possible server crash:
- "Selecting from a MERGE table could result in a server crash if the
- underlying tables had fewer indexes than the MERGE table itself
- (Bug#22937)"
- * Upstream bugfies for *lot* of NDB problems.
- * Upstream bugfix for Innodb optimizer bug. Closes: #397597
- * Updated Italian Debconf translation (thanks to Luca Monducci).
- Closes: #401305
- * Updated debian/watch file to MySQL Enterprise branch.
-
- -- Christian Hammers <ch@debian.org> Sat, 2 Dec 2006 16:36:38 +0100
-
-mysql-dfsg-5.0 (5.0.27-2) unstable; urgency=medium
-
- * Disabled YaSSL x86 assembler as it was reported to crash applications
- like pam-mysql or proftpd-mysql which are linked against libmysqlclient
- on i486 and Cyrix (i586) CPUs. Closes: #385147
- * Adjusted mysql-server-4.1 priority to extra and section to oldlibs
- according to the ftp masters overrides.
- * Updated German Debconf translation (thanks to Alwin Meschede).
- Closes: #400809
-
- -- Christian Hammers <ch@debian.org> Wed, 22 Nov 2006 13:36:31 +0100
-
-mysql-dfsg-5.0 (5.0.27-1) unstable; urgency=medium
-
- * New upstream version (but no codechange, the only difference to 5.0.26
- was a patch to the ABI change which Debian already included.
- * When dist-upgrading from mysql-server-4.1/sarge dpkg does not longer
- ask unnecessary "config file has changed" questions regarding
- /etc/init.d/mysql, /etc/logrotate.d/mysql-server and
- /etc/mysql/debian-start just because these files previously belonged
- to mysql-server-4.1 and not to mysql-server-5.0.
- To archive this mysql-server-5.0 now pre-depends on mysql-common which
- provides current versions of those files.
- * The automatic run mysql_upgrade now works with non-standard datadir
- settings, too (thanks to Benjami Villoslada). Closes: #394607
- * Debconf now asks if the old_passwords option is really needed.
- * Improved explanations of the old_passwords variable in my.cnf.
- * Removed possibly leftover cron script from MySQL-4.1 (thanks to
- Mario Oyorzabal Salgado). Closes: #390889
- * Postrm ignores failed "userdel mysql".
- * Updated Danish Debconf translation (thanks to Claus Hindsgaul).
- Closes: #398784
- * Added Euskarian Debconf translation (thanks to Piarres Beobide).
- Closes: #399045
- * Updated Japanese Debconf translation (thanks to Hideki Yamane).
- Closes: #399074
- * Updated German Debconf translation (thanks to Alwin Meschede).
- Closes: #399087
- * New Portuguese debconf translations from Miguel Figueiredo.
- Closes: #398186
-
- -- Christian Hammers <ch@debian.org> Tue, 7 Nov 2006 21:26:25 +0100
-
-mysql-dfsg-5.0 (5.0.26-3) unstable; urgency=high
-
- [sean finney]
- * Fix for the deadly ISAM trap. Now during upgrades we will do our
- very best to convert pre-existing ISAM format tables using the
- binaries from the previous package. Success is not guaranteed, but
- this is probably as good as it gets. Note that this also necessitates
- re-introducing an (empty transitional) mysql-server-4.1 package.
- Closes: #354544, #354850
- * Remove a couple spurious and wrongly placed WARNING statements from
- 45_warn-CLI-passwords.dpatch. thanks to Dan Jacobsen for pointing these
- out. Closes: #394262
-
- -- sean finney <seanius@debian.org> Fri, 03 Nov 2006 18:34:46 +0100
-
-mysql-dfsg-5.0 (5.0.26-2) unstable; urgency=high
-
- * Fixed FTBFS for Alpha by applying an upstream patch (thanks to Falk
- Hueffner). Closes: #395921
-
- -- Christian Hammers <ch@debian.org> Sat, 28 Oct 2006 20:13:46 +0200
-
-mysql-dfsg-5.0 (5.0.26-1) unstable; urgency=high
-
- * SECURITY:
- This combined release of 5.0.25 and 5.0.26 fixes lot of possible server
- crashs so it should get into Etch. Quoting the changelog (bug numbers are
- bugs.mysql.com ones):
- - character_set_results can be NULL to signify no conversion, but some
- code did not check for NULL, resulting in a server crash. (Bug#21913)
- - Using cursors with READ COMMITTED isolation level could cause InnoDB to
- crash. (Bug#19834)
- - Some prepared statements caused a server crash when executed a second
- time. (Bug#21166)
- - When DROP DATABASE or SHOW OPEN TABLES was issued while concurrently
- issuing DROP TABLE (or RENAME TABLE, CREATE TABLE LIKE or any other
- statement that required a name lock) in another connection, the server
- crashed. (Bug#21216)
- - Use of zero-length variable names caused a server crash. (Bug#20908)
- - For InnoDB tables, the server could crash when executing NOT IN ()
- subqueries. (Bug#21077)
- - Repeated DROP TABLE statements in a stored procedure could sometimes
- cause the server to crash. (Bug#19399)
- - Performing an INSERT on a view that was defined using a SELECT that
- specified a collation and a column alias caused the server to crash
- (Bug#21086).
- - A query of the form shown here caused the server to crash. (Bug#21007)
- - NDB Cluster: Some queries involving joins on very large NDB tables could
- crash the MySQL server. (Bug#21059)
- - The character set was not being properly initialized for CAST() with a
- type like CHAR(2) BINARY, which resulted in incorrect results or even a
- server crash. (Bug#17903)
- - For certain queries, the server incorrectly resolved a reference to an
- aggregate function and crashed. (Bug#20868)
- - The server crashed when using the range access method to execut a
- subquery with a ORDER BY DESC clause. (Bug#20869)
- - Triggers on tables in the mysql database caused a server crash. Triggers
- for tables in this database now are disallowed. (Bug#18361)
- - Using SELECT on a corrupt MyISAM table using the dynamic record format
- could cause a server crash. (Bug#19835)
- - Use of MIN() or MAX() with GROUP BY on a ucs2 column could cause a
- server crash. (Bug#20076)
- - Selecting from a MERGE table could result in a server crash if the
- underlying tables had fewer indexes than the MERGE table itself.
- (Bug#21617, Bug#22937)
-
- * New upstream release.
- - This bug would cause trouble for Sarge->Etch upgrades, it was supposed to
- have been fixed in 5.0.16 but that apparently did not fix the whole
- problem:
- Using tables from MySQL 4.x in MySQL 5.x, in particular those with VARCHAR
- fields and using INSERT DELAYED to update data in the table would result in
- either data corruption or a server crash. (Bug#16611, Bug#16218, Bug#17294)
- Closes: #386337
- - Fixes data corruption as an automatic client reconnect used to set
- the wrong character set. Closes: #365050
- - Fixes an undefined ulong type in an include file. Closes: #389102
- - Fixes wrong output format when using Unicode characters. Closes: #355302
- - Fixes mysql_upgrade when using a password. Closes: #371841
-
- [Christian Hammers]
- * Removed --sysconfdir from debian/rules as it puts /etc/mysql/ at the
- end of the my.cnf search patch thus overriding $HOME/my.cnf
- (thanks to Christoph Biedl). Closes: #394992
- * The provided patch from bug #385947 was wrong, the variable is called
- BLOCKSIZE not BLOCK_SIZE according to "strings `which df`" (thanks to
- Bruno Muller). Closes: #385947
-
- [sean finney]
- * new dutch debconf translations from Vincent Zweije (closes: #392809).
- * new japanese debconf translations from Hideki Yamane (closes: #391625).
- * new italian debconf translations from Luca Monducci (closes: #391741).
- * new french debconf translations from Christian Perrier (closes: #393334).
- * ran debconf-updatepo to merge the fuzzies into svn.
- * massage the following patches so they continue to apply cleanly:
- - 44_scripts__mysql_config__libs.dpatch to cleanly apply.
- - 45_warn-CLI-passwords.dpatch
- - 96_TEMP__libmysqlclient_ssl_symbols.dpatch (note, this patch might
- no longer be needed, but is retained "just in case" after massaging it)
- * the following patches have been incorporated upstream:
- - 70_kfreebsd.dpatch
- - 80_hurd_mach.dpatch
- - 87_ps_Hurd.dpatch
- - 90_TEMP__client__mysql_upgrade__O_EXEC.dpatch
- - 91_TEMP__client__mysql_upgrade__password.dpatch
- - 92_TEMP__client__mysql_upgrade__defaultgroups.dpatch
- - 94_TEMP__CVE-2006-4227.dpatch
- - 95_TEMP__CVE-2006-4226.dpatch
- * the udf_example.cc has disappeared from the source code, but there's
- a udf_example.c which seems to be a good example to use instead :)
- * update documentation in the configuration to no longer reference
- using my.cnf in the DATADIR, as it's never been the recommended
- method for debian systems and hasn't worked since 5.0 was released
- anyway (closes: #393868).
-
- -- Christian Hammers <ch@debian.org> Wed, 25 Oct 2006 19:54:04 +0200
-
-mysql-dfsg-5.0 (5.0.24a-9) unstable; urgency=medium
-
- * Having expire_logs_days enabled but log-bin not crashes the server. Using
- both or none of those options is safe. To prevent this happening during the
- nightly log rotation via /etc/logrotate.d/mysql the initscript checks for
- malicious combination of options. See: #368547
- * The Sarge package "mysql-server" which used to include the mysqld daemon
- may still be in unselected-configured state (i.e. after a remove but not
- purge) in which case its now obsolete cronscript has to be moved away
- (thanks to Charles Lepple). Closes: #385669
- * Updated Danish Debconf translation (thanks to Claus Hindsgaul).
- Closes: #390315
- * Updated Frensh Debconf translation (thanks to Christian Perrier).
- Closes: #390980
-
- -- Christian Hammers <ch@debian.org> Tue, 3 Oct 2006 14:55:31 +0200
-
-mysql-dfsg-5.0 (5.0.24a-8) unstable; urgency=low
-
- * (broken upload)
-
- -- Christian Hammers <ch@debian.org> Tue, 3 Oct 2006 14:55:31 +0200
-
-mysql-dfsg-5.0 (5.0.24a-7) unstable; urgency=low
-
- * Stopped mysql_config from announcing unnecessary library dependencies
- which until now cause "NEEDED" dependencies in the "readelf -d" output
- of libraries who only depend on libmysqlclient.so (thanks to Michal
- Cihar). Closes: #390692
-
- -- Christian Hammers <ch@debian.org> Sun, 1 Oct 2006 23:59:43 +0200
-
-mysql-dfsg-5.0 (5.0.24a-6) unstable; urgency=low
-
- [sean finney]
- * finally add support for setting a root password at install.
- while this is not a random password as requested in one bug
- report, we believe it is the best solution and provides a
- means to set a random password via preseeding if it's really
- desired (Closes: #316127, #298295).
-
- -- sean finney <seanius@debian.org> Sun, 01 Oct 2006 23:34:30 +0200
-
-mysql-dfsg-5.0 (5.0.24a-5) unstable; urgency=low
-
- * Added ${shlibs:Depends} to debian/control section libmysqlclient-dev as it
- contains the experimental /usr/lib/mysql/libndbclient.so.0.0.0.
- * Bumped standards version to 3.7.2.
- * Added LSB info section to init scripts.
- * Rephrased Debconf templates as suggested by lintian.
- * Added benchmark suite in /usr/share/mysql/sql-bench/.
- * The mysql.timezone* tables are now filled by the postinst script (thanks
- to Mark Sheppard). Closes: #388491
- * Moved Debconf install notes to README.Debian. Displaying them with
- medium priority was a bug anyway. Closes: #388941
- * Replaced /usr/bin/mysql_upgrade by /usr/bin/mysql_upgrade_shell in
- /etc/mysql/debian-start.sh as it works without errors (thanks to Javier
- Kohen). Closes: #389443
-
- -- Christian Hammers <ch@debian.org> Wed, 20 Sep 2006 15:01:42 +0200
-
-mysql-dfsg-5.0 (5.0.24a-4) unstable; urgency=high
-
- * libmysqlclient.so.15 from 5.0.24 accidentaly exports some symbols that are
- historically exported by OpenSSL's libcrypto.so. This bug was supposed to
- be fixed in 5.0.24a bug according to the mysql bug tracking system will
- only be fixed in 5.0.25 so I backported the patch. People already reported
- crashing apps due to this (thanks to Duncan Simpson). See also: #385348
- Closes: #388262
- * Fixed BLOCKSIZE to BLOCK_SIZE in initscript (thanks to Bruno Muller).
- Closes: #385947
- * Added hint to "--extended-insert=0" to mysqldump manpage (thanks to Martin
- Schulze).
- * Documented the meaning of "NDB" in README.Debian (thanks to Dan Jacobson).
- Closes: #386274
- * Added patch to build on hurd-i386 (thanks to Cyril Brulebois). Closes: #387369
- * Fixed debian-start script to work together with the recend LSB modifications in
- the initscript (thanks to wens). Closes: #387481
- * Reverted tmpdir change in my.cnf back to /tmp to comply with FHS (thanks
- to Alessandro Valente). Closes: #382778
- * Added logcheck filter rule (thanks to Paul Wise). Closes: #381043
- * I will definetly not disable InnoDB but added a note to the default my.cnf
- that disabling it saves about 100MB virtual memory (thanks to Olivier
- Berger). Closes: #384399
- * Added thread_cache_size=8 to default my.cnf as this variable seems to have
- a negligible memory footprint but can improve performance when lots of
- threads connect simultaneously as often seen on web servers.
-
- -- Christian Hammers <ch@debian.org> Mon, 4 Sep 2006 00:21:50 +0200
-
-mysql-dfsg-5.0 (5.0.24a-3) unstable; urgency=low
-
- * Fixed potential tempfile problem in the newly added mysqlreport script.
-
- -- Christian Hammers <ch@debian.org> Sun, 3 Sep 2006 23:17:24 +0200
-
-mysql-dfsg-5.0 (5.0.24a-2) unstable; urgency=low
-
- * Added "mysqlreport" (GPL'ed) from hackmysql.com.
- * Temporarily disabled expire_days option as it causes the server
- to crash. See #368547
- * Made output of init scripts LSB compliant (thanks to David Haerdeman).
- Closes: #385874
-
- -- Christian Hammers <ch@debian.org> Sun, 3 Sep 2006 19:06:53 +0200
-
-mysql-dfsg-5.0 (5.0.24a-1) unstable; urgency=high
-
- * New upstream version.
- * The shared library in the 5.0.24 upstream release accidently exported
- some symbols that are also exported by the OpenSSL libraries (notably
- BN_bin2bn) causing unexpected behaviour in applications using these
- functions (thanks to Peter Cernak). Closes: #385348
- * Added note about possible crash on certain i486 clone CPUs.
- * Made recipient address of startup mysqlcheck output configurable
- (thanks to Mattias Guns). Closes: #385119
-
- -- Christian Hammers <ch@debian.org> Mon, 28 Aug 2006 01:22:12 +0200
-
-mysql-dfsg-5.0 (5.0.24-3) unstable; urgency=high
-
- * SECURITY:
- CVE-2006-4226:
- When run on case-sensitive filesystems, MySQL allows remote
- authenticated users to create or access a database when the database
- name differs only in case from a database for which they have
- permissions.
- CVE-2006-4227:
- MySQL evaluates arguments of suid routines in the security context of
- the routine's definer instead of the routine's caller, which allows
- remote authenticated users to gain privileges through a routine that
- has been made available using GRANT EXECUTE.
- Thanks to Stefan Fritsch for reporting. Closes: #384798
-
- -- Christian Hammers <ch@debian.org> Sat, 26 Aug 2006 04:55:17 +0200
-
-mysql-dfsg-5.0 (5.0.24-2) unstable; urgency=high
-
- * 5.0.24-1 introduced an ABI incompatibility, which this patch reverts.
- Programs compiled against 5.0.24-1 are not compatible with any other
- version and needs a rebuild.
- This bug already caused a lot of segfaults and crashes in various
- programs. Thanks to Chad MILLER from MySQL for quickly providing a patch.
- The shlibdeps version has been increased to 5.0.24-2.
- Closes: #384047, #384221, #383700
-
- -- Christian Hammers <ch@debian.org> Fri, 25 Aug 2006 21:47:35 +0200
-
-mysql-dfsg-5.0 (5.0.24-1) unstable; urgency=high
-
- * SECURITY: Upstream fixes a security bug which allows a user to continue
- accessing a table using a MERGE TABLE after the right to direct access to
- the database has been revoked (CVE-2006-4031, MySQL bug #15195).
- (Well they did not exactly fixed it, they documented the behaviour and
- allow the admin to disable merge table alltogether...). Closes: #380271
- * SECURITY: Applied patch that fixes a possibly insecure filehandling
- in the recently added mysql_upgrade binary file (MySQL bug #10320).
- * New upstream version.
- - Fixes nasty MySQL bug #19618 that leads to crashes when using
- "SELECT ... WHERE ... not in (1, -1)" (e.g. vbulletin was affected).
- - Fixes upstream bug #16803 so that linking ~/.mysql_history to /dev/null
- now has the desired effect of having no history.
- * Really fixed the runlevels. Closes: #377651
- * Added patch for broken upstream handling of "host=" to mysql_upgrade.c.
- * Adjusted /etc/mysql/debian-start to new mysql_upgrade.c
-
- -- Christian Hammers <ch@debian.org> Tue, 8 Aug 2006 00:44:13 +0200
-
-mysql-dfsg-5.0 (5.0.22-5) unstable; urgency=low
-
- * Added further line to the logcheck ignore files (thanks to Paul Wise).
- Closes: #381038
-
- -- Christian Hammers <ch@debian.org> Wed, 2 Aug 2006 00:28:50 +0200
-
-mysql-dfsg-5.0 (5.0.22-4) unstable; urgency=low
-
- * Upstream fixes a bug in the (never released) version 5.0.23 which could
- maybe used to crash the server if the mysqlmanager daemon is in use
- which is not yet the default in Debian. (CVE-2006-3486 *DISPUTED*)
- * Changed runlevel priority of mysqld from 20 to 19 so that it gets started
- before apache and proftpd etc. which might depend on an already running
- database server (thanks to Martin Gruner). Closes: #377651
- * Added patch which sets PATH_MAX in ndb (thanks to Cyril Brulebois).
- Closes: #378949
- * Activated YaSSL as licence issues are settled according to:
- http://bugs.mysql.com/?id=16755. This also closes the FTBFS bug
- regarding OpenSSL as it is discouraged to use now. Closes: #368639
- * Removed SSL-MINI-HOWTO as the official documentation is good enough now.
- * mysql_upgrade no longer gives --password on the commandline which would
- be insecure (thanks to Dean Gaudet). Closes: #379199
- * Adjusted debian/patches/45* to make consecutive builds in the same source
- tree possible (thanks to Bob Tanner). Closes: #368661
- * mysql-server-5.0 is now suggesting tinyca as yaSSL is enabled and tinyca
- was found to be really cool :)
- * Moved tempdir from /tmp to /var/tmp as it will more likely have enough
- free space as /tmp is often on the root partition and /var or at least
- /var/tmp is on a bigger one.
-
- -- Christian Hammers <ch@debian.org> Mon, 10 Jul 2006 23:30:26 +0200
-
-mysql-dfsg-5.0 (5.0.22-3) unstable; urgency=low
-
- * Added patch for MySQL bug #19618: "select x from x
- where x not in(1,-1)" may crash the server" (thanks to
- Ruben Puettmann).
-
- -- Christian Hammers <ch@debian.org> Fri, 9 Jun 2006 01:41:44 +0200
-
-mysql-dfsg-5.0 (5.0.22-2) unstable; urgency=high
-
- * Fixed debian-sys-maint related bug in postinst (thanks to
- Jean-Christophe Dubacq). Closes: #369970
- * The last upload was a security patch (which I did not know as I
- uploaded before the announcement came). I now added the CVE id for
- reference and set urgency to high as the last entry did not.
-
- -- Christian Hammers <ch@debian.org> Wed, 31 May 2006 01:04:11 +0200
-
-mysql-dfsg-5.0 (5.0.22-1) unstable; urgency=low
-
- * SECURITY: This upstream release fixes an SQL-injection with multibyte
- encoding problem. (CVE-2006-2753)
- * New upstream release.
- * Upstream fixes REPAIR TABLE problem. Closes: #354300
- * Upstream fixes problem that empty strings in varchar and text columns
- are displayed as NULL. Closes: #368663
-
- -- Christian Hammers <ch@debian.org> Tue, 30 May 2006 23:43:24 +0200
-
-mysql-dfsg-5.0 (5.0.21-4) unstable; urgency=low
-
- * Added "BLOCKSIZE=" to the diskfree check (thanks to Farzad FARID).
- Closes: #367027, #367083
- * Further fixed mysql_upgrade upstream script (thanks to Andreas Pakulat)
- Closes: #366155
- * Adjusted the /proc test in debian/rules from /proc/1 to /proc/self
- to make building on grsec systems possible (thanks to K. Rosenegger).
- Closes: #366824
- * Updated Russion Debconf translation (thanks to Yuriy Talakan).
- Closes: #367141
- * Updated Czech Debconf translation (thanks to Kiroslav Kure).
- Closes: #367160
- * Updated Galician Debconf translation (thanks to Jacobo Tarrio).
- Closes: #367384
- * Updated Swedish Debconf translation (thanks to Daniel Nylander).
- Closes: #368186
-
- -- Christian Hammers <ch@debian.org> Wed, 10 May 2006 08:45:42 +0200
-
-mysql-dfsg-5.0 (5.0.21-3) unstable; urgency=low
-
- * Fixed FTBFS problem which was caused by a patch that modifies Makefile.am
- as well as Makefile.in and was not deteced because my desktop was fast
- enough to patch both files within the same second and so fooled automake.
- (thanks to Blars Blarson for notifying me). Closes: #366534
-
- -- Christian Hammers <ch@debian.org> Sat, 6 May 2006 19:03:58 +0200
-
-mysql-dfsg-5.0 (5.0.21-2) unstable; urgency=low
-
- * Fixed bug in postinst that did not correctly rewrite
- /etc/mysql/debian.cnf (thanks to Daniel Leidert).
- Closes: #365433, #366155
-
- -- Christian Hammers <ch@debian.org> Thu, 4 May 2006 02:37:03 +0200
-
-mysql-dfsg-5.0 (5.0.21-1) unstable; urgency=high
-
- * SECURITY: New upstream release with some security relevant bugfixes:
- * "Buffer over-read in check_connection with usernames lacking a
- trailing null byte" (CVE-2006-1516)
- * "Anonymous Login Handshake - Information Leakage" (CVE-2006-1517)
- * "COM_TABLE_DUMP Information Leakage and Arbitrary command execution"
- (CVE-2006-1518)
- Closes: #365938, #365939
- * Added diskfree check to the init script (thanks to Tim Baverstock).
- Closes: #365460
- * First amd64 upload!
-
- -- Christian Hammers <ch@debian.org> Sat, 29 Apr 2006 04:31:27 +0200
-
-mysql-dfsg-5.0 (5.0.20a-2) unstable; urgency=low
-
- * The new mysql-upgrade which is started from /etc/mysql/debian-start
- does now use the debian-sys-maint user for authentication (thanks to
- Philipp). Closes: #364991
- * Wrote patch debian/patches/43* which adds a password option to
- mysql_update. See MySQL bug #19400.
- * Added "Provides: libmysqlclient-dev" to libmysqlclient15-dev as I saw no
- obvious reasons against it (problems should be documented in
- debian/README.Maintainer!) (thanks to Olaf van der Spek). Closes: #364899
- * Updated Netherlands debconf translation (thanks to Vincent Zweije)
- Closes: #364464
- * Updated French debconf translation (thanks to Christian Perrier)
- Closes: #364401
- * Updated Danish debconf translation (thanks to Claus Hindsgaul)
- Closes: #365135
-
- -- Christian Hammers <ch@debian.org> Wed, 26 Apr 2006 01:14:53 +0200
-
-mysql-dfsg-5.0 (5.0.20a-1) unstable; urgency=low
-
- * New upstream release.
- * Added the new mysql_upgrade script and added it to
- /etc/mysql/debian-start (thanks to Alessandro Polverini).
- The script is currently very noise that is a known bug and will be
- fixed in the next release!
- Closes: #363458
- * No longer creates the "test" database. This actuallay had been tried
- to archive before (at least patches) exists but apparently was not the
- case in the last versions (thanks to Olaf van der Spek). Closes: #362126
- * Reformatted libmysqlclient15off.NEWS.Debian to changelog format
- (thanks to Peter Palfrader). Closes: #363062
-
- -- Christian Hammers <ch@debian.org> Sat, 15 Apr 2006 13:05:22 +0200
-
-mysql-dfsg-5.0 (5.0.20-1) unstable; urgency=high
-
- * Upstream contains a fix for a nasty bug (MySQL#18153) that users
- already experienced and that caused corrupted triggers after
- REPAIR/OPTIMIZE/ALTER TABLE statements.
- (thanks to Jerome Despatis for pointing out)
- * Added patch for the "updates on multiple tables is buggy after
- upgrading from 4.1 to 5.0" problem which MySQL has been committed
- for the upcoming 5.0.21 release. Closes #352704
- * Added Netherlands debconf translation (thanks to Vincent Zweije).
- Closes: #360443
- * Added Galician debconf translation (thanks to Jacobo Tarrio).
- Closes: #361257
-
- -- Christian Hammers <ch@debian.org> Fri, 7 Apr 2006 00:00:43 +0200
-
-mysql-dfsg-5.0 (5.0.19-3) unstable; urgency=high
-
- [ Christian Hammers ]
- * Fixed libmysqlclient15.README.Debian regarding package name changes
- (thanks to Leppo).
- * Moved libheap.a etc. back to /usr/lib/mysql/ as their names are just
- too generic. Closes: #353924
- [ Sean Finney ]
- * updated danish debconf translation, thanks to Claus Hindsgaul
- (closes: #357424).
- [ Adam Conrad ]
- * Send stderr from 'find' in preinst to /dev/null to tidy up chatter.
- * Backport patch for CVE-2006-0903 from the upcoming release to resolve
- a log bypass vulnerability when using non-binary logs (closes: #359701)
-
- -- Adam Conrad <adconrad@0c3.net> Tue, 4 Apr 2006 15:23:18 +1000
-
-mysql-dfsg-5.0 (5.0.19-2) unstable; urgency=medium
-
- * New upstream release.
- * Renamed package libmysqlclient15 to libmysqlclient15off due to
- binary incompatible changes.
- See /usr/share/doc/libmysqlclient15off/README.Debian
- * Updated Czech debconf translation (thanks to Miroslav Kure).
- Closes: #356503
- * Updated French debconf translation (thanks to Christian Perrier).
- Closes: #356332
- * Improved README.Debian (thanks to Olaf van der Spek). Closes: #355702
- * Fixed 5.0.18-8 changelog by saying in which package the NEWS.Debian
- file is (thanks to Ross Boylan). Closes: #355978
-
- -- Christian Hammers <ch@debian.org> Fri, 17 Mar 2006 02:32:19 +0100
-
-mysql-dfsg-5.0 (5.0.19-1) experimental; urgency=medium
-
- * New upstream release.
- * SECURITY: CVE-2006-3081: A bug where str_to_date(1,NULL) lead to a
- server crash has been fixed.
- (this note has been added subsequently for reference)
- * Renamed package libmysqlclient15 to libmysqlclient15off.
- See /usr/share/doc/libmysqlclient15off/NEWS.Debian
- * Updated Czech debconf translation (thanks to Miroslav Kure).
- Closes: #356503
- * Updated French debconf translation (thanks to Christian Perrier).
- Closes: #356332
- * Improved README.Debian (thanks to Olaf van der Spek). Closes: #355702
- * Fixed 5.0.18-8 changelog by saying in which package the NEWS.Debian
- file is (thanks to Ross Boylan). Closes: #355978
-
- -- Christian Hammers <ch@debian.org> Tue, 14 Mar 2006 22:56:13 +0100
-
-mysql-dfsg-5.0 (5.0.18-9) unstable; urgency=medium
-
- [ Christian Hammers ]
- * When using apt-get the check for left-over ISAM tables can abort the
- installation of mysql-server-5.0 but not prevent the mysql-server-4.1
- package from getting removed. The only thing I can do is reflect this
- in the Debconf notice that is shown and suggest to reinstall
- mysql-server-4.1 for converting. See: #354850
- * Suggests removing of /etc/cron.daily/mysql-server in last NEWS message
- (thanks to Mourad De Clerck). Closes: #354111
- * Added versioned symbols for kfreebsd and Hurd, too (thanks to Aurelien
- Jarno and Michael Bank). Closes: #353971
- * Added versioned symbols for kfreebsd, too (thanks to Aurelien Jarno).
- Closes: #353971
- [ Adam Conrad ]
- * Add 39_scripts__mysqld_safe.sh__port_dir.dpatch to ensure that the
- permissions on /var/run/mysqld are always correct, even on a tmpfs.
-
- -- Christian Hammers <ch@debian.org> Mon, 6 Mar 2006 21:42:13 +0100
-
-mysql-dfsg-5.0 (5.0.18-8) unstable; urgency=low
-
- * The rotation of the binary logs is now configured via
- expire-logs-days in /etc/mysql/my.cnf and handled completely
- by the server and no longer in configured in debian-log-rotate.conf
- and handled by a cron job. Thanks to David Johnson.
- See /usr/share/doc/mysql-server-5.0/NEWS.Debian
- * Ran aspell over some files in debian/ and learned a lot :)
- * debian/rules: Added check if versioned symbols are really there.
- * Updated SSL-MINI-HOWTO.
- * Updated copyright (removed the parts regarding the now removed
- BerkeleyDB table handler and mysql-doc package).
- * Relocated a variable in preinst (thanks to Michael Heldebrant).
- Closes: #349258, #352587, #351216
- * Updated Danish debconf translation (thanks to Claus Hindsgaul).
- Closes: #349013
- * Updated Swedish debconf translation (thanks to Daniel Nylander).
- Closes: #349522
- * Updated French debconf translation (thanks to Christian Perrier).
- Closes: #349592
- * Fixed typo in README.Debian (thanks to Vincent Ricard).
- * Prolonged waiting time for mysqld in the init script. Closes: #352070
-
- -- Christian Hammers <ch@debian.org> Mon, 23 Jan 2006 23:13:46 +0100
-
-mysql-dfsg-5.0 (5.0.18-7) unstable; urgency=low
-
- * Made mailx in debian-start.inc.sh optional and changed the dependency on it
- on it to a mere recommendation. Closes: #316297
- * the previous FTBFS patches for GNU/Hurd inadvertently led to configure
- being regenerating, losing a couple trivial things like our versioned
- symbols patch, causing many nasty problems (closes: #348854).
-
- -- sean finney <seanius@debian.org> Fri, 20 Jan 2006 20:59:27 +0100
-
-mysql-dfsg-5.0 (5.0.18-6) unstable; urgency=low
-
- * Added version comment (thanks to Daniel van Eeden).
- * Added two patches to build on GNU/Hurd (thanks to Michael Bank).
- Closes: #348182
- * Abort upgrade if old and now unsupported ISAM tables are present
- (thanks to David Coe). Closes: #345895
-
- -- Christian Hammers <ch@debian.org> Tue, 17 Jan 2006 19:25:59 +0100
-
-mysql-dfsg-5.0 (5.0.18-5) unstable; urgency=low
-
- * Bump shlibdeps for libmysqlclient15 to (>= 5.0.15-1), which was
- the first non-beta release from upstream, as well as being shortly
- after we broke the ABI in Debian by introducing versioned symbols.
-
- -- Adam Conrad <adconrad@0c3.net> Fri, 13 Jan 2006 13:18:03 +1100
-
-mysql-dfsg-5.0 (5.0.18-4) unstable; urgency=low
-
- * Munge our dependencies further to smooth upgrades even more, noting
- that we really need 5.0 to conflict with 4.1, and stealing a page from
- the book of mysql-common, it doesn't hurt to hint package managers in
- the direction of "hey, this stuff is a complete replacement for 4.1"
- * Change the description of mysql-server and mysql-client to remove the
- references to it being "transition", and instead point out that it's
- the way to get the "current best version" of each package installed.
-
- -- Adam Conrad <adconrad@0c3.net> Wed, 11 Jan 2006 11:39:45 +1100
-
-mysql-dfsg-5.0 (5.0.18-3) unstable; urgency=low
-
- * Make the mysql-{client,server}-5.0 conflict against mysql-{client,server}
- versioned, so they can be installed side-by-side and upgrade properly.
- * Add myself to Uploaders; since I have access to the alioth repository.
-
- -- Adam Conrad <adconrad@0c3.net> Tue, 10 Jan 2006 19:15:48 +1100
-
-mysql-dfsg-5.0 (5.0.18-2) unstable; urgency=low
-
- * Removed the transitional package that forced an upgrade from
- mysql-server-4.1 to mysql-server-5.0 as I was convinced that
- having a general "mysql-server" package with adjusted dependencies
- is enough (thanks to Adam Conrad).
- * Updated logcheck.ignore files (thanks to Jamie McCarthy). Closes: #340193
-
- -- Christian Hammers <ch@debian.org> Mon, 9 Jan 2006 21:54:53 +0100
-
-mysql-dfsg-5.0 (5.0.18-1) unstable; urgency=low
-
- * New upstream version.
- * Added empty transitional packages that force an upgrade from the
- server and client packages that have been present in Sarge.
- * Fixed SSL-MINI-HOWTO (thanks to Jonas Smedegaard). Closes: #340589
-
- -- Christian Hammers <ch@debian.org> Mon, 2 Jan 2006 21:17:51 +0100
-
-mysql-dfsg-5.0 (5.0.17-1) unstable; urgency=low
-
- * Never released as Debian package.
-
- -- Christian Hammers <ch@debian.org> Thu, 22 Dec 2005 07:49:52 +0100
-
-mysql-dfsg-5.0 (5.0.16-1) unstable; urgency=low
-
- * New upstream version.
- * Removed the error logs from the logrotate script as Debian does
- not use them anymore. Closes: #339628
-
- -- Christian Hammers <ch@debian.org> Tue, 22 Nov 2005 01:19:11 +0100
-
-mysql-dfsg-5.0 (5.0.15-2) unstable; urgency=medium
-
- * Added 14_configure__gcc-atomic.h.diff to fix FTBFS on m68k
- (thanks to Stephen R Marenka). Closes: #337082
- * Removed dynamic linking against libstdc++ as it was not really
- needed (thanks to Adam Conrad). Closes: #328613
- * Fixed the "/var/lib/mysql is a symlink" workaround that accidently
- left a stalled symlink (thanks to Thomas Lamy). Closes: #336759
- * As the init script cannot distinguish between a broken startup and
- one that just takes very long the "failed" message now says
- "or took more than 6s" (thanks to Olaf van der Spek). Closes: #335547
-
- -- Christian Hammers <ch@debian.org> Thu, 3 Nov 2005 22:00:15 +0100
-
-mysql-dfsg-5.0 (5.0.15-1) unstable; urgency=low
-
- * New upstream version. 5.0 has finally been declared STABLE!
- * Added small patch to debian/rules that fixed sporadic build errors
- where stdout and stderr were piped together, got mixed up and broke
- * Added --with-big-tables to ./configure (thanks to tj.trevelyan).
- Closes: #333090
- * Added capability to parse "-rc" to debian/watch.
- * Fixed cronscript (thanks to Andrew Deason). Closes: #335244
- * Added Swedish debconf translation (thanks to Daniel Nylander).
- Closes: #333670
- * Added comment to README.Debian regarding applications that manually
- set new-style passwords... Closes: #334444
- * Sean Finney:
- - Fix duplicate reference to [-e|--extended-insert]. Closes: #334957
- - Fix default behavior for mysqldumpslow. Closes: #334517
- - Reference documentation issue in mysql manpage. Closes: #335219
-
- -- Christian Hammers <ch@debian.org> Fri, 30 Sep 2005 00:10:39 +0200
-
-mysql-dfsg-5.0 (5.0.13rc-1) unstable; urgency=low
-
- * New upstream release. Now "release-candidate"!
- * Removed any dynamic link dependencies to libndbclient.so.0 which
- is due to its version only distributed as a static library.
- * Sean Finney:
- - FTBFS fix related to stripping rpath in debian/rules
-
- -- Christian Hammers <ch@debian.org> Mon, 26 Sep 2005 22:09:26 +0200
-
-mysql-dfsg-5.0 (5.0.12beta-5) unstable; urgency=low
-
- * The recent FTBFS were probably result of a timing bug in the
- debian/patches/75_*.dpatch file where Makefile.in got patched just
- before the Makefile.shared which it depended on. For that reason
- only some of the autobuilders failed. Closes: #330149
- * Fixed chrpath removal (option -k had to be added).
- * Corrected debconf dependency as requested by Joey Hess.
-
- -- Christian Hammers <ch@debian.org> Mon, 26 Sep 2005 18:37:07 +0200
-
-mysql-dfsg-5.0 (5.0.12beta-4) unstable; urgency=low
-
- * Removed experimental shared library libndbclient.so.0.0.0 as it
- is doomed to cause trouble as long as it is present in both MySQL 4.1
- and 5.0 without real soname and its own package. We still have
- libndbclient.a for developers. (thanks to Adam Conrad and
- mediaforest.net). Closes: #329772
-
- -- Christian Hammers <ch@debian.org> Fri, 23 Sep 2005 12:36:48 +0200
-
-mysql-dfsg-5.0 (5.0.12beta-3) unstable; urgency=medium
-
- * Symbol versioning support! wooooohoooooo!
- (thanks to Steve Langasek) Closes: #236288
- * Moved libndbcclient.so.0 to the -dev package as it is provided by
- libmysqlclient14 and -15 which must be installable simultaneously.
- * Removed mysql-*-doc suggestions.
-
- -- Christian Hammers <ch@debian.org> Tue, 20 Sep 2005 00:07:03 +0200
-
-mysql-dfsg-5.0 (5.0.12beta-2) unstable; urgency=low
-
- * Added patch to build on GNU/kFreeBSD (thanks to Aurelien Jarno).
- Closes: #327702
- * Added patch that was already been present on the 4.1 branch which
- makes the "status" command of the init script more sensible
- (thanks to Stephen Gildea). Closes: #311836
- * Added Vietnamese Debconf translation (thanks to Clytie Siddal).
- Closes: #313006
- * Updated German Debconf translation (thanks to Jens Seidel).
- Closes: #313957
- * Corrected commends in example debian-log-rotate.conf. The default is
- unlike the mysql-sever-4.1 package which needed to stay backwards
- compatible now 2 to avoid filling up the disk endlessly.
- * Fixed watch file to be "-beta" aware.
-
- -- Christian Hammers <ch@debian.org> Thu, 15 Sep 2005 20:50:19 +0200
-
-mysql-dfsg-5.0 (5.0.12beta-1) unstable; urgency=medium
-
- * Christian Hammers:
- - New upstream release.
- - Changed build-dep to libreadline5-dev as requested by Matthias Klose.
- Closes: #326316
- - Applied fix for changed output format of SHOW MASTER LOGS for
- binary log rotation (thanks to Martin Krueger). Closes: #326427, #326427
- - Removed explicit setting of $PATH as I saw no sense in it and
- it introduced a bug (thanks to Quim Calpe). Closes: #326769
- - Removed PID file creation from /etc/init.d/mysql-ndb as it does
- not work with this daemon (thanks to Quim Calpe).
- - Updated French Debconf translation (thanks to Christian Perrier).
- Closes: #324805
- - Moved conflicts line in debian/control from libmysqlclient15 to
- libmysqlclient15-dev and removed some pre-sarge conflicts as
- suggested by Adam Majer. Closes: #324623
- * Sean Finney:
- - For posterity, CAN-2005-2558 has been fixed since 5.0.7beta.
-
- -- Christian Hammers <ch@debian.org> Thu, 15 Sep 2005 19:58:22 +0200
-
-mysql-dfsg-5.0 (5.0.11beta-3) unstable; urgency=low
-
- * Temporarily build only with -O2 to circumvent gcc internal errors
- (thanks to Matthias Klose). Related to: #321165
-
- -- Christian Hammers <ch@debian.org> Thu, 18 Aug 2005 15:44:04 +0200
-
-mysql-dfsg-5.0 (5.0.11beta-2) unstable; urgency=low
-
- * Fixed README.Debian regarding the status of mysql-doc.
- * Added "set +e" around chgrp in mysql-server-5.0.preinst to
- not fail on .journal files (thanks to Christophe Nowicki).
- Closes: #318435
-
- -- Christian Hammers <ch@debian.org> Sun, 14 Aug 2005 18:02:08 +0200
-
-mysql-dfsg-5.0 (5.0.11beta-1) unstable; urgency=low
-
- * New upstream version.
- * Added Danish Debconf translations (thanks to Claus Hindsgaul).
- Closes: #322384
- * Updated Czech Debconf translations (thanks to Miroslav Kure).
- Closes: #321765
-
- -- Christian Hammers <ch@debian.org> Sat, 13 Aug 2005 11:56:15 +0000
-
-mysql-dfsg-5.0 (5.0.10beta-1) unstable; urgency=low
-
- * New upstream release.
- * Christian Hammers:
- - Added check for mounted /proc to debian/rules.
- * Sean Finney:
- - fix for fix_mysql_privilege_tables/mysql_fix_privilege_tables typo
- in mysql-server-5.0's README.Debian (see #319838).
-
- -- Christian Hammers <ch@debian.org> Sun, 31 Jul 2005 00:30:45 +0200
-
-mysql-dfsg-5.0 (5.0.7beta-1) unstable; urgency=low
-
- * Second try for new upstream release.
- * Renamed mysql-common-5.0 to mysql-common as future libmysqlclient16
- from e.g. MySQL-5.1 would else introduce mysql-common-5.1 which makes
- a simultanous installation of libmysqlclient14 impossible as that
- depends on either mysql-common or mysql-common-5.0 but not on future
- versions. Thus we decided to always let the newest MySQL version
- provide mysql-common.
- * Added ${misc:Depends} as suggested by debhelper manpage.
- * Raised standard in control file to 3.6.2.
- * Removed DH_COMPAT from rules in faviour of debian/compat.
- * Checkes for presence of init script before executing it in preinst.
- Referres: 315959
- * Added 60_includes_mysys.h__gcc40.dpatch for GCC-4.0 compatibility.
-
- -- Christian Hammers <ch@debian.org> Wed, 29 Jun 2005 00:39:05 +0200
-
-mysql-dfsg-5.0 (5.0.5beta-1) unstable; urgency=low
-
- * New major release! Still beta so be carefull...
- * Added federated storage engine.
-
- -- Christian Hammers <ch@debian.org> Wed, 8 Jun 2005 19:29:45 +0200
-
-mysql-dfsg-4.1 (4.1.12-1) unstable; urgency=low
-
- * Christian Hammers:
- - New upstream release.
- - Disabled BerkeleyDB finally. It has been obsoleted by InnoDB.
- * Sean Finney:
- - Updated French translation from Christian Perrier (Closes: #310526).
- - Updated Japanese translation from Hideki Yamane (Closes: #310263).
- - Updated Russian translation from Yuriy Talakan (Closes: #310197).
-
- -- Christian Hammers <ch@debian.org> Sat, 4 Jun 2005 05:49:11 +0200
-
-mysql-dfsg-4.1 (4.1.11a-4) unstable; urgency=high
-
- * Fixed FTBFS problem which was caused due to the fact that last uploads
- BerkeleyDB patch was tried to applied on all architectures and not only
- on those where BerkeleyDB is actually beeing built. Closes: #310296
-
- -- Christian Hammers <ch@debian.org> Mon, 23 May 2005 00:54:51 +0200
-
-mysql-dfsg-4.1 (4.1.11a-3) unstable; urgency=high
-
- * Added patch from Piotr Roszatycki to compile the bundled db3 library
- that is needed for the BerkeleyDB support with versioned symbols so
- that mysqld no longer crashes when it gets linked together with the
- Debian db3 version which happens when e.g. using libnss-db.
- Closes: #308966
-
- -- Christian Hammers <ch@debian.org> Thu, 19 May 2005 01:41:14 +0200
-
-mysql-dfsg-4.1 (4.1.11a-2) unstable; urgency=high
-
- * Okay, the hackery with /var/lib/dpkg/info/mysql-server.list will not
- stand and is removed from the preinst of mysql-server.
- * New workaround for the symlink problem that does not involve mucking
- with dpkg's file lists is storing the symlinks in a temporary location
- across upgrades.
- As this sometimes fails since apt-get does not always call new.preinst
- before old.postrm, some remarks were added to README.Debian and the
- Debconf installation notes to minimize the inconvinience this causes.
-
- -- sean finney <seanius@debian.org> Sun, 15 May 2005 10:25:31 -0400
-
-mysql-dfsg-4.1 (4.1.11a-1) unstable; urgency=high
-
- * Added the "a" to the version number to be able to upload a new
- .orig.tar.gz file which now has the non-free Docs/ directory removed
- as this has been forgotten in the 4.1.11 release (thanks to Goeran
- Weinholt). Closes: #308691
- * The Woody package listed /var/lib/mysql and /var/log/mysql in its
- /var/lib/dpkg/info/mysql-server.list. These directories are often
- replaced by symlinks to data partitions which triggers a dpkg bug
- that causes these symlinks to be removed on upgrades. The new preinst
- prevents this by removing the two lines from the .list file
- (thanks to Andreas Barth and Jamin W. Collins). See dpkg bug #287978.
- * Updated French Debconf translation (thanks to Christian Perrier).
- Closes: #308353
-
- -- Christian Hammers <ch@debian.org> Thu, 12 May 2005 21:52:46 +0200
-
-mysql-dfsg-4.1 (4.1.11-3) unstable; urgency=high
-
- * The "do you want to remove /var/lib/mysql when purging the package" flag
- from old versions is removed once this package is beeing installed so
- that purging an old Woody mysql-server package while having a
- mysql-server-4.1 package installed can no longer lead to the removal of
- all databases. Additionaly clarified the wording of this versions Debconf
- template and added a check that skips this purge in the postrm script
- if another mysql-server* package has /usr/sbin/mysqld installed.
- (thanks to Adrian Bunk for spotting that problem) Closes: #307473
- * Cronfile was not beeing installed as the filename was not in the
- correct format for "dh_installcron --name" (thanks to Tomislav
- Gountchev). Closes: #302712
-
- -- Christian Hammers <ch@debian.org> Sat, 23 Apr 2005 22:55:15 +0200
-
-mysql-dfsg-4.1 (4.1.11-2) unstable; urgency=low
-
- * Sean Finney:
- - don't freak out if we can't remove /etc/mysql during purge.
- - debian/rules clean works again.
- * Christian Hammers:
- - Fixed typo in README.Debian (thanks to Joerg Rieger). Closes: #304897
- - Completely removed the passwordless test user as it was not only
- insecure but also lead to irritations as MySQL checks first the
- permissions of this user and then those of a password having one.
- See bug report from Hilko Bengen for details. Closes: #301741
-
- -- Christian Hammers <ch@debian.org> Sat, 16 Apr 2005 15:55:00 +0200
-
-mysql-dfsg-4.1 (4.1.11-1) unstable; urgency=low
-
- * New upstream version.
- * Upstream fix for charset/collation problem. Closes: #282256
- * Upstream fix for subselect crash. Closes: #297687
- * Corrected minor issue in Debconf template regarding skip-networking
- (thanks to Isaac Clerencia). Closes: #303417
- * Made dependency to gawk unnecessary (thanks to Zoran Dzelajlija).
- Closes: #302284
- * Removed obsolete 50_innodb_mixlen.dpatch.
- * Removed obsolete 51_CAN-2004-0957_db_grant_underscore.dpatch.
-
- -- Christian Hammers <ch@debian.org> Fri, 8 Apr 2005 00:23:53 +0200
-
-mysql-dfsg-4.1 (4.1.10a-7) unstable; urgency=low
-
- * Sean Finney:
- - fix for the mysteriously disappeared cronjob. thanks to
- Peter Palfrader <weasel@debian.org> for pointing out this omission.
- (closes: #302712).
-
- -- sean finney <seanius@debian.org> Sat, 02 Apr 2005 16:54:13 -0500
-
-mysql-dfsg-4.1 (4.1.10a-6) unstable; urgency=high
-
- * Sean Finney:
- - the previous upload did not completely address the issue. this one
- should do so. d'oh.
-
- -- sean finney <seanius@debian.org> Thu, 31 Mar 2005 03:35:50 +0000
-
-mysql-dfsg-4.1 (4.1.10a-5) unstable; urgency=high
-
- * Sean Finney:
- - the following security issue is addressed in this upload:
- CAN-2004-0957 (grant privilege escalation on tables with underscores)
- thanks to sergei at mysql for all his help with this.
-
- -- sean finney <seanius@debian.org> Wed, 30 Mar 2005 21:19:26 -0500
-
-mysql-dfsg-4.1 (4.1.10a-4) unstable; urgency=low
-
- * Sean Finney:
- - FTBFS fix for amd64/gcc-4.0. Thanks to Andreas Jochens <aj@andaco.de>
- for reporting this (closes: #301807).
- - ANSI-compatible quoting fix in daily cron job. thanks to
- Karl Hammar <karl@aspodata.se> for pointing out the problem in
- the 4.0 branch.
- - Added myself as a co-maintainer in the control file (closes: #295312).
-
- -- sean finney <seanius@debian.org> Tue, 29 Mar 2005 18:54:42 -0500
-
-mysql-dfsg-4.1 (4.1.10a-3) unstable; urgency=low
-
- * BerkeleyDB is now disabled by default as its use is discouraged by MySQL.
- * Added embedded server libraries as they finally do compile.
- They are currently in libmysqlclient-dev as they are still
- experimental and only available as .a library (thanks to Keith Packard).
- Closes: #297062
- * Fixed obsolete "tail" syntax (thanks to Sven Mueller). Closes: #301413
- * Added CAN numbers for the latest security bugfix upload.
- * Updated manpage of mysqlmanager (thanks to Justin Pryzby). Closes: #299844
- * Added comments to default configuration.
-
- -- Christian Hammers <ch@debian.org> Sun, 20 Mar 2005 17:40:18 +0100
-
-mysql-dfsg-4.1 (4.1.10a-2) unstable; urgency=low
-
- * Disabled "--with-mysqld-ldflags=-all-static" as it causes sig11 crashes
- if LDAP is used for groups in /etc/nsswitch.conf. Confirmed by Sean Finney
- and Daniel Dehennin. Closes: #299382
-
- -- Christian Hammers <ch@debian.org> Mon, 14 Mar 2005 03:01:03 +0100
-
-mysql-dfsg-4.1 (4.1.10a-1) unstable; urgency=high
-
- * SECURITY:
- - The following security related updates are addressed:
- CAN-2005-0711 (temporary file creation with "CREATE TEMPORARY TABLE")
- CAN-2005-0709 (arbitrary library injection in udf_init())
- CAN-2005-0710 (arbitrary code execution via "CREATE FUNCTION")
- Closes: #299029, #299031, #299065
- * New Upstream Release.
- - Fixes some server crash conditions.
- - Upstream includes fix for TMPDIR overriding my.cnf tmpdir setting
- Closes: #294347
- - Fixes InnoDB error message. Closes: #298875
- - Fixes resouce limiting. Closes: #285044
- * Improved checking whether or not the server is alive in the init script
- which should make it possible to run several mysqld instances in
- different chroot environments. Closes: #297772
- * Fixed cron script name as dots are not allowed (thanks to Michel
- v/d Ven). Closes: #298447
- * Added -O3 and --with-mysqld-ldflags=-all-static as MySQL recommends to
- build the server binary statically in order to gain about 13% more
- performance (thanks to Marcin Kowalski).
- * Added patch to let mysqld_safe react to signals (thanks to Erich
- Schubert). Closes: #208364
- * (Thanks to Sean Finney for doing a great share of work for this release!)
-
- -- Christian Hammers <ch@debian.org> Thu, 3 Mar 2005 02:36:39 +0100
-
-mysql-dfsg-4.1 (4.1.10-4) unstable; urgency=medium
-
- * Fixed bug that prevented MySQL from starting after upgrades.
- Closes: #297198, #296403
- * Added comment about logging to syslog to the default my.cnf
- and the logrotate script (thanks to Ryszard Lach). Closes: #295507
-
- -- Christian Hammers <ch@debian.org> Thu, 3 Mar 2005 00:28:02 +0100
-
-mysql-dfsg-4.1 (4.1.10-3) unstable; urgency=low
-
- * Sean Finney: Cronjobs now exit silently when the server package
- has been removed but not purged (thanks to Vineet Kumar).
- Closes: #297404
- * Fixed comments of /etc/mysql/debian-log-rotate.conf (thanks to
- Philip Ross). Closes: #297467
- * Made mysqld_safe reacting sane on signals (thanks to Erich Schubert).
- Closes: #208364
-
- -- Christian Hammers <ch@debian.org> Tue, 1 Mar 2005 19:44:34 +0100
-
-mysql-dfsg-4.1 (4.1.10-2) unstable; urgency=low
-
- * Converted to dpatch.
- * debian/ is now maintained via Subversion on svn.debian.org.
-
- -- Christian Hammers <ch@debian.org> Tue, 1 Mar 2005 02:16:36 +0100
-
-mysql-dfsg-4.1 (4.1.10-1) unstable; urgency=low
-
- * New upstream version.
- * Upstream fixed memleak bug. Closes: #205587
- * Added debian/copyright.more for personal reference.
- * Lowered default query cache size as suggested by Arjen from MySQL.
- * Switched from log to log-bin as suggested by Arjen from MySQL.
- * Fixed typo in my.cnf (thanks to Sebastian Feltel). Closes: #295247
- * Replaced --defaults-extra-file by --defaults-file in Debian scripts
- as former lets password/host etc be overwriteable by /root/.my.cnf.
- Added socket to /etc/mysql/debian.cnf to let it work. (thanks to
- SATOH Fumiyasu). Closes: #295170
-
- -- Christian Hammers <ch@debian.org> Tue, 15 Feb 2005 23:47:02 +0100
-
-mysql-dfsg-4.1 (4.1.9-4) unstable; urgency=low
-
- * Improved the way mysqld is started and registered with update-rc.d
- in cases where the admin modifies the runlevel configuration.
- Most notably removed the debconf question whether or not mysql should
- start on when booting. Closes: #274264
- * Renamed configuration option old-passwords to the more preferred
- naming convention old_passwords. Same for some others (thanks to
- Patrice Pawlak). Closes: #293983
-
- -- Christian Hammers <ch@debian.org> Tue, 8 Feb 2005 02:21:18 +0100
-
-mysql-dfsg-4.1 (4.1.9-3) unstable; urgency=low
-
- * Renamed ca_ES.po to ca.po to reach a broader audience (thanks to
- Christian Perrier). Closes: #293786
- * Expicitly disabled mysqlfs support as it has never been enabled by
- configure during the autodetection but fails due to broken upstream
- code when users try to build the package theirselves while having
- liborbit-dev installed which triggers the mysqlfs autodetection
- (thanks to Max Kellermann). Closes: #293431
- * Added dependencies to gawk as one script does not work with original-awk
- (thanks to Petr Ferschmann). Closes: #291634
-
- -- Christian Hammers <ch@debian.org> Sun, 6 Feb 2005 23:33:11 +0100
-
-mysql-dfsg-4.1 (4.1.9-2) unstable; urgency=high
-
- * SECURITY:
- For historical reasons /usr/share/mysql/ was owned and writable by
- the user "mysql". This is a security problem as some scripts that
- are run by root are in this directory and could be modified and used
- by a malicious user who already has mysql privileges to gain full root
- rights (thanks to Matt Brubeck). Closes: #293345
- * Changed "skip-networking" to "bind-address 127.0.0.1" which is more
- compatible and not less secure but maybe even more, as less people enable
- networking for all interfaces (thanks to Arjen Lentz).
- * Enabled InnoDB by default as recommended by Arjen Lentz from MySQL.
- * Added remarks about hosts.allow to README.Debian (thanks to David
- Chappell). Closes: #291300
- * mysql-server-4.1 now provides mysql-server (thanks to Paul van den Berg).
- Closes: #287735
-
- -- Christian Hammers <ch@debian.org> Wed, 2 Feb 2005 23:31:55 +0100
-
-mysql-dfsg-4.1 (4.1.9-1) unstable; urgency=low
-
- * New upstream version.
- * mysql-client-4.1 now provides "mysql-client" so that packages depending
- on mysql-client (ca. 40) can now be used with MySQL-4.1, too.
-
- -- Christian Hammers <ch@debian.org> Sun, 23 Jan 2005 22:52:48 +0100
-
-mysql-dfsg-4.1 (4.1.8a-6) unstable; urgency=high
-
- * SECURITY:
- Javier Fernandez-Sanguino Pena from the Debian Security Audit Project
- discovered a temporary file vulnerability in the mysqlaccess script of
- MySQL that could allow an unprivileged user to let root overwrite
- arbitrary files via a symlink attack and could also could unveil the
- contents of a temporary file which might contain sensitive information.
- (CAN-2005-0004, http://lists.mysql.com/internals/20600) Closes: #291122
-
- -- Christian Hammers <ch@debian.org> Tue, 18 Jan 2005 23:11:48 +0100
-
-mysql-dfsg-4.1 (4.1.8a-5) unstable; urgency=medium
-
- * Fixed important upstream bug that causes from_unixtime(0) to return
- NULL instead of "1970-01-01 00:00:00" which fails on NOT NULL columns.
- Closes: #287792
- * Fixes upstream bug in mysql_list_fields() . Closes: #282486
- * Fixes bug that lead to double rotated logfiles when mysql-server 4.0
- was previously installed (thanks to Olaf van der Spek). Closes: #289851
- * Fixed typo in README.Debian (thanks to Mark Nipper). Closes: #289131
- * Changed max_allowed_packet in my.cnf to 16M as in 4.0.x (thanks to
- Olaf van der Spek). Closes: #289840
- * Updated French debconf translation (thanks to Christian Perrier).
- Closes: #287955
-
- -- Christian Hammers <ch@debian.org> Thu, 13 Jan 2005 01:29:05 +0100
-
-mysql-dfsg-4.1 (4.1.8a-4) unstable; urgency=low
-
- * Broken patch again :-(
-
- -- Christian Hammers <ch@debian.org> Sun, 9 Jan 2005 23:47:55 +0100
-
-mysql-dfsg-4.1 (4.1.8a-3) unstable; urgency=low
-
- * The mutex patch was a bit too x86 centric. This broke the alpha build.
-
- -- Christian Hammers <ch@debian.org> Sun, 9 Jan 2005 14:18:49 +0100
-
-mysql-dfsg-4.1 (4.1.8a-2) unstable; urgency=medium
-
- * Some Makefiles that were patched by me got overwritten by the GNU
- autotools, probably because I also patched ./configure. Fixed now,
- the critical mutex patch is now back in again. Closes: #286961
- * Added patch to make MySQL compile on ARM (thanks to Adam Majer).
- Closes: #285071
-
- -- Christian Hammers <ch@debian.org> Thu, 6 Jan 2005 09:30:13 +0100
-
-mysql-dfsg-4.1 (4.1.8a-1) unstable; urgency=medium
-
- * Upstream 4.1.8 had some problems in their GNU Autotools files so they
- released 4.1.8a. Debian's 4.1.8 was fixed by running autoreconf but this
- again overwrote MySQL changes to ltmain.sh which are supposed to fix some
- problems on uncommon architectures (maybe the FTBFS on alpha, arm, m68k
- and sparc?).
- * libmysqlclient_r.so.14 from 4.1.8-3 also missed a link dependency to
- libz which lead to unresolved symbols visible with "ldd -r" (thanks
- to Laurent Bonnaud). Closes: #287573
-
- -- Christian Hammers <ch@debian.org> Wed, 29 Dec 2004 14:26:33 +0100
-
-mysql-dfsg-4.1 (4.1.8-3) unstable; urgency=low
-
- * Fixed checking for error messages by forcing english language
- output by adding LC_ALL=C to debian-start (thanks to Rene
- Konasz) Closes: #285709
- * Fixed bashisms in Debian scripts. Closes: #286863
- * Updated Japanese Debconf translation (thanks to Hideki Yamane).
- Closes: #287003
- * Improved 4.0 to 4.1 upgrade if /var/lib/mysql is a symlink
- (thanks to Thomas Lamy). Closes: #286560
- * Added patch for FTBFS problem where no LinuxThreads can be found.
- I don't know if this still applies but it should not hurt.
- The patch is debian/patches/configure__AMD64-LinuxThreads-vs-NPTL.diff
-
- -- Christian Hammers <ch@debian.org> Sun, 26 Dec 2004 14:04:20 +0100
-
-mysql-dfsg-4.1 (4.1.8-2) unstable; urgency=low
-
- * If /var/lib/mysql is a symlink then it is kept as such.
- * Added the old-passwords option to the default my.cnf to stay
- compatible to clients that are still compiled to libmysqlclient10
- and libmysqlclient12 for licence reasons.
- * Adjusted tetex build-deps to ease backporting (thanks to Norbert
- Tretkowski from backports.org).
-
- -- Christian Hammers <ch@debian.org> Tue, 21 Dec 2004 01:00:27 +0100
-
-mysql-dfsg-4.1 (4.1.8-1) unstable; urgency=medium
-
- * New upstream version. Closes: #286175
- * Added conflict to libmysqlclient-dev (thanks to Adam Majer).
- Closes: #286538
- * Added debconf-updatepo to debian/rules:clean.
- * Updated Japanese Debconf translation (thanks to Hideki Yamane).
- Closes: #285107
- * Updated French Debconf translation (thanks to Christian Perrier).
- Closes: #285977
- * Renamed cz.po to cs.po (thanks to Miroslav Kure). Closes: #285438
- * Aplied patch for changed server notice to debian-start (thanks to
- Adam Majer). Closes: #286035
- * Changed nice value in default my.cnf as nohup changed its behaviour
- (thanks to Dariush Pietrzak). Closes: #285446
- * Increased verbosity of preinst script in cases where it cannot stop
- a running server (thanks to Jan Minar). Closes: #285982
- * Splitted the code parts of /etc/mysql/debian-start to
- /usr/share/mysql/debian-start.inc.sh (thanks to Jan Minar).
- Closes: #285988
-
- -- Christian Hammers <ch@debian.org> Mon, 20 Dec 2004 00:33:21 +0100
-
-mysql-dfsg-4.1 (4.1.7-4) unstable; urgency=medium
-
- * Removed OpenSSL support.
- After a short discussion with MySQL, I decided to drop OpenSSL support as
- 1. MySQL started shipping their binaries without it, too and do not
- seem to support it in favour of using a different library somewhen.
- 2. MySQL did not adjust their licence to grant permission to link
- against OpenSSL.
- 3. Even if they did, third parties who use libmysqlclient.so often
- do not realise licencing problems or even do not want OpenSSL.
- (thanks to Jordi Mallach and the responders to MySQL bug #6924)
- Closes: #283786
- * debian/control: Improved depends and conflicts to mysql-4.0.
-
- -- Christian Hammers <ch@debian.org> Thu, 2 Dec 2004 22:02:28 +0100
-
-mysql-dfsg-4.1 (4.1.7-3) unstable; urgency=low
-
- * Raised version to make it higher as the one in experimental.
-
- -- Christian Hammers <ch@debian.org> Wed, 1 Dec 2004 21:09:20 +0100
-
-mysql-dfsg-4.1 (4.1.7-2) unstable; urgency=low
-
- * Patched scripts/mysql_install_db so that it no longer creates a
- passwordless test database during installation (thanks to Patrick
- Schnorbus). Closes: #281158
- * Added Czech debconf translation (thanks to Miroslav Kure).
- Closes: #283222
-
- -- Christian Hammers <ch@debian.org> Wed, 1 Dec 2004 01:29:31 +0100
-
-mysql-dfsg-4.1 (4.1.7-1) unstable; urgency=low
-
- * New upstream branch!
- * Adjusted debian/control to make this package suitable to get parallel
- to version 4.0.x into unstable and sarge. The package names are
- different so that "mysql-server" still defaults to the rock-stable
- 4.0 instead to this announced-to-be-stable 4.1.
- * Added --with-mutex=i86/gcc-assemler to the Berkeley-DB configure
- to prevent the use of NPLT threads when compiling under kernel 2.6
- because the binaries are else not runable on kernel 2.4 hosts.
- Closes: #278638, #274598
-
- -- Christian Hammers <ch@debian.org> Sun, 31 Oct 2004 20:15:03 +0100
-
-mysql-dfsg (4.1.6-1) experimental; urgency=low
-
- * New upstream version.
- * Fixed symlinks in libmysqlclient-dev package. Closes: #277028
- * This time I did not update the libtool files as they were pretty
- up to date and I want to have a shorter diff file.
-
- -- Christian Hammers <ch@debian.org> Wed, 20 Oct 2004 00:07:58 +0200
-
-mysql-dfsg (4.1.5-3) experimental; urgency=low
-
- * debian/postinst: mysql_install_db changed parameter from --IN-RPM
- to --rpm which caused problems during installs. Closes: #276320
-
- -- Christian Hammers <ch@debian.org> Sat, 16 Oct 2004 20:36:46 +0200
-
-mysql-dfsg (4.1.5-2) experimental; urgency=low
-
- * Activated support for ndb clustering (thanks to Kevin M. Rosenberg).
- Closes: #275109
-
- -- Christian Hammers <ch@debian.org> Wed, 6 Oct 2004 01:58:00 +0200
-
-mysql-dfsg (4.1.5-1) experimental; urgency=low
-
- * WARNING:
- The upstream branch 4.1 is still considered BETA.
- The Debian packages for 4.1 were done without big testing. If you miss
- a new functionality or binary, contact me and I check add the relevant
- configure option or include the program.
- * New MAJOR upstream version.
- Thanks to the great demand here's now the first MySQL 4.1 experimental
- release. FEEDBACK IS WELCOME.
- * 4.0->4.1 notes:
- - debian/patches/alpha.diff could not be applied, I fix that later
- - debian/patches/scripts__mysql_install_db.sh.diff was obsolete
- - debian/patches/scripts__Makefile.in was neccessary due to a dependency
- to the removed non-free Docs/ directory. Upstream has been contacted.
- - Build-Deps: += automake1.7
- - debian/rules: embedded servers examples did not compile, removed
-
- -- Christian Hammers <ch@debian.org> Sun, 26 Sep 2004 19:46:47 +0200
-
-mysql-dfsg (4.0.21-3) unstable; urgency=low
-
- * Upstream tried to fix a security bug in mysqlhotcopy and broke it :-)
- Applied a patch (see debian/patches) from Martin Pitt. Closes: #271632
- * Between 4.0.20 and 4.0.21 the Debian specific changes in
- /usr/bin/mysqld_safe that piped the error log to syslog got lost
- and are now back again.
- * Fixed capitalization in debconf headings.
- * Changed wording of the initscript status message to make heartbeat
- happier. Closes: #271591
-
- -- Christian Hammers <ch@debian.org> Fri, 17 Sep 2004 18:42:25 +0200
-
-mysql-dfsg (4.0.21-2) unstable; urgency=medium
-
- * The dependencies between mysql-client and libmysqlclient12 were
- too loose, when upgrading only the client this can lead to non working
- binaries due to relocation errors (thanks to Dominic Cleal).
- Closes: #271803
- * Fixed typo in mysqldump.1 manpage (thanks to Nicolas Francois).
- Closes: #271334
-
- -- Christian Hammers <ch@debian.org> Wed, 15 Sep 2004 15:38:11 +0200
-
-mysql-dfsg (4.0.21-1) unstable; urgency=high
-
- * SECURITY:
- This upstream version fixes some security problems that might at least
- allow a DoS attack on the server.
- * Fixed an old bug in concurrent accesses to `MERGE' tables (even
- one `MERGE' table and `MyISAM' tables), that could've resulted in
- a crash or hang of the server. (Bug #2408)
- * Fixed bug in privilege checking where, under some conditions, one
- was able to grant privileges on the database, he has no privileges
- on. (Bug #3933)
- * Fixed crash in `MATCH ... AGAINST()' on a phrase search operator
- with a missing closing double quote. (Bug #3870)
- * Fixed potential memory overrun in `mysql_real_connect()' (which
- required a compromised DNS server and certain operating systems).
- (Bug #4017)
- * New upstream version.
- * Fixes bug that made x="foo" in WHERE sometimes the same as x="foo ".
- Closes: #211618
- * Updated Japanese Debconf translation (thanks to Hideki Yamane).
- Closes: #271097
-
- -- Christian Hammers <ch@debian.org> Sat, 11 Sep 2004 23:15:44 +0200
-
-mysql-dfsg (4.0.20-14) unstable; urgency=low
-
- * Dave Rolsky spottet that -DBIG_JOINS was not properly enabled.
- It allowes joining 64 instead of an 32 tables to join.
-
- -- Christian Hammers <ch@debian.org> Thu, 9 Sep 2004 20:24:02 +0200
-
-mysql-dfsg (4.0.20-13) unstable; urgency=medium
-
- * Fixed a bug in the initscript which caused the check for not properly
- closed i.e. corrupt tables that is executed when the server starts
- not to run in background as supposed.
- Although the check does not repair anything on servers with several
- thousand tables the script was reported to take some minutes which
- is quite annoying. (Thanks to Jakob Goldbach). Closes: #270800
-
- -- Christian Hammers <ch@debian.org> Thu, 9 Sep 2004 17:11:05 +0200
-
-mysql-dfsg (4.0.20-12) unstable; urgency=medium
-
- * Filter messages regarding table handles that do not support CHECK TABLE
- in the script that checks for corrupted tables on every start which lead
- to unnecessary mails (thanks to David Everly). Closes: #269811
- * Added a note to the corrupt-table-check mail which notes that a
- false-positive is reported in the case that immediately after starting
- the server a client starts using a table (thanks to Uwe Kappe).
- Closes: #269985
- * Added "quote-names" as default to the [mysqldump] section in
- /etc/mysql/my.cnf as too many users stumble over dump files that
- could not be read in again due to the valid use of reserved words
- as table names. This has also be done by upstream in 4.1.1 and has
- no known drawbacks. Closes: #269865
- * Binary logs can now be rotated as well. Defaults to off, though, for
- compatibilty reasons (thanks to Mark Ferlatte). Closes: #94230, #269110
- * The mysql user "debian-sys-maint" now gets all possible rights which
- makes binary logging possible and helps other package maintainer who
- wants to use it to create package specific databases and users.
- * Added example how to change daemon nice level via /etc/mysql/my.cnf
- * Updated French debconf translations (thanks to Christian Perrier).
- Closes: #265811
- * Renamed options in the default config file that still had old names
- (thanks to Yves Kreis). Closes: #266445
- * Fixed spelling in debconf note.
- * Added -l and -L to dh_shlibdeps.
-
- -- Christian Hammers <ch@debian.org> Fri, 3 Sep 2004 20:10:46 +0200
-
-mysql-dfsg (4.0.20-11) unstable; urgency=high
-
- * SECURITY
- This version fixes a security flaw in mysqlhotcopy which created
- temporary files in /tmp which had predictable filenames and such
- could be used for a tempfile run attack.
- The issue has been recorded as CAN-2004-0457.
-
- -- Christian Hammers <ch@debian.org> Sat, 14 Aug 2004 18:27:19 +0200
-
-mysql-dfsg (4.0.20-10) unstable; urgency=low
-
- * MySQL finally updated their copyright page and installed v1.5 of
- the "Free/Libre and Open Source Software License (FLOSS) - Exception"
- which will hopefully end the license hell they created by putting the
- client libraries under GPL instead of LGPL which conflicts with PHP and
- other software that used to link against MySQL.
- The license text is not yet in any release MySQL version but visible
- on their web site and copied into the debian/copyright file.
- Special thanks to Zak Greant <zak@mysql.com> and the debian-legal list
- for helping to solve this release critical problem.
- Closes: #242449
- * Updated Brazil debconf translation (thanks to Andre Luis Lopes).
- Closes: #264233
- * Updated Japanese debconf translation (thanks to Hideki Yamane).
- Closes: #264620
- * Fixed minor typo in debconf description (thanks to TROJETTE Mohammed
- Adnene). Closes: #264840
- * Improved init and preinst script which now detects stalled servers which
- do no longer communicate but are present in the process list (thanks to
- Henrik Johansson). Closes: #263215
-
- -- Christian Hammers <ch@debian.org> Mon, 9 Aug 2004 19:44:28 +0200
-
-mysql-dfsg (4.0.20-9) unstable; urgency=medium
-
- * Partly reverted the last patch which gave the mysql-user
- "debian-sys-maint" more rights as there are old versions of MySQL which
- have fewer privlige columns. Now only those are set (thanks to Alan Tam).
- Closes: #263111
-
- -- Christian Hammers <ch@debian.org> Tue, 3 Aug 2004 13:03:02 +0200
-
-mysql-dfsg (4.0.20-8) unstable; urgency=low
-
- * The mysqlcheck that is started from the initscript will now be
- backgrounded because it might else prevent the boot process to continue.
- It also now notifies root by mail and syslog if a table is corrupt.
- * The "debian-sys-maint" MySQL user now has almost full rights so that other
- packages might use this account to create databases and user (thanks to
- Andreas Barth). Closes: #262541
- * Added paranoid rules for logcheck.
-
- -- Christian Hammers <ch@debian.org> Sun, 1 Aug 2004 21:00:55 +0200
-
-mysql-dfsg (4.0.20-8) unstable; urgency=low
-
- * Upload stalled. Not released.
-
- -- Christian Hammers <ch@debian.org> Sun, 1 Aug 2004 20:27:55 +0200
-
-mysql-dfsg (4.0.20-7) unstable; urgency=medium
-
- * Solved the upstream bug that error messages of the server are written
- in a file that is then rotated away leaving mysqld logging effectively
- to /dev/null. It now logs to a /usr/bin/logger process which puts the
- messages into the syslog.
- Modified files: /etc/init.d/mysql, /usr/bin/mysqld_safe and the
- logchecker files. Closes: #254070
- * The initscript does no longer call mysqlcheck directly but via
- /etc/mysql/debian-start which is a user customizable config script.
- * Splitted the debconf "install and update notes" and only show them
- when it is appropriate (thanks to Steve Langasek). Closes: #240515
- * Added NEWS.Debian.
- * Added hint to -DBIG_ROWS, which is currently not used, to README.Debian.
- * Corrected typo in myisampack manpage (thanks to Marc Lehmann).
- Closes: #207090
- * Added Catalan debconf translation (thanks to Aleix Badia i Bosch).
- Closes: #236651
-
- -- Christian Hammers <ch@debian.org> Wed, 28 Jul 2004 01:41:51 +0200
-
-mysql-dfsg (4.0.20-6) unstable; urgency=low
-
- * The build arch detected by configure was "pc-linux-gnu (i686)"
- instead of "pc-linux-gnu (i386)". Was no problem AFAIK but
- Adam Majer asked me to explicitly change it to i386. Closes: #261382
- * Removed some unused shell scripts from /usr/share/mysql.
- * Added lintian overrides.
- * Removed rpath by using chrpath.
-
- -- Christian Hammers <ch@debian.org> Mon, 26 Jul 2004 00:17:12 +0200
-
-mysql-dfsg (4.0.20-5) unstable; urgency=medium
-
- * The mysqlcheck in the init script is only called when the server
- is really alive. Also, the mysql-user 'debian-sys-maint' now has
- global select rights (thanks to Nathan Poznick). Closes: #261130
- * Moved the debconf question whether to remove the databases or not
- from mysql-server.config to mysql-server.postrm so that it shows
- up on purge time and not months earlier (thanks to Wouter Verhelst).
- Closes: #251838
-
- -- Christian Hammers <ch@debian.org> Fri, 23 Jul 2004 22:41:13 +0200
-
-mysql-dfsg (4.0.20-4) unstable; urgency=low
-
- * Added a "mysqlcheck -A --fast" to the 'start' section of the
- init script to help admins detect corrupt tables after a server crash.
- Currently it exists with an error message but leaves the server
- running. Feedback appreciated!
- * Made postinst script more robust by calling db_stop earlier and
- so prevent pipe-deadlocks.
- * Fixed minor typos in initscript (thanks to "C.Y.M."). Closes: 259518
- * Added the undocumented "-DBIG_JOINS" that MySQL apparently uses in
- their MAX binaries. It enables 62 instead of 30 tables in a "join".
- (thanks to Dave Rolsky). Closes: #260843
- * Added a "df --portability /var/lib/mysql/." check to the preinst
- script as users experienced hard to kill hanging mysqlds in such
- a situation (thanks to Vaidas Pilkauskas). Closes: #260306
-
- -- Christian Hammers <ch@debian.org> Fri, 23 Jul 2004 00:51:32 +0200
-
-mysql-dfsg (4.0.20-3) unstable; urgency=low
-
- * Improved tolerance if the init script has been deleted (thanks to
- Leonid Shulov for spotting the problem).
- * Minor wording changes to README.Debian generalizing /root/ by $HOME
- (thanks to Santiago Vila). Closes: #257725
- * Added Japanese debconf translation (thanks to Hideki Yamane).
- Closes: #256485
- * Fixed commend in my.cnf regarding logfile directory (thanks to Jayen
- Ashar). Closes: #253434
- * Correted "ease to" by "ease of" in package description (thanks to
- Johannes Berg). Closes: #253510
-
- -- Christian Hammers <ch@debian.org> Fri, 9 Jul 2004 00:57:42 +0200
-
-mysql-dfsg (4.0.20-2) unstable; urgency=low
-
- * Removed RPM .spec file from the included documentation as it is pretty
- useless (thanks to Loic Minier).
- * Added turkish debconf translation (thanks to Recai Oktas). Closes: #252802
-
- -- Christian Hammers <ch@debian.org> Sun, 6 Jun 2004 14:48:26 +0200
-
-mysql-dfsg (4.0.20-1) unstable; urgency=low
-
- * New upstream version.
-
- -- Christian Hammers <ch@debian.org> Mon, 31 May 2004 23:36:39 +0200
-
-mysql-dfsg (4.0.18-8) unstable; urgency=low
-
- * Updated french translation (thanks to Christian Perrier). Closes: #246789
-
- -- Christian Hammers <ch@debian.org> Tue, 4 May 2004 23:26:54 +0200
-
-mysql-dfsg (4.0.18-7) unstable; urgency=low
-
- * Added CVE ids for the recent security fixes.
- 4.0.18-4 is CAN-2004-0381 (mysqlbug) and
- 4.0.18-6 is CAN-2004-0388 (mysql_multi)
-
- -- Christian Hammers <ch@debian.org> Mon, 19 Apr 2004 18:32:03 +0200
-
-mysql-dfsg (4.0.18-6) unstable; urgency=medium
-
- * SECURITY:
- Fixed minor tempfile-run security problem in mysqld_multi.
- Unprivileged users could create symlinks to files which were then
- unknowingly overwritten by run when this script gets executed.
- Upstream informed. Thanks to Martin Schulze for finding this.
-
- -- Christian Hammers <ch@debian.org> Wed, 7 Apr 2004 01:28:22 +0200
-
-mysql-dfsg (4.0.18-5) unstable; urgency=low
-
- * Little improvements in debian scripts for last upload.
- * Added check to logrotate script for the case that a mysql
- server is running but not be accessible with the username and
- password from /etc/mysql/debian.conf (thanks to Jeffrey W. Baker).
- Closes: 239421
-
- -- Christian Hammers <ch@debian.org> Sun, 4 Apr 2004 15:27:40 +0200
-
-mysql-dfsg (4.0.18-4) unstable; urgency=medium
-
- * SECURITY:
- Aplied fix for unprobable tempfile-symlink security problem in
- mysqlbug reported by Shaun Colley on bugtraq on 2004-03-24.
- * Updated french debconf translation (thanks to Christian Perrier).
- Closes: #236878
- * Updated portugesian debconf translation (thanks to Nuno Senica).
- Closes: #239168
- * Updated german debconf translation (thanks to Alwin Meschede).
- Closes: #241749
- * Improved debconf template regarding fix_privileges_tables (thanks
- to Matt Zimmermann for suggestions). Closes: #219400
- * Improved README.Debian regarding to password settings (thanks to
- Yann Dirson). Closes: #241328
-
- -- Christian Hammers <ch@debian.org> Sat, 3 Apr 2004 19:52:15 +0200
-
-mysql-dfsg (4.0.18-3) unstable; urgency=medium
-
- * Added Build-Depend to po-debconf to let it build everywhere.
-
- -- Christian Hammers <ch@debian.org> Wed, 31 Mar 2004 23:43:33 +0200
-
-mysql-dfsg (4.0.18-2) unstable; urgency=low
-
- * Added a "2>/dev/null" to a "which" command as there are two
- "which" versions in Debian of which one needs it. Closes: #235363
-
- -- Christian Hammers <ch@debian.org> Tue, 2 Mar 2004 23:31:28 +0100
-
-mysql-dfsg (4.0.18-1) unstable; urgency=low
-
- * New upstream version.
- * Should now compile and run on ia64 (thanks to Thorsten Werner and
- David Mosberger-Tang). Closes: #226863 #228834
- * Converted init scripts to invoce-rc.d (thanks to Erich Schubert).
- Closes: 232118
- * Secondlast upload changed logfile location. Closes: #182655
- * Updated Brasilian translation (thanks to Andre Luis Lopes). Closes:
- #219847
-
- -- Christian Hammers <ch@debian.org> Tue, 17 Feb 2004 23:44:58 +0100
-
-mysql-dfsg (4.0.17-2) unstable; urgency=low
-
- * Improved manpage for mysqldumpslow.1 (thanks to Anthony DeRobertis).
- Closes: #231039
- * Improved stopping of crashed daemons in init script (thanks to
- Matthias Urlichs). Closes: #230327
-
- -- Christian Hammers <ch@debian.org> Mon, 9 Feb 2004 21:54:29 +0100
-
-mysql-dfsg (4.0.17-1) unstable; urgency=low
-
- * Made logging into /var/log/mysql/ the default. Closes: #225206
-
- * New upstream version. Closes: #225028
- * Turned on a 25MB query cache by default (thanks to Cyril Bouthors).
- Closes: #226789
- * Updated russian translation (thanks to Ilgiz Kalmetev). Closes: #219263
- * Upstream fixes the problem that AND was not commutative (thanks for
- Iain D Broadfoot for mentioning). Closes: #227927
- * Fixed minor typo in my.cnf comments (thanks to James Renken).
- Closes: #221496
- * Better documents regex. Closes: #214952
- * Fixed minor germanism in debconf template (thanks to Marc Haber).
- Closes: #224148
- * Added explaining comment to my.cnf regarding quoted passwords
- (Thanks to Patrick von der Hagen). Closes: #224906
- * Changed "find -exec" to "find -print0 | xargs -0" in preinst to
- speed it up. Thanks to Cyril Bouthors. Closes: #220229
-
- -- Christian Hammers <ch@debian.org> Sun, 18 Jan 2004 16:16:25 +0100
-
-mysql-dfsg (4.0.16-2) unstable; urgency=low
-
- * Tried to repair undefined weak symbols by adding a little Makefile
- patch. Closes: #215973
-
- -- Christian Hammers <ch@debian.org> Mon, 27 Oct 2003 22:52:10 +0100
-
-mysql-dfsg (4.0.16-1) unstable; urgency=low
-
- * New upstream release.
- (Mostly little memory problems and other bugfixes it seems)
- * Replaced "." by ":" in chown calls to comply with the env setting
- "_POSIX2_VERSION=2000112" (thanks to Robert Luberda). Closes: #217399
- * Adjusted syntax in my.cnf to 4.x standard (thanks to Guillaume Plessis).
- Closes: #217273
- * Improved README.Debian password instructions (thanks to Levi Waldron).
- Closes: #215046
- * Improved NIS warning debconf-template (thanks to Jeff Breidenbach).
- Closes: #215791
- * Explicitly added libssl-dev to the libmysqlclient-dev package as it
- is needed for mysql_config and the libmysqlclient package only depends
- on libssl which has no unnumbered .so version (thanks to Simon Peter
- and Davor Ocelic). Closes: #214436, #216162
- * Added "-lwrap" to "mysql_config --libmysqld-libs" and filed it as
- upstream bug #1650 (thanks to Noah Levitt). Closes: #214636
-
- -- Christian Hammers <ch@debian.org> Sat, 25 Oct 2003 01:09:27 +0200
-
-mysql-dfsg (4.0.15a-1) unstable; urgency=low
-
- * Same package as 4.0.15-2 but I could not convince the Debian
- installer to move the packages out of incoming.
-
- -- Christian Hammers <ch@debian.org> Tue, 7 Oct 2003 15:10:26 +0200
-
-mysql-dfsg (4.0.15-2) unstable; urgency=low
-
- * Updated package description (thanks to Adrian Bunk). Closes: #210988
- * Fixed small typos in manpages (thanks to Nicolas Francois).
- Closes: #211983
- * More updates to package description (thanks to Matthias Lutz/ddtp).
- Closes: #213456
- * Updated standards to 3.6.1.
- * Closes "new 4.0.15 available" bug. Closes: #213349
- * Updated README.Debian with notes regarding the MySQL manual section
- "2.4 Post-installation Setup and Testing" (thanks to Daniel B.).
- Closes: #210841
-
- -- Christian Hammers <ch@debian.org> Fri, 3 Oct 2003 15:59:39 +0200
-
-mysql-dfsg (4.0.15-1) unstable; urgency=high
-
- * SECURITY:
- Users who are able to use the "ALTER TABLE" command on the "mysql"
- database may be able to exploit this vulnerability to gain a shell with
- the privileges of the mysql server (usually running as the 'mysql' user).
- Closes: #210403
- * Fixes small description typos (thanks to Oscar Jarkvik).
- * Updated Brazilian Portuguese debconf translation. (thanks to Andre Luis
- Lopes). Closes: 208030
- * Replaced depricated '.' by ':' in chown (thanks to Matt Zimmerman).
- * Fixed manpage typo (thanks to Marc Lehmann). Closes: #207090
-
- -- Christian Hammers <ch@debian.org> Fri, 3 Oct 2003 15:59:35 +0200
-
-mysql-dfsg (4.0.14-1) unstable; urgency=low
-
- * New upstream version.
-
- -- Christian Hammers <ch@debian.org> Sun, 24 Aug 2003 16:40:36 +0200
-
-mysql-dfsg (4.0.13-3) unstable; urgency=low
-
- * Now start mysqld as default unless you choose not when configurig
- with debconf priority low. So packages depending on the server when
- installing can access it. Thanks Matt Zimmermann (Closes: #200277)
- * Made mysql-server de-installable if the config and database files were
- removed by hand before. Thanks to Ard van Breemen (Closes: #200304)
-
- -- Christian Hammers <ch@debian.org> Tue, 8 Jul 2003 22:30:40 +0200
-
-mysql-dfsg (4.0.13-2) unstable; urgency=low
-
- * Added "nice" option for mysqld_safe to give mysqld a different priority.
- Submitted to upstream as MySQL Bug #627. Closes: #192087
- * Fixed possible unbound variable in init script. Closes: #194621
- * Fixed french debconf translation (thx Christian Perrier) Closes: #194739
- * Get rid of automake1.5 (for Eric Dorland).
-
- -- Christian Hammers <ch@debian.org> Wed, 11 Jun 2003 18:58:32 +0200
-
-mysql-dfsg (4.0.13-1) unstable; urgency=medium
-
- * New upstream version.
- !!! Fixes a very bad natural join bug which justifies the urgency=medium.
- !!! http://bugs.mysql.com/bug.php?id=291
- * Fixed mysql_fix_privileges manpage (Frederic Briere) Closes: #191776
- * preinst: "which" is more chatty normal executable than as builtin.
- (Thanks to David B Harris). Closes: #188659
-
- -- Christian Hammers <ch@debian.org> Tue, 6 May 2003 22:03:45 +0200
-
-mysql-dfsg (4.0.12-3) unstable; urgency=medium
-
- * Reincluded new way of creating my debian-sys-maint user from
- an old release from experimental. Now works again with old
- and new privilege table format. (Thanks to Vincent Danjean
- for spotting the problem) Closes: #188201
- * Reincluded hurd build dependency fix from 3.23 branch.
- (Thanks to Robert Millan). Closes: #185929
- * Fixed soname in libmysqlclient-dev. Closes: #188160
- * Remove /var/log/mysql/ when purging the package. Closes: #188064
- * Removed /usr/share/doc/mysql/ from mysql-server. Closes: #188066
- * Let group "adm" be able to read logfiles. Closes: #188067
- * Do not call usermod on every upgrade. Closes: #188248
- (Thanks to Philippe Troin for the last three)
- * Fixed mysql-server.preinst so that it works on shells where
- which is a builtin, too. (Thanks to Erich Schubert) Closes: #181525
-
- -- Christian Hammers <ch@debian.org> Fri, 11 Apr 2003 11:32:45 +0200
-
-mysql-dfsg (4.0.12-2) unstable; urgency=low
-
- *
- * NEW MAJOR UPSTREAM RELEASE:
- *
- MySQL 4 has finally been declared as 'stable'. Hurray! Read changelogs.
- Thanks to all testers, esp. Jose Luis Tallon, of the versions
- that were in the "experimental" section before.
- * Modified postinst script to run mysql_fix_privileges on every update.
- IMPORTANT: Please report if this breaks anything, it is not supposed to.
- * Wrote a SSL-MINI-HOWTO.txt!
- * Added zlib1g-dev to libmysqlclient12-dev. Closes: 186656
- * Changed section of libmysqlclient12-dev to libdevel.
- * Added even more selfwritten manpages.
- * Fixed typos.
-
- -- Christian Hammers <ch@debian.org> Sun, 6 Apr 2003 13:47:32 +0200
-
-mysql-dfsg (4.0.10.gamma-1) experimental; urgency=low
-
- * New upstream version.
- * They merged some of my patches from debian/patches. Whoa!
- * This release should fix the error-logfile problem where mysqld
- keeps the error.log open while logrotate removes it.
-
- -- Christian Hammers <ch@debian.org> Wed, 12 Feb 2003 22:39:48 +0100
-
-mysql-dfsg (4.0.9.gamma-1) experimental; urgency=low
-
- * New upstream version.
- * Updated the GNU autoconf files to make building on MIPS work.
- See bug #176829.
-
- -- Christian Hammers <ch@debian.org> Wed, 29 Jan 2003 22:07:44 +0100
-
-mysql-dfsg (4.0.8.gamma-1) experimental; urgency=low
-
- * New upstream release.
- * Improved logging of init script. Closes: #174790
- * We have now libmysqlclient.so.12 instead of .11.
-
- -- Christian Hammers <ch@debian.org> Thu, 9 Jan 2003 20:14:11 +0100
-
-mysql-dfsg (4.0.7.gamma-1) experimental; urgency=high
-
- * SECURITY: This version fixes an upstream security release that is only
- present in the 4.x branch which is currently only in the
- experimental distribution and therefore will not get a DSA.
- * New upstream release.
-
- -- Christian Hammers <ch@debian.org> Sat, 28 Dec 2002 15:51:39 +0100
-
-mysql-dfsg (4.0.6.gamma-2) experimental; urgency=low
-
- * Added --system to addgroup. Closes: #173866
-
- -- Christian Hammers <ch@debian.org> Sat, 21 Dec 2002 15:28:26 +0100
-
-mysql-dfsg (4.0.6.gamma-1) experimental; urgency=low
-
- * New upstream version. Now Gamma!
- * There are no longer changes to the .orig.tar.gz neccessary to make diff
- happy. docs/ has still to be deleted, although, as it is non-free.
- * Incorporated patches from unstable.
- * Added mysqlmanager and a couple of other new scripts.
- * Enabled libmysqld embedded server library.
- * Enabled SSL and Virtual-IO support.
- (CORBA based MySQL-FS seems to be not existing..)
-
- -- Christian Hammers <ch@debian.org> Fri, 20 Dec 2002 22:30:51 +0100
-
-mysql-dfsg (4.0.5a.beta-3) experimental; urgency=low
-
- * Modified postinst to work with old and new mysql.user table format
- and fixed spelling typo in postinst. Thanks to Roger Aich.
- * Updated config.{guess,sub} to make the mipsel porters happy.
- Thanks to Ryan Murray. Closes: #173553
-
- -- Christian Hammers <ch@debian.org> Wed, 18 Dec 2002 15:56:34 +0100
-
-mysql-dfsg (4.0.5a.beta-2) experimental; urgency=low
-
- * Upstream removed option "--skip-gemini". So did I. Closes: 173142
-
- -- Christian Hammers <ch@debian.org> Tue, 17 Dec 2002 10:35:49 +0100
-
-mysql-dfsg (4.0.5a.beta-1) experimental; urgency=low
-
- * First 4.x experimental package due to continuous user requests :-)
- Please test and report!
- * upstream: safe_mysqld has been renamed to mysqld_safe
- * upstream: new library soname version libmysqlclient.so.11
- * Renamed libmysqlclientXX-dev to libmysqlclient-dev as I don't plan to
- support more than one development environment and this makes the
- dependencies easier.
- * FIXME: Skipped parts of the debian/patches/alpha patch as the global.h
- is not existing.
- * FIXME: How to get rid this? Old ltconfig patch already applied.
- "lintian: binary-or-shlib-defines-rpath ./usr/bin/mysql /usr/lib/mysql"
-
- -- Christian Hammers <ch@debian.org> Sun, 1 Dec 2002 18:32:32 +0100
-
-mysql-dfsg (3.23.53-4) unstable; urgency=medium
-
- * Fixed errno.h problem. Closes: #168533, #168535
-
- -- Christian Hammers <ch@debian.org> Sun, 10 Nov 2002 18:32:08 +0100
-
-mysql-dfsg (3.23.53-3) unstable; urgency=medium
-
- * Changed automake build-dep to unversioned automake1.4. Closes: #166391
- * Fixed description. Closes: #167270
- (Thanks to Soren Boll Overgaard)
-
- -- Christian Hammers <ch@debian.org> Tue, 5 Nov 2002 01:25:01 +0100
-
-mysql-dfsg (3.23.53-2) unstable; urgency=low
-
- * Reverted user creation in init scripts. Closes: #166432
- (Thanks to Birzan George Cristian)
-
- -- Christian Hammers <ch@debian.org> Thu, 31 Oct 2002 15:36:25 +0100
-
-mysql-dfsg (3.23.53-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Christian Hammers <ch@debian.org> Thu, 24 Oct 2002 23:04:16 +0200
-
-mysql-dfsg (3.23.52-3) unstable; urgency=low
-
- * Substituted the first-install 'debian-sys-maint' user creation by
- something ANSI SQL compliant. Closes: #163497
- (Thanks to Karl Hammar)
- * Tightend dependency to debhelper (>= 4.0.12) to be sure that
- debconf-utils gets installed, too, as I use dh_installdebconf.
- * Fixed upstream manpage bug in mysqldump.1. Closes: #159779
- (Thanks to Colin Watson)
- * Added comment about MIN_WORD_LEN to mysql-server.README.Debian
- (Thanks to Philipp Dreimann)
- * Added a dependency for zlib1g-dev to libmysqlclient10-dev.
- (Thanks to Jordi Mallach)
-
- -- Christian Hammers <ch@debian.org> Sun, 15 Sep 2002 17:14:44 +0200
-
-mysql-dfsg (3.23.52-2) unstable; urgency=low
-
- * Fixed typo in preinst scripts.
- * Removed bashism in init script.
- * Fixed ambiguous debconf example. Closes: #158884
-
- -- Christian Hammers <ch@debian.org> Fri, 30 Aug 2002 00:51:29 +0200
-
-mysql-dfsg (3.23.52-1) unstable; urgency=low
-
- * New upstream version. Closes: #157731
- * Clearified the meaning of the debian-sys-maint special user in the
- README.Debian file. Closes: #153702
- * Wrote some words regarding the skip-networking in README.Debian.
- Closes: #157038
- * Added dependency to passwd.
- * Fixes typo and unnecessarily complication in is_mysql_alive().
- * Added check for /etc/mysql/my.cnf in init script.
-
- -- Christian Hammers <ch@debian.org> Tue, 27 Aug 2002 01:53:32 +0200
-
-mysql-dfsg (3.23.51-4) unstable; urgency=low
-
- * Added a compressed "nm mysqld" output to allow people to trace
- core dumps with /usr/bin/resolve_stack_dump as suggested in the
- INSTALL-SOURCE file. Thanks to atudor@labs.agilent.com for the hint.
-
- -- Christian Hammers <ch@debian.org> Wed, 24 Jul 2002 20:44:55 +0200
-
-mysql-dfsg (3.23.51-3) unstable; urgency=low
-
- * Corrected copyright file: the MySQL client library is licenced under
- the LGPL-2 not the GPL. From version 4.x it actually will be GPL this
- is why parts of http://www.mysql.com/ already say so. Closes: #153591
- * Corrected german translation.
- Thanks to Roland Rosenfeld <roland@spinnaker.de>. Closes: #151903
-
- -- Christian Hammers <ch@debian.org> Thu, 11 Jul 2002 20:32:28 +0200
-
-mysql-dfsg (3.23.51-2) unstable; urgency=low
-
- * Improved NIS tolerance in preinst script.
-
- -- Christian Hammers <ch@debian.org> Sun, 7 Jul 2002 04:43:28 +0200
-
-mysql-dfsg (3.23.51-1) unstable; urgency=medium
-
- * New upstream version.
- * I applied a patch that fixes a binary imcompatibility in
- the shared libary libmysqlclient.so.10 between 3.23.50 and
- some versions earlier. Upstream has been contacted and asked
- for clarification. Closes: #149952
- * Added support for NIS i.e. it shows a warning and fails if the
- needed 'mysql' user does not exists but works if it does.
- Closes: #143282, #147869
- * Substituted $0 in init scripts by something really weird so that
- "./S20mysql restart" works now, too. (BTW: S20? install file-rc!!!)
- Closes: #148658
- * Now postinst works even if /etc/init.d/mysql is removed. Closes: #151021
- * Decided to leave "set +x" in postinst but wrote comment. Closes: #151022
-
- -- Christian Hammers <ch@debian.org> Sun, 7 Jul 2002 04:43:25 +0200
-
-mysql-dfsg (3.23.50-1) unstable; urgency=medium
-
- * New upstream version.
- Fixes a very annoying and important bug that lets all mysql programs
- including perl scripts etc. segfault when using the read_default_group()
- function. 3.23.50 is currently a pre-release and expected to be released
- next week. I plan to propose it for woody as soon as its stability has
- been proven. The following bug reports are all regarding this issue.
- Closes: #144960, #145322, #136798, #138143,
-
- -- Christian Hammers <ch@debian.org> Sat, 18 May 2002 21:14:01 +0200
-
-mysql-dfsg (3.23.49x-1) unstable; urgency=low
-
- * I had to split the package to seperate the manual as it is not GPL
- like the rest of the software and docs but under a license that
- e.g. forbids selling printed versions.
- .
- The upstream authors were contacted a while ago but did not like to
- change the situation.
- .
- The names of the resulting packages have not changed as the manual
- already was in a seperate mysql-doc package due to it's size.
- The source packages are now splitted from one "mysql" to
- "mysql-dfsg" in main and "mysql-nonfree" in non-free.
- * No code change!
- The "x" at the end of the version number ist just to be able to
- upload a new source package. ("a" was already taken by upstream
- for their binary upload correction)
-
- -- Christian Hammers <ch@debian.org> Wed, 8 May 2002 02:01:41 +0200
-
-mysql (3.23.49-8) unstable; urgency=low
-
- * Substituted $0 in init script to let e.g. "/etc# ./init.d/mysql restart"
- works, too. Closes: #141555
-
- -- Christian Hammers <ch@debian.org> Sun, 7 Apr 2002 15:00:44 +0200
-
-mysql (3.23.49-7) unstable; urgency=low
-
- * The Makefiles are totally broken for the --enable-local-infile
- option. I now patched libmysql/libmysql.c#mysql_init() manually.
- Closes: #138347
-
- -- Christian Hammers <ch@debian.org> Fri, 29 Mar 2002 23:55:15 +0100
-
-mysql (3.23.49-6) unstable; urgency=low
-
- * Moved mysqlcheck from server to client package. Closes: #139799
- * Added manpage for mysqlhotcopy. Regarding: #87097
- * Added 'sharedscripts' directive to the logrotate script.
- * Replaced grep by /usr/bin/getent to let the group/user checking work
- on NIS/LDAP systems, too. Closes: #115677, #101529
-
- -- Christian Hammers <ch@debian.org> Fri, 22 Mar 2002 22:40:51 +0100
-
-mysql (3.23.49-5) unstable; urgency=low
-
- * Added skip-innodb to default my.cnf.
- * Enabled --enable-local-infile, it seems to be a new option that
- defaults to disable a formerly enabled feaure. Closes: #137115
-
- -- Christian Hammers <ch@debian.org> Sat, 16 Mar 2002 00:29:10 +0100
-
-mysql (3.23.49-4) unstable; urgency=medium
-
- * Recompiled against fixed libz.
-
- * Enabled --enable-local-infile, it seems to be a new option that
- defaults to disable a formerly enabled feaure. Closes: #137115
- * Fixed README.compile_on_potato. Closes: #136529
- * Now a ext3 .jounal file in /var/lib/mysql does not prevent the
- installation (happens when creating a jounal on an already mounted
- partition). Closes: #137146
-
- -- Christian Hammers <ch@debian.org> Wed, 13 Mar 2002 13:34:24 +0100
-
-mysql (3.23.49-3) unstable; urgency=low
-
- * Added Russian translation. Closes: #135846
- * Fixed installation of .info documents. Closes: #135030
-
- -- Christian Hammers <ch@debian.org> Wed, 27 Feb 2002 23:36:35 +0100
-
-mysql (3.23.49-2) unstable; urgency=low
-
- * Updated french translation and split template files. Closes: #134754
- * Fixed a small debian.cnf related bug in mysql-server.postinst.
-
- -- Christian Hammers <ch@debian.org> Tue, 19 Feb 2002 23:13:58 +0100
-
-mysql (3.23.49-1) unstable; urgency=low
-
- * New upstream release.
- (Mainly InnoDB related fixes)
- * Exported a $HOME variable in the scripts so that /root/.my.cnf
- is not read anymore. This will avoid problems when admins put
- only passwords but no usernames in this file. Closes: #132048
- * New debian-sys-maint password algorithm (now ~96bit :-)) Closes: #133863
- * Recreating debian-sys-main pwd on every install to help people who
- accidently delete user or password files...
- * Added /var/log/mysql so that user can put the binary logs in there as
- mysql cannot write the .001 etc files itself in /var/log which is
- owned by root.
-
- -- Christian Hammers <ch@debian.org> Thu, 14 Feb 2002 22:17:45 +0100
-
-mysql (3.23.47-6) unstable; urgency=low
-
- * Dropped a sentence about the new debian-sys-maint user in the
- debconf note and updated the README.Debian. Related: #132048
- * Added more french translation. Closes: #132390
-
- -- Christian Hammers <ch@debian.org> Wed, 6 Feb 2002 09:41:29 +0100
-
-mysql (3.23.47-5) unstable; urgency=low
-
- * Fixed grammar error in template. Closes: #132238
- * Really fixed typo in logrotate script. Closes: #131711
-
- -- Christian Hammers <ch@debian.org> Tue, 5 Feb 2002 14:20:08 +0100
-
-mysql (3.23.47-4) unstable; urgency=medium
-
- * Fixes typo in postinst that let init script fail. Closes: #131743
- * Fixed bashism bug that failed on ash. Closes: #131697
- * Fixed typo in logrotate script. Closes: #131711
-
- -- Christian Hammers <ch@debian.org> Thu, 31 Jan 2002 23:58:46 +0100
-
-mysql (3.23.47-3) unstable; urgency=low
-
- * Added new Debian specific mysql user called 'debian-sys-maint' which
- is used for pinging the server status, flushing the logs or shutting
- down the server in maintenance scripts. The credentials of this user
- are stored in the UID0-only readable file /etc/mysql/debian.cnf.
- Closes: #129887, #130326, #99274
- * Fixed unintended server startup at boottime. Closes: #122676, #130105
- * New upstream fixes command line parsing bug: Closes: #128473
- * Fixed manpage headers to let apropos work: Closes: #119122
- * Added "status" options for /etc/init.d/mysql. Closes: #129020
-
- -- Christian Hammers <ch@debian.org> Sun, 27 Jan 2002 19:46:11 +0100
-
-mysql (3.23.47-2) unstable; urgency=low
-
- * Enhanced init scripts by using mysqladmin instead of kill $pid.
- Thanks to Aaron Brick.
-
- -- Christian Hammers <ch@debian.org> Fri, 18 Jan 2002 01:42:23 +0100
-
-mysql (3.23.47-1) unstable; urgency=low
-
- * New upstream release.
- * Updated brazilian translation of debconf descriptions. Closes: #123332
-
- -- Christian Hammers <ch@debian.org> Sun, 6 Jan 2002 21:11:17 +0100
-
-mysql (3.23.46-3) unstable; urgency=low
-
- * Fixed bug in postinst where a script was accidently called with
- "bash -c <script> -IN_RPM" prevting the first argument to take effect
- and then leading to failures on hosts with unresolvable hostnames.
- Closes: #126147
- * Small changes and comments in postinst.
-
- -- Christian Hammers <ch@debian.org> Sat, 22 Dec 2001 14:03:02 +0100
-
-mysql (3.23.46-2) unstable; urgency=low
-
- * Start/stop behaviour now configurable via debconf. Closes: #112174
-
- -- Christian Hammers <ch@debian.org> Sun, 9 Dec 2001 21:38:54 +0100
-
-mysql (3.23.46-1) unstable; urgency=low
-
- * New upstream release.
- Only few fixes, mainly innodb related.
-
- -- Christian Hammers <ch@debian.org> Sun, 2 Dec 2001 03:08:48 +0100
-
-mysql (3.23.45-1) unstable; urgency=low
-
- * New upstream version.
- Only few fixes, mainly innodb related.
- * Added debconf note regarding the skip-networking option.
-
- -- Christian Hammers <ch@debian.org> Sun, 25 Nov 2001 16:50:37 +0100
-
-mysql (3.23.44-2) unstable; urgency=low
-
- * Finally removed debconf toggled "skip-networking" line add/remove
- code for /etc/mysql/my.cnf. I don't like editing a file that's tagged
- as configuration file.
- I disabled networking by default for security reasons. Better ideas?
-
- -- Christian Hammers <ch@debian.org> Fri, 16 Nov 2001 02:11:02 +0100
-
-mysql (3.23.44-1) unstable; urgency=low
-
- * New upstream release.
- - fixes replication bug (core dump)
- * Made description better english :) Thanks to D. Welton.
-
- -- Christian Hammers <ch@debian.org> Sun, 11 Nov 2001 15:44:07 +0100
-
-mysql (3.23.43-4) unstable; urgency=low
-
- * Disabled statically linking.
-
- -- Christian Hammers <ch@debian.org> Sat, 10 Nov 2001 03:15:56 +0100
-
-mysql (3.23.43-3) unstable; urgency=low
-
- * Changed compiler settings after one user reported instabilities.
- See #116631 for more information.
-
- -- Christian Hammers <ch@debian.org> Tue, 30 Oct 2001 21:39:17 +0100
-
-mysql (3.23.43-2) unstable; urgency=low
-
- * Patched sparc mutexes again. Closes: #113430
-
- -- Christian Hammers <ch@debian.org> Sun, 7 Oct 2001 15:09:00 +0200
-
-mysql (3.23.43-1) unstable; urgency=low
-
- * New upstream version.
- - Fixed some unlikely(sic!) bugs and core dumps.
- - Fixed a bug with BDB tables and UNIQUE columns that are NULL.
- - [more minor bugs were fixed; see changelog]
- * Adjusted build depends on libwrap0 for IA-64. Closes: #114582
- * Added the mysqlcheck binary. Closes: #114490
- * Fixed rules for arm architecture. Closes: #88186
- * Renamed mysql_print_defaults to the original name my_print_defaults.
- Isn't as descriptive but else I'd have to patch too much. Closes: #114492
-
- -- Christian Hammers <ch@debian.org> Fri, 5 Oct 2001 22:24:40 +0200
-
-mysql (3.23.42-2) unstable; urgency=low
-
- * Applied patch for m68k compile. Closes: #112904
-
- -- Christian Hammers <ch@debian.org> Sun, 23 Sep 2001 21:32:57 +0200
-
-mysql (3.23.42-1) unstable; urgency=low
-
- * New upstream releae.
- Fixes critical bug with InnoDB and large BLOBs.
-
- -- Christian Hammers <ch@debian.org> Tue, 18 Sep 2001 22:25:47 +0200
-
-mysql (3.23.41-2) unstable; urgency=low
-
- * Fixed shlibs.local problem. Closes: #111573
- * Replaced emacs by sensible-editor in mysqlbug.sh. Thanks Hans Ginzel.
-
- -- Christian Hammers <ch@debian.org> Sun, 9 Sep 2001 17:16:42 +0200
-
-mysql (3.23.41-1) unstable; urgency=low
-
- * New upstream release
- * Fixed build problem on ia64. Closes: #110624
-
- -- Christian Hammers <ch@debian.org> Tue, 14 Aug 2001 23:20:35 +0200
-
-mysql (3.23.40-1) unstable; urgency=low
-
- * New upstream release
-
- -- Christian Hammers <ch@debian.org> Sun, 5 Aug 2001 19:46:18 +0200
-
-mysql (3.23.39-5) unstable; urgency=low
-
- * Added debconf template for brazil. Closes: #106934, #106752
- * Tightened dependencies on debconf.
- * Adjusted mysql.err permissions in logrotate script to 0600. Closes: #105672
-
- -- Christian Hammers <ch@debian.org> Mon, 30 Jul 2001 00:10:12 +0200
-
-mysql (3.23.39-4.1) unstable; urgency=low
-
- * Maintainer-requested NMU.
- * Fixing thread mutexes on Sparc and Alpha
- (closes: Bug#101783)
- * Added --enable-assembler for sparc. This should
- allow mysql on sparc to use assembler versions of
- some string functions (read: should speed up a bit).
-
- -- Christopher C. Chimelis <chris@debian.org> Fri, 13 Jul 2001 15:09:30 -0400
-
-mysql (3.23.39-4) unstable; urgency=low
-
- * Porting fixes.
-
- -- Christian Hammers <ch@debian.org> Mon, 9 Jul 2001 17:56:54 +0200
-
-mysql (3.23.39-3.1) unstable; urgency=low
-
- * NMU (for porting)
- * Update config.sub and config.guess for hppa, sh & s390.
- * Add --with-client-ldflags=-lstdc++ to configure line. Closes: #100884
-
- -- Matthew Wilcox <willy@debian.org> Sun, 8 Jul 2001 19:26:59 -0600
-
-mysql (3.23.39-3) unstable; urgency=low
-
- * Disabled berkeley-db on sparc again. Mutexes aren't working again :-(
-
- -- Christian Hammers <ch@debian.org> Sat, 7 Jul 2001 18:30:08 +0200
-
-mysql (3.23.39-2) unstable; urgency=low
-
- * Bugfixed the m68k mutex patch. Thanks to Michael Fedrowitz. Closes: #103145
- * Removed config.cache files in bdb/ and innobase/. Closes: #103143
-
- -- Christian Hammers <ch@debian.org> Wed, 4 Jul 2001 22:06:58 +0200
-
-mysql (3.23.39-1) unstable; urgency=low
-
- * New upstream release. Minor bugfixes only.
-
- -- Christian Hammers <ch@debian.org> Thu, 14 Jun 2001 13:53:03 +0200
-
-mysql (3.23.38-4) unstable; urgency=low
-
- * Added logcheck files. Closes: #99131
- (I can't let the usermod away since I don't know of an easy way to
- retrive "passwd" information in a shell script considering that
- people use different storage methods like LDAP/NIS instead of passwd.)
-
- -- Christian Hammers <ch@debian.org> Fri, 8 Jun 2001 21:04:25 +0200
-
-mysql (3.23.38-3) unstable; urgency=low
-
- * Explicit pointet to /root/.my.cnf to let /etc/init.d/mysql stop
- work in sudo environments with $HOME!=/root work, too. Closes: #98324
- * Removes empty /etc/mysql on purge. Closes: #98164
-
- -- Christian Hammers <ch@debian.org> Tue, 22 May 2001 10:13:06 +0200
-
-mysql (3.23.38-2) unstable; urgency=low
-
- * Added depends to libdbd-mysql-perl for mysql-server. Closes: #94306
-
- -- Christian Hammers <ch@debian.org> Sat, 19 May 2001 19:43:26 +0200
-
-mysql (3.23.38-1) unstable; urgency=low
-
- * New upstream release.
- * Added Build-Depends to procps. Closes: #96768
-
- -- Christian Hammers <ch@debian.org> Sun, 13 May 2001 17:30:15 +0200
-
-mysql (3.23.37-5) unstable; urgency=low
-
- * Applied mutex patch for bdb support on m68k.
- Thanks to Michael Fedrowitz for the patch.
-
- -- Christian Hammers <ch@debian.org> Mon, 7 May 2001 12:30:40 +0200
-
-mysql (3.23.37-4) unstable; urgency=low
-
- * Enable bdb support for m68k architecture.
-
- -- Christian Hammers <ch@debian.org> Sat, 5 May 2001 16:47:36 +0200
-
-mysql (3.23.37-3) unstable; urgency=low
-
- * Added thread-safe client library. Thanks to Shane Wegner. Closes: #95441
-
- -- Christian Hammers <ch@debian.org> Sat, 28 Apr 2001 09:45:00 -0400
-
-mysql (3.23.37-2) unstable; urgency=low
-
- * Added sparc to the list of BDB supporting architectures after some
- tests on vore.debian.org and mails with Ben Collons.
-
- -- Christian Hammers <ch@debian.org> Fri, 27 Apr 2001 09:30:09 -0400
-
-mysql (3.23.37-1) unstable; urgency=low
-
- * New upstream version.
- * Added gemini table support.
- * Does anybody know how to enable SSL?
- * Fixed ARM compilation problem. Closes: #88186
-
- -- Christian Hammers <ch@debian.org> Sat, 21 Apr 2001 11:48:46 -0400
-
-mysql (3.23.36-2) unstable; urgency=low
-
- * Added patch by Christopher C. Chimelis <chris@debian.org> to make
- Berkeley db3 work again on Alpha architecture. Closes: #92787
-
- -- Christian Hammers <ch@debian.org> Tue, 3 Apr 2001 23:41:46 +0200
-
-mysql (3.23.36-1) unstable; urgency=high
-
- * New upstream version.
- * SECURITY FIX: One could place database tables outside the database
- directory by using '..' in one of the mysql helper programs where the
- table name was not checked correctly. This could lead to root compromise
- if the server would be running as root else you could at least do bad
- things as user mysql.
- * upstream: Fixed bug when thread creation failed.
- * upstream: Fixed problem in Innobase with non-latin1 charsets
- * upstream: Fixed a core-dump bug when using very complex query with DISTINGT
- * upstream: many others so called minor bugs...
- * fixes bug in init script. Closes: #90257
- (this report was agains some older problem that has been fixed too in .33)
-
- -- Christian Hammers <ch@debian.org> Fri, 30 Mar 2001 02:55:12 +0200
-
-mysql (3.23.35-1) unstable; urgency=medium
-
- * New upstream relase.
- * Fixes problem in ORDER BY clause. People using 3.33.34 should upgrade!
- * Includes innobase support.
- (Hope this is not such a catastrophe like berkeley db...)
-
- -- Christian Hammers <ch@debian.org> Fri, 16 Mar 2001 23:30:30 +0100
-
-mysql (3.23.33-3) unstable; urgency=low
-
- * Forgot #!/bin/sh at top of mysql-doc.postinst. Closes: #89801
-
- -- Christian Hammers <ch@vore.debian.org> Thu, 15 Mar 2001 20:38:35 -0500
-
-mysql (3.23.33-2) unstable; urgency=low
-
- * Added some missing scripts and manpages. Closes: #84068
- * Added dependency to perl-5.6. Closes: #81942
- * Added french templates somewhen ago. Closes: #83790
- * Added patch to get db3 working on Alpha. Closes: #86033
- Thanks to Christopher C. Chimelis <chris@debian.org>. The patch
- itself is included as debian/patch.alpha, too.
-
- -- Christian Hammers <ch@debian.org> Sun, 18 Feb 2001 06:40:40 +0100
-
-mysql (3.23.33-1) unstable; urgency=high
-
- * Fixes two security bugs that allowes crashing the server and maybe
- gaining the UID of the process that is linked against libmysqlclient!
-
- -- Christian Hammers <ch@debian.org> Tue, 13 Feb 2001 23:01:18 +0100
-
-mysql (3.23.32-1) unstable; urgency=low
-
- * New upstream releaes.
- (just minor fixes)
- * Added french and german debconf templates.
-
- -- Christian Hammers <ch@debian.org> Sun, 4 Feb 2001 17:27:07 +0100
-
-mysql (3.23.31-1) unstable; urgency=high
-
- * New upstream release.
- * Fixes security bug that was announced at BUGTRAQ mailing list.
- (Disappointingly not by mysql.com!). And allows a buffer overflow
- and therefore access to the mysql UID and all databases when already
- having a valid account. Closes: #82881
-
- -- Christian Hammers <ch@debian.org> Sat, 20 Jan 2001 11:14:36 +0100
-
-mysql (3.23.30-2) unstable; urgency=low
-
- * Recompiled with new dpkg-dev.
-
- -- Christian Hammers <ch@debian.org> Sun, 14 Jan 2001 22:20:55 +0100
-
-mysql (3.23.30-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Christian Hammers <ch@debian.org> Sun, 7 Jan 2001 22:10:18 +0100
-
-mysql (3.23.28-10) testing unstable; urgency=low
-
- * I must upload to "testing" to get it into woody, right?!
-
- -- Christian Hammers <ch@debian.org> Fri, 29 Dec 2000 14:43:57 +0100
-
-mysql (3.23.28-9) unstable; urgency=low
-
- * Made it a replacement for libmysqlclient9.
-
- -- Christian Hammers <ch@westend.com> Mon, 25 Dec 2000 19:15:04 +0100
-
-mysql (3.23.28-8) unstable; urgency=low
-
- * Applied patch from a user to get the skip-networking option working!
- Approved from a mysql employee but please test anyways.
- This finally: Closes: #79672, #78634, #79660, #79658
-
- -- Christian Hammers <ch@debian.org> Sat, 16 Dec 2000 14:01:36 +0100
-
-mysql (3.23.28-6) unstable; urgency=medium
-
- * Fixed error in postinst. Closes: #79392, #79400, #79451, #79550
- * Added .info files again on user request. Closes: #78988, #75737
-
- -- Christian Hammers <ch@debian.org> Wed, 13 Dec 2000 21:18:24 +0100
-
-mysql (3.23.28-5) unstable; urgency=low
-
- * Fixed a stupid bug in mysql-server.postinst regarding the
- configuration of skip-networking. Closes: #78639, 78634
- * Used patched bdb which hopefully enables mutexes on Alpha. Closes: #78197
- * Added dependency to adduser. Closes: #76798
-
- -- Christian Hammers <ch@debian.org> Sun, 10 Dec 2000 16:55:48 +0100
-
-mysql (3.23.28-4) unstable; urgency=low
-
- [never uploaded]
- * Fixed a stupid bug in mysql-server.postinst regarding the
- configuration of skip-networking. Closes: #78639, 78634
- * Used patched bdb which hopefully enables mutexes on Alpha. Closes: #78197
-
- -- Christian Hammers <ch@debian.org> Sun, 3 Dec 2000 17:49:44 +0100
-
-mysql (3.23.28-3) unstable; urgency=low
-
- * This time really fixed m68k build error. Closes: #78235
-
- -- Christian Hammers <ch@debian.org> Sun, 3 Dec 2000 15:02:55 +0100
-
-mysql (3.23.28-2) unstable; urgency=low
-
- * Adjusted rules file to make it buildable on m86k. Closes: #78235
-
- -- Christian Hammers <ch@debian.org> Fri, 1 Dec 2000 20:07:26 +0100
-
-mysql (3.23.28-1) unstable; urgency=low
-
- * New upstream vesrion. Now gamma!
- * Changed umask of mysql.log making it o-rw
- * Disabled listening on network reachable TCP ports by default due to
- security considerations.
-
- -- Christian Hammers <ch@debian.org> Thu, 23 Nov 2000 20:12:50 +0100
-
-mysql (3.23.27-1) unstable; urgency=low
-
- * New upstream version.
- * Closes: #75711
-
- -- Christian Hammers <ch@debian.org> Sun, 29 Oct 2000 14:29:51 +0100
-
-mysql (3.23.25-4) unstable; urgency=low
-
- * Recompiled to get rid of the dependency for zlib1 (libc5).
- Closes: #74952, #74939
-
- -- Christian Hammers <ch@debian.org> Tue, 17 Oct 2000 14:34:52 +0200
-
-mysql (3.23.25-3.1) unstable; urgency=low
-
- * Maintainer-approved NMU.
- * Includes patch to fix and enable db3 support on Alpha.
- * Enable support for thread mutexes in db3 on sparc
- (it works after all, according to Ben Collins)
- * Removed atomic_ functions for Alpha since they are no
- longer supported in the current glibc in woody.
- * Cleaned up rules file a bit.
-
- -- Christopher C. Chimelis <chris@debian.org> Sat, 14 Oct 2000 04:22:02 -0400
-
-mysql (3.23.25-3) unstable; urgency=low
-
- * Upstream decided not to include my_config.h,my_dir.h into the installed
- header files. As this file contains at least informative material
- and more important is checked by several autoconf scripts I
- included it by hand again.
- * Made building of berkeley db conditional to architecture until
- I get response whether it works on sparc/alpha now.
-
- -- Christian Hammers <ch@debian.org> Wed, 11 Oct 2000 23:58:38 +0200
-
-mysql (3.23.25-2) unstable; urgency=medium
-
- * Last build went terrible wrong.. Here's the changelog again:
- * New upstream release.
- * Shared library version was raised from 9 to 10.
- Maintainers of packets using libmysqlclient9 must recompile!
-
- -- Christian Hammers <ch@debian.org> Wed, 11 Oct 2000 01:16:34 +0200
-
-mysql (3.23.25-1) unstable; urgency=low
-
- * New upstream release.
- * Shared library version was raised from 9 to 10.
- Maintainers of packets using libmysqlclient9 must recompile!
-
- -- Christian Hammers <ch@debian.org> Sat, 7 Oct 2000 18:21:51 +0200
-
-mysql (3.23.24-2) unstable; urgency=low
-
- * Applied upstream patch regarding quoting of mysqldump.
- * Updated to db-3.1.17-patched (from www.mysql.com)
-
- -- Christian Hammers <ch@debian.org> Fri, 15 Sep 2000 18:58:14 +0200
-
-mysql (3.23.24-1) unstable; urgency=medium
-
- * New upstream version with some important fixes.
- * upstream: Last version corrupted CHAR/VARCHAR/BLOB columns with
- chararacters above ASCII 128! Check and repair all these tables.
- * upstream: fixed small memory leak
- * upstream: fixed problem with BDB tables and reading on unique
- (not primary) key.
- * Disabled BDB tables on all architectures except i386 due to many
- bug reports (see #71206). -> HELP APPRECIATED <-
-
- -- Christian Hammers <ch@debian.org> Tue, 12 Sep 2000 06:18:54 +0200
-
-mysql (3.23.23-2) unstable; urgency=low
-
- * Strange... "nohup nice" gives differnet results and let therefore
- crash safe_mysqld when starting up. Apparently it seems to be
- kernel dependand. Now fixed by another conditional. This
- more or less Closes: #71057
- * This bug was reported (accidently) in the following identical reports:
- Closes: #71253, #71254, #71257, #71258, #71259, #71262, #71266, #71267
- Closes: #71268, #71271, #71275, #71277, #71278, #71283, #71291
-
- -- Christian Hammers <ch@debian.org> Sat, 9 Sep 2000 20:13:50 +0200
-
-mysql (3.23.23-1) unstable; urgency=low
-
- * New upstream version. Feature freeze!
- * Fixed source build problem. Closes: #70707
-
- -- Christian Hammers <ch@debian.org> Thu, 31 Aug 2000 10:03:35 +0200
-
-mysql (3.23.22b-1) unstable; urgency=low
-
- * Reorganised docs. Now we have several small html files instead of
- one with almost 2M. Closes: 70431
- * Removed pdf,ps and html from source package shrinked it about 3M
- (therefore the .orig.tar.gz is called 3.23.22b!)
- * -> Last upload failed due to problems at the FTP site so here the
- -> changelog again:
- * Fixes memory leak, commit/rollback, reserved word "MASTER" ...
- * Added Berkeley DB3 source code to the Debian diff to be able to
- compile with bdb transaction support! (Great feature!!!)
- * Upstream correction of error message. Closes: #68939
- * Upstream correction of reserved word "source".
-
- -- Christian Hammers <ch@debian.org> Fri, 25 Aug 2000 19:21:24 +0200
-
-mysql (3.23.22-1) unstable; urgency=low
-
- * New upstream version.
- * Fixes memory leak, commit/rollback, reserved word "MASTER" ...
- * Added Berkeley DB3 source code to the Debian diff to be able to
- compile with bdb transaction support! (Great feature!!!)
- * Upstream correction of error message. Closes: #68939
- * Upstream correction of reserved word "source".
-
- -- Christian Hammers <ch@debian.org> Sun, 20 Aug 2000 09:05:48 +0200
-
-mysql (3.23.21-4) unstable; urgency=low
-
- * Added libmysqlclient9.shlibs and shlibs.local file. Closes: #68669
-
- -- Christian Hammers <ch@debian.org> Wed, 9 Aug 2000 14:22:49 +0200
-
-mysql (3.23.21-3) unstable; urgency=low
-
- * Let "/etc/init.d/mysql restart" wait until the pid has been
- removed before (but max 6 seconds) before restarting. Closes: 65070
- * Added build dependencies.
-
- -- Christian Hammers <ch@debian.org> Sun, 30 Jul 2000 16:16:48 +0200
-
-mysql (3.23.21-2) unstable; urgency=low
-
- * Typo in safe_mysqld prevents start.
-
- -- Christian Hammers <ch@debian.org> Sat, 29 Jul 2000 13:40:50 +0200
-
-mysql (3.23.21-1) unstable; urgency=low
-
- * New upstream version.
-
- -- Christian Hammers <ch@debian.org> Mon, 10 Jul 2000 22:54:17 +0200
-
-mysql (3.23.20-1) unstable; urgency=low
-
- * MySQL finally got fully GPL'ed! This means that there is only one
- souce package and only main/* binary packages from now on.
- * Fixed symlink in libmysqlclient9-dev. Closes: 66452
- * Apart from that the usual bug fixes for BETA software.
-
- -- Christian Hammers <ch@debian.org> Mon, 3 Jul 2000 20:05:38 +0200
-
-mysql-pd (3.23.16-1) unstable; urgency=low
-
- * New upstream release. (Actually a brand new upstream branch!)
- * Added mysql-common package as the configuration file can be used
- by all versions of the mysql client library.
- Did some more package reorganisations, too. See README.Debian file!
- * libmysqlclient.so raised major version from 6 to 9.
- * Minor beautifications in the debian/ directory.
-
- -- Christian Hammers <ch@debian.org> Sat, 27 May 2000 20:30:01 +0200
-
-mysql-gpl (3.22.30-2) frozen unstable; urgency=low
-
- * Fixed path in libmysqlclient.la. Closes: #58875
-
- -- Christian Hammers <ch@debian.org> Sat, 25 Jan 2020 20:27:29 -0700
-
-mysql-gpl (3.22.30-1) frozen unstable; urgency=low
-
- * A small change in the libmysqlclient6 causes mysqladmin to print an
- shared library error when displaying the defaults. Everything else
- works fine so this error wasn't detected untill now. Closes: #58033
- * TcX released a new MySQL version that includes another security patch,
- this time against mysqlaccess. The author told me that it would be
- fine if I just included the new .c in this source since I don't want
- go to 3.22.32 in frozen.
- * ->Release Manager: Although the version number increased there is
- no new coded except for the shared library. The rest is the same
- as in mysql-server and mysql-client.
-
- -- Christian Hammers <ch@debian.org> Tue, 15 Feb 2000 23:26:54 +0100
-
-mysql-gpl (3.22.29-1) unstable; urgency=low
-
- * New upstream version.
-
- -- Christian Hammers <ch@debian.org> Thu, 6 Jan 2000 20:37:23 +0100
-
-mysql-gpl (3.22.27a-3) unstable; urgency=low
-
- * Use system readline instead of bundled version. Closes: #50069
- Any objections ?
-
- -- Christian Hammers <ch@debian.org> Sun, 14 Nov 1999 18:09:48 +0100
-
-mysql-gpl (3.22.27a-2) unstable; urgency=low
-
- * Now building mysql-gpl-doc in binary-indep.
-
- -- Christian Hammers <ch@debian.org> Sat, 23 Oct 1999 04:22:36 +0200
-
-mysql-gpl (3.22.27a-1) unstable; urgency=low
-
- * Adjusted version number to allow new orig.tar.gz.
- The old seems broken :-( People reported compilation problems.
- * Changed mysql-gpl-doc to "Architecture: all".
-
- -- Christian Hammers <ch@debian.org> Sun, 17 Oct 1999 13:01:35 +0200
-
-mysql-gpl (3.22.27-1) unstable; urgency=low
-
- * New upstream release. Fixes charset problem.
-
- -- Christian Hammers <ch@debian.org> Mon, 11 Oct 1999 18:01:40 +0200
-
-mysql-gpl (3.22.26a-1) unstable; urgency=low
-
- * New upstream version. Just some small bug fixes.
- * FHS compliance.
-
- -- Christian Hammers <ch@debian.org> Sun, 3 Oct 1999 10:16:14 +0200
-
-mysql-gpl (3.22.25-2) unstable; urgency=low
-
- * Added conflict to all old mysql-dev packages. (fixes: #42966)
-
- -- Christian Hammers <ch@debian.org> Sun, 15 Aug 1999 11:35:46 +0200
-
-mysql-gpl (3.22.25-1) unstable; urgency=low
-
- * New upstream version. (We are waiting for 3.23.x !)
- * Fixes some upstream small bugs.
-
- -- Christian Hammers <ch@debian.org> Sun, 18 Jul 1999 22:02:06 +0200
-
-mysql-gpl (3.22.23b-4) unstable; urgency=low
-
- * Rebuild for new perl.
-
- -- Christian Hammers <ch@debian.org> Thu, 8 Jul 1999 01:09:57 +0200
-
-mysql-gpl (3.22.23b-3) unstable; urgency=low
-
- * libmysqlclient had the wrong socket path.
-
- -- Christian Hammers <ch@debian.org> Sun, 03 Jul 1999 23:13:30 +0200
-
-mysql-gpl (3.22.23b-2) unstable; urgency=low
-
- * Missed one replace tag to an very old version of mysql-devel.
-
- -- Christian Hammers <ch@debian.org> Sun, 27 Jun 1999 19:13:30 +0200
-
-mysql-gpl (3.22.23b-1) unstable; urgency=low
-
- * New upstream minor version.
- * Cleaned up the dependencies a bit.
-
- -- Christian Hammers <ch@debian.org> Sun, 27 Jun 1999 19:13:30 +0200
-
-mysql-gpl (3.22.22-1) unstable; urgency=low
-
- * New upstream version. (closes Bug#36493,37340)
- * New maintainer upload.
- * Package reorganisation: We prepare for the GPL'ed server which will
- * be released soon and make the structure more clear to the user.
-
- -- Christian Hammers <ch@debian.org> Mon, 3 May 1999 20:43:41 +0200
-
-mysql (3.22.21-1) unstable; urgency=low
-
- * Never released. TcX was too fast :-)
-
- -- Christian Hammers <ch@debian.org> Tue, 20 Apr 1999 17:22:04 +0200
-
-mysql-freebits (3.21.33b-3) unstable; urgency=low
-
- * Recompile with libncurses
-
- -- Scott Hanson <shanson@debian.org> Sat, 31 Oct 1998 15:04:39 +0100
-
-mysql-freebits (3.21.33b-2) unstable; urgency=low
-
- * Recompile with libstdc++2.9 (fixes #27792)
-
- -- Scott Hanson <shanson@debian.org> Mon, 12 Oct 1998 18:47:25 +0200
-
-mysql-freebits (3.21.33b-1) unstable; urgency=low
-
- * New upstream version (probably the last for 3.21)
-
- -- Scott Hanson <shanson@debian.org> Tue, 8 Sep 1998 18:59:37 +0200
-
-mysql-freebits (3.21.33-4) unstable; urgency=low
-
- * Separate out non-free source files, move mysql-base, mysql-dev, and
- * mysql-doc to main distribution
- * Locale files /usr/share/mysql/ now in server, not base; therefore...
- * Add conflict to mysql-server <=3.21.33-3
-
- -- Scott Hanson <shanson@debian.org> Fri, 31 Jul 1998 19:16:08 +0200
-
-mysql (3.21.33-3) unstable; urgency=low
-
- * Release to unstable with moved socket (fixes #24574)
- * Add conflict to old libdbd-mysql-perl package
-
- -- Scott Hanson <shanson@debian.org> Wed, 22 Jul 1998 22:17:43 +0200
-
-mysql (3.21.33-2) experimental; urgency=low
-
- * Move socket from /tmp to /var/run (see #24574)
- * Release to experimental, since this breaks everything statically
- * linked to libmysqlclient!
-
- -- Scott Hanson <shanson@debian.org> Wed, 15 Jul 1998 19:37:01 +0200
-
-mysql (3.21.33-1) unstable; urgency=low
-
- * New upstream release
-
- -- Scott Hanson <shanson@debian.org> Sun, 12 Jul 1998 08:18:18 +0200
-
-mysql (3.21.32a-1) unstable; urgency=low
-
- * New upstream release
- * Lintian bugs: ldconfig, missing manpage, call to perl5
- * Lintian bug shlib-with-non-pic-code _not_ yet fixed
-
- -- Scott Hanson <shanson@debian.org> Sat, 4 Jul 1998 07:57:13 +0200
-
-mysql (3.21.31-1) unstable frozen; urgency=low
-
- * New upstream release for hamm and slink (bug fixes only)
- * Fix unsecure use of temp file in mysqlbug (fixes #23606)
- * Added brief licensing information to control file
-
- -- Scott Hanson <shanson@debian.org> Tue, 16 Jun 1998 10:52:44 +0200
-
-mysql (3.21.30-3) unstable; urgency=low
-
- * Restore missing shared library dependencies for mysql-server
-
- -- Scott Hanson <shanson@debian.org> Mon, 15 Jun 1998 07:51:58 +0200
-
-mysql (3.21.30-2) unstable; urgency=low
-
- * Simplify debian/rules (fixes #17662)
- * Edit manual.texi to add "Debian notes" to documentation
- * Add note about passwords on command line (fixes #16471)
- * Add note about getting privleges for users (fixes #22891)
- * Correct "Possible license changes" heading (fixes #22711)
- * Add uninstalled header files to /usr/doc/mysql-dev/examples (fixes #22627)
- * Add udf_example.cc to /usr/doc/mysql-dev/examples (fixes #22710)
-
- -- Scott Hanson <shanson@debian.org> Sun, 7 Jun 1998 13:05:37 +0200
-
-mysql (3.21.30-1) unstable; urgency=low
-
- * Stable upstream release
-
- -- Scott Hanson <shanson@debian.org> Tue, 12 May 1998 22:13:25 +0200
-
-mysql (3.21.29gamma-1) unstable; urgency=low
-
- * New upstream release
- * Do not create 'mysql' subdirectory for libs and headers (fixes #19020)
- * Remove 'CXX=gcc' flag from configure (g++ now standard)
-
- -- Scott Hanson <shanson@debian.org> Sun, 12 Apr 1998 18:38:03 +0200
-
-mysql (3.21.28gamma-1) unstable; urgency=low
-
- * New upstream release
- * Unstable-only release; hamm stays at 3.21.25 for now
-
- -- Scott Hanson <shanson@debian.org> Thu, 2 Apr 1998 21:33:51 +0200
-
-mysql (3.21.25gamma-3) unstable frozen; urgency=low
-
- * Have mysql-base suggest perl >= 5.004 for mysqlaccess (fixes #19593)
- * Fix shlibs to refer to mysql-base rather than the no-longer-existant mysql
-
- -- Scott Hanson <shanson@debian.org> Thu, 26 Mar 1998 18:22:59 +0100
-
-mysql (3.21.25gamma-2) unstable; urgency=low
-
- * Restore libmysqlclient.so symlink to mysql-dev (fixes #19036)
-
- -- Scott Hanson <shanson@debian.org> Sun, 8 Mar 1998 10:46:43 +0100
-
-mysql (3.21.25gamma-1) unstable; urgency=low
-
- * Check if running as root in init.d script (fixes #18577)
- * New upstream release
-
- -- Scott Hanson <shanson@debian.org> Fri, 27 Feb 1998 20:01:30 +0100
-
-mysql (3.21.24gamma-1) unstable; urgency=low
-
- * New upstream release
-
- -- Scott Hanson <shanson@debian.org> Mon, 23 Feb 1998 08:14:17 +0100
-
-mysql (3.21.23beta-3) unstable; urgency=low
-
- * Squashed errors found by lintian
-
- -- Scott Hanson <shanson@debian.org> Tue, 17 Feb 1998 20:19:01 +0100
-
-mysql (3.21.23beta-2) unstable; urgency=low
-
- * Fixed overlaps with old mysql package (fixes #17843)
-
- -- Scott Hanson <shanson@debian.org> Thu, 5 Feb 1998 22:55:00 +0100
-
-mysql (3.21.23beta-1) unstable; urgency=low
-
- * New upstream release
- * Fix include lines in mysql.h (fixes #17827)
- * Move /usr/include/mysql to mysql-dev
-
- -- Scott Hanson <shanson@debian.org> Wed, 4 Feb 1998 19:59:14 +0100
-
-mysql (3.21.22beta-3) unstable; urgency=low
-
- * Correct descriptions in control file (fixes #17698)
- * Clean up output of shutdown script
-
- -- Scott Hanson <shanson@debian.org> Sat, 31 Jan 1998 19:04:29 +0100
-
-mysql (3.21.22beta-2) unstable; urgency=low
-
- * Split out mysql-dev and mysql-bench subpackages
-
- -- Scott Hanson <shanson@debian.org> Wed, 28 Jan 1998 19:52:27 +0100
-
-mysql (3.21.22beta-1) unstable; urgency=low
-
- * New upstream release
-
- -- Scott Hanson <shanson@debian.org> Wed, 28 Jan 1998 18:59:09 +0100
-
-mysql (3.21.21a.beta-2) unstable; urgency=low
-
- * Compile with libpthreads from libc6-dev_2.0.6-3 rather than statically
- linking to patched libpthreads (see changes to 3.20.29-2)
-
- -- Scott Hanson <shanson@debian.org> Sun, 25 Jan 1998 13:17:15 +0100
-
-mysql (3.21.21a.beta-1) unstable; urgency=low
-
- * Put initial database, mysql_install_db, safe_mysqld, isamlog and
- isamchk in mysql-server
- * Correct upstream release number so source packages are correctly built
-
- -- Scott Hanson <shanson@debian.org> Mon, 19 Jan 1998 07:52:48 +0100
-
-mysql (3.21.21.beta-1) unstable; urgency=low
-
- * Use debhelper where possible in rules
- * Split binary packages into mysql-base, mysql-client, mysql-doc
- * New upstream release
-
- -- Scott Hanson <shanson@debian.org> Thu, 15 Jan 1998 08:12:17 +0100
-
-mysql (3.21.19.beta-1) unstable; urgency=low
-
- * Offer to set root password in mysql_install_db
- * Kill `pidof mysqld` on shutdown rather than use mysqladmin
- * New upstream version
-
- -- Scott Hanson <shanson@debian.org> Fri, 9 Jan 1998 20:06:35 +0100
-
-mysql (3.21.17a.beta-2) unstable; urgency=low
-
- * Remove perl stuff (it's going back into libdbd-mysql-perl)
- * Remove conflict with libdbd-mysql-perl
- * Do not compress *html files (fixes #16314)
-
- -- Scott Hanson <shanson@debian.org> Tue, 30 Dec 1997 07:34:20 +0100
-
-mysql (3.21.17a.beta-1) unstable; urgency=low
-
- * Add conflict to libdbd-mysql-perl
- * Use --pid-file option to place pid file in /var/run rather than patching
- * Add install-info to postinst and postrm
- * Add filename to message shown by mysql_install_db (fixes #16621)
- * New upstream version
-
- -- Scott Hanson <shanson@debian.org> Sun, 21 Dec 1997 19:41:45 +0100
-
-mysql (3.20.32a-5) unstable; urgency=low
-
- * Move mysqld to /usr/lib/mysql, per policy discussion
- * Adjust makefiles so perl libs get installed
-
- -- Scott Hanson <shanson@debian.org> Wed, 3 Dec 1997 22:37:45 +0100
-
-mysql (3.20.32a-4) unstable; urgency=low
-
- * Move mysqld to /usr/sbin to comply with FSSTND
-
- -- Scott Hanson <shanson@debian.org> Mon, 3 Nov 1997 20:12:29 +0100
-
-mysql (3.20.32a-3) unstable; urgency=low
-
- * Comment out tests in mysql_install_db... for real this time!
-
- -- Scott Hanson <shanson@debian.org> Mon, 3 Nov 1997 07:32:53 +0100
-
-mysql (3.20.32a-2) unstable; urgency=low
-
- * Comment out tests in mysql_install_db (fixes #14304)
-
- -- Scott Hanson <shanson@debian.org> Sat, 1 Nov 1997 18:45:25 +0100
-
-mysql (3.20.32a-1) unstable; urgency=low
-
- * New upstream version
-
- -- Scott Hanson <shanson@debian.org> Wed, 29 Oct 1997 07:11:42 +0100
-
-mysql (3.20.29-2) unstable; urgency=low
-
- * New maintainer
- * Statically link mysqld to patched glibc-2.0.5 libpthread
- (works around #13586; see README.debian.glibc-2.0.5)
- * Conflict with libpthread0 (fixes #13448)
- * Don't link libg++, avoiding problems with glibc libpthread
-
- -- Scott Hanson <shanson@debian.org> Thu, 16 Oct 1997 19:25:23 +0200
-
-mysql (3.20.29-1) unstable; urgency=low
-
- * New upstream version
- * Recompiled with libc6
- * Include mysql-faq_toc.html (fixes #10885)
- * Reworked /etc/init.d/mysql script (thanks to Heiko)
- * Remove file /usr/lib/libmysqlclient.so.4 when package is removed.
- * Use absolute path specification for conffile
- * Use /usr/bin/perl instead of /bin/perl (fixes #10654)
- * Do not depend on mysql (fixes #12427)
- * Installed missing manpage for Mysql perl module
- * Don't use debstd anymore
- * Pristine source
- * Set section to `non-free/devel'
- * Upgraded to standards version 2.3.0.0
-
- -- Christian Schwarz <schwarz@debian.org> Fri, 12 Sep 1997 02:12:58 +0200
-
-mysql (3.20.16beta-2) unstable; urgency=low
-
- * Uses /usr/bin/perl instead of /bin/perl (fixes bug #9731)
- * Don't run mysqld with --log option
- * Don't install regex manual pages
- * Suggest package mysql-manual
- * Fixed typo in changelog
- * Upgrade to policy 2.1.3.2
-
- -- Christian Schwarz <schwarz@debian.org> Sun, 11 May 1997 14:19:26 +0200
-
-mysql (3.20.16beta-1) unstable; urgency=low
-
- * Initial Release.
-
- -- Christian Schwarz <schwarz@debian.org> Sat, 12 Apr 1997 13:51:28 +0200
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index b8626c4cff2..00000000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-4
diff --git a/debian/control.in b/debian/control.in
deleted file mode 100644
index 8206728e6d7..00000000000
--- a/debian/control.in
+++ /dev/null
@@ -1,353 +0,0 @@
-Source: mysql-@MYSQL_BRANDED_BASE_VERSION@
-Section: misc
-Priority: optional
-Maintainer: Monty Taylor <mtaylor@mysql.com>
-Uploaders: Mads Martin Joergensen <mads@mysql.com>, MySQL Build Team <build-private@mysql.com>
-Build-Depends: libtool (>= 1.4.2-7), g++ (>= 4:3.3.5-3), procps | hurd, debhelper (>= 4.1.16), file (>= 3.28-1), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), libreadline5-dev | libreadline-dev, psmisc, po-debconf, chrpath, automake1.8, doxygen, gs, dpatch, gawk, bison
-Standards-Version: 3.7.2
-
-Package: libmysqlclient@SHARED_LIB_MAJOR_VERSION@off
-Section: libs
-Architecture: any
-Depends: mysql-common (>= ${Source-Version}), ${shlibs:Depends}
-Description: mysql database client library
- The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
- and robust SQL (Structured Query Language) database server. MySQL Server
- is intended for mission-critical, heavy-load production systems as well
- as for embedding into mass-deployed software. MySQL is a trademark of
- MySQL AB.
- .
- The MySQL software has Dual Licensing, which means you can use the MySQL
- software free of charge under the GNU General Public License
- (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
- licenses from MySQL AB if you do not wish to be bound by the terms of
- the GPL. See the chapter "Licensing and Support" in the manual for
- further info.
- .
- The MySQL web site (http://www.mysql.com/) provides the latest
- news and information about the MySQL software. Also please see the
- documentation and the manual for more information.
- .
- This package contains the shared libraries (*.so*) which certain
- languages and applications need to dynamically load and use MySQL.
-
-Package: libmysqlclient@SHARED_LIB_MAJOR_VERSION@-dev
-Architecture: any
-Section: libdevel
-Depends: libmysqlclient@SHARED_LIB_MAJOR_VERSION@ (>= ${Source-Version}), zlib1g-dev, ${shlibs:Depends}
-Conflicts: libmysqlclient14-dev, libmysqlclient12-dev, libmysqlclient10-dev
-Provides: libmysqlclient-dev
-Description: mysql database development files
- The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
- and robust SQL (Structured Query Language) database server. MySQL Server
- is intended for mission-critical, heavy-load production systems as well
- as for embedding into mass-deployed software. MySQL is a trademark of
- MySQL AB.
- .
- The MySQL software has Dual Licensing, which means you can use the MySQL
- software free of charge under the GNU General Public License
- (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
- licenses from MySQL AB if you do not wish to be bound by the terms of
- the GPL. See the chapter "Licensing and Support" in the manual for
- further info.
- .
- The MySQL web site (http://www.mysql.com/) provides the latest
- news and information about the MySQL software. Also please see the
- documentation and the manual for more information.
- .
- This package contains the development header files and libraries
- necessary to develop MySQL client applications.
-
-Package: libndbclient@NDB_SHARED_LIB_MAJOR_VERSION@
-Section: libs
-Architecture: any
-Depends: mysql-common (>= ${Source-Version}), libmysqlclient@SHARED_LIB_MAJOR_VERSION@, ${shlibs:Depends}
-Description: mysql cluster NdbApi library
- The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
- and robust SQL (Structured Query Language) database server. MySQL Server
- is intended for mission-critical, heavy-load production systems as well
- as for embedding into mass-deployed software. MySQL is a trademark of
- MySQL AB.
- .
- The MySQL software has Dual Licensing, which means you can use the MySQL
- software free of charge under the GNU General Public License
- (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
- licenses from MySQL AB if you do not wish to be bound by the terms of
- the GPL. See the chapter "Licensing and Support" in the manual for
- further info.
- .
- The MySQL web site (http://www.mysql.com/) provides the latest
- news and information about the MySQL software. Also please see the
- documentation and the manual for more information.
- .
- This package contains the shared libraries (*.so*) which certain
- languages and applications need to dynamically load and use MySQL NdbApi.
-
-Package: libndbclient@NDB_SHARED_LIB_MAJOR_VERSION@-dev
-Architecture: any
-Section: libdevel
-Depends: libndbclient@NDB_SHARED_LIB_MAJOR_VERSION@ (>= ${Source-Version}), zlib1g-dev, ${shlibs:Depends}
-Provides: libndbclient-dev
-Description: mysql cluster NdbApi development files
- The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
- and robust SQL (Structured Query Language) database server. MySQL Server
- is intended for mission-critical, heavy-load production systems as well
- as for embedding into mass-deployed software. MySQL is a trademark of
- MySQL AB.
- .
- The MySQL software has Dual Licensing, which means you can use the MySQL
- software free of charge under the GNU General Public License
- (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
- licenses from MySQL AB if you do not wish to be bound by the terms of
- the GPL. See the chapter "Licensing and Support" in the manual for
- further info.
- .
- The MySQL web site (http://www.mysql.com/) provides the latest
- news and information about the MySQL software. Also please see the
- documentation and the manual for more information.
- .
- This package contains the development header files and libraries
- necessary to develop NdbApi client applications.
-
-Package: mysql-common
-Section: misc
-Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Conflicts: mysql-common-@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@
-Provides: mysql-common-@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@
-Replaces: mysql-common-@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@
-Description: mysql database common files (e.g. /etc/mysql/my.cnf)
- The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
- and robust SQL (Structured Query Language) database server. MySQL Server
- is intended for mission-critical, heavy-load production systems as well
- as for embedding into mass-deployed software. MySQL is a trademark of
- MySQL AB.
- .
- The MySQL software has Dual Licensing, which means you can use the MySQL
- software free of charge under the GNU General Public License
- (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
- licenses from MySQL AB if you do not wish to be bound by the terms of
- the GPL. See the chapter "Licensing and Support" in the manual for
- further info.
- .
- The MySQL web site (http://www.mysql.com/) provides the latest
- news and information about the MySQL software. Also please see the
- documentation and the manual for more information.
- .
- This package includes files needed by all versions of the client library.
-
-Package: mysql-client-@MYSQL_BRANDED_BASE_VERSION@
-Architecture: any
-Depends: debianutils (>=1.6), libdbi-perl, libdbd-mysql-perl (>= 1.2202), mysql-common (>= ${Source-Version}), libmysqlclient@SHARED_LIB_MAJOR_VERSION@ (>= ${Source-Version}), ${perl:Depends}, ${shlibs:Depends}, ${misc:Depends}
-Provides: virtual-mysql-client, mysql-client, mysql-client-@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@
-Conflicts: mysql-client (<< ${Source-Version}), mysql-client-@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@
-Replaces: mysql-client (<< ${Source-Version}), mysql-server, mysql-client-@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@
-Description: mysql database client binaries
- The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
- and robust SQL (Structured Query Language) database server. MySQL Server
- is intended for mission-critical, heavy-load production systems as well
- as for embedding into mass-deployed software. MySQL is a trademark of
- MySQL AB.
- .
- The MySQL software has Dual Licensing, which means you can use the MySQL
- software free of charge under the GNU General Public License
- (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
- licenses from MySQL AB if you do not wish to be bound by the terms of
- the GPL. See the chapter "Licensing and Support" in the manual for
- further info.
- .
- The MySQL web site (http://www.mysql.com/) provides the latest
- news and information about the MySQL software. Also please see the
- documentation and the manual for more information.
- .
- This package contains the standard MySQL clients and administration tools.
-
-Package: mysql-server-@MYSQL_BRANDED_BASE_VERSION@
-Architecture: any
-Suggests: tinyca
-Recommends: mailx
-Pre-Depends: mysql-common (>= ${Source-Version}), adduser (>= 3.40)
-Depends: mysql-client-@MYSQL_BRANDED_BASE_VERSION@ (>= ${Source-Version}), libdbi-perl, perl (>= 5.6), ${shlibs:Depends}, ${misc:Depends}, psmisc, passwd, lsb-base (>= 3.0-10)
-Conflicts: mysql-server (<< ${Source-Version}), mysql-server-@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@ (<< 5.0.26-3)
-Provides: mysql-server, virtual-mysql-server, mysql-server-@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@
-Replaces: mysql-server (<< ${Source-Version}), mysql-server-@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@
-Description: mysql database server binaries
- The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
- and robust SQL (Structured Query Language) database server. MySQL Server
- is intended for mission-critical, heavy-load production systems as well
- as for embedding into mass-deployed software. MySQL is a trademark of
- MySQL AB.
- .
- The MySQL software has Dual Licensing, which means you can use the MySQL
- software free of charge under the GNU General Public License
- (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
- licenses from MySQL AB if you do not wish to be bound by the terms of
- the GPL. See the chapter "Licensing and Support" in the manual for
- further info.
- .
- The MySQL web site (http://www.mysql.com/) provides the latest
- news and information about the MySQL software. Also please see the
- documentation and the manual for more information.
- .
- This package includes the MySQL server binary (incl. InnoDB) as well
- as related utilities to run and administrate a MySQL server.
- .
- If you want to access and work with the database, you have to install
- package mysql-client-@MYSQL_BRANDED_BASE_VERSION@ as well!
-
-Package: mysql-test-@MYSQL_BRANDED_BASE_VERSION@
-Architecture: any
-Pre-Depends: mysql-common (>= ${Source-Version})
-Depends: mysql-client-@MYSQL_BRANDED_BASE_VERSION@ (>= ${Source-Version}), libdbd-mysql-perl, perl (>= 5.6), ${shlibs:Depends}, ${misc:Depends}
-Description: MySQL - test suite
- The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
- and robust SQL (Structured Query Language) database server. MySQL Server
- is intended for mission-critical, heavy-load production systems as well
- as for embedding into mass-deployed software. MySQL is a trademark of
- MySQL AB.
- .
- The MySQL software has Dual Licensing, which means you can use the MySQL
- software free of charge under the GNU General Public License
- (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
- licenses from MySQL AB if you do not wish to be bound by the terms of
- the GPL. See the chapter "Licensing and Support" in the manual for
- further info.
- .
- The MySQL web site (http://www.mysql.com/) provides the latest
- news and information about the MySQL software. Also please see the
- documentation and the manual for more information.
- .
- This package contains the MySQL regression test suite.
-
-Package: mysql-storage-@MYSQL_BRANDED_BASE_VERSION@
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: MySQL - ndbcluster storage engine
- The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
- and robust SQL (Structured Query Language) database server. MySQL Server
- is intended for mission-critical, heavy-load production systems as well
- as for embedding into mass-deployed software. MySQL is a trademark of
- MySQL AB.
- .
- The MySQL software has Dual Licensing, which means you can use the MySQL
- software free of charge under the GNU General Public License
- (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
- licenses from MySQL AB if you do not wish to be bound by the terms of
- the GPL. See the chapter "Licensing and Support" in the manual for
- further info.
- .
- The MySQL web site (http://www.mysql.com/) provides the latest
- news and information about the MySQL software. Also please see the
- documentation and the manual for more information.
- .
- This package contains the ndbcluster storage engine.
- It is necessary to have this package installed on all
- computers that should store ndbcluster table data.
- Note that this storage engine can only be used in conjunction
- with the MySQL Max server.
-
-Package: mysql-management-@MYSQL_BRANDED_BASE_VERSION@
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: MySQL - ndbcluster storage engine management
- The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
- and robust SQL (Structured Query Language) database server. MySQL Server
- is intended for mission-critical, heavy-load production systems as well
- as for embedding into mass-deployed software. MySQL is a trademark of
- MySQL AB.
- .
- The MySQL software has Dual Licensing, which means you can use the MySQL
- software free of charge under the GNU General Public License
- (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
- licenses from MySQL AB if you do not wish to be bound by the terms of
- the GPL. See the chapter "Licensing and Support" in the manual for
- further info.
- .
- The MySQL web site (http://www.mysql.com/) provides the latest
- news and information about the MySQL software. Also please see the
- documentation and the manual for more information.
- .
- This package contains ndbcluster storage engine management.
- It is necessary to have this package installed on at least
- one computer in the cluster.
-
-Package: mysql-tools-@MYSQL_BRANDED_BASE_VERSION@
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: MySQL - ndbcluster storage engine basic tools
- The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
- and robust SQL (Structured Query Language) database server. MySQL Server
- is intended for mission-critical, heavy-load production systems as well
- as for embedding into mass-deployed software. MySQL is a trademark of
- MySQL AB.
- .
- The MySQL software has Dual Licensing, which means you can use the MySQL
- software free of charge under the GNU General Public License
- (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
- licenses from MySQL AB if you do not wish to be bound by the terms of
- the GPL. See the chapter "Licensing and Support" in the manual for
- further info.
- .
- The MySQL web site (http://www.mysql.com/) provides the latest
- news and information about the MySQL software. Also please see the
- documentation and the manual for more information.
- .
- This package contains ndbcluster storage engine basic tools.
-
-Package: mysql-extra-@MYSQL_BRANDED_BASE_VERSION@
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: MySQL - ndbcluster storage engine extra tools
- The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
- and robust SQL (Structured Query Language) database server. MySQL Server
- is intended for mission-critical, heavy-load production systems as well
- as for embedding into mass-deployed software. MySQL is a trademark of
- MySQL AB.
- .
- The MySQL software has Dual Licensing, which means you can use the MySQL
- software free of charge under the GNU General Public License
- (http://www.gnu.org/licenses/). You can also purchase commercial MySQL
- licenses from MySQL AB if you do not wish to be bound by the terms of
- the GPL. See the chapter "Licensing and Support" in the manual for
- further info.
- .
- The MySQL web site (http://www.mysql.com/) provides the latest
- news and information about the MySQL software. Also please see the
- documentation and the manual for more information.
- .
- This package contains some extra ndbcluster storage engine tools for
- the advanced user.
- .
- They should be used with caution
-
-
-Package: mysql-server-@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@
-Architecture: any
-Section: oldlibs
-Priority: extra
-Depends: mysql-server-@MYSQL_BRANDED_BASE_VERSION@
-Description: mysql database server (transitional package)
- MySQL is a fast, stable and true multi-user, multi-threaded SQL database
- server. SQL (Structured Query Language) is the most popular database query
- language in the world. The main goals of MySQL are speed, robustness and
- ease of use.
- .
- This is an empty transitional package and can safely be removed.
-
-Package: mysql-server
-Architecture: all
-Depends: mysql-server-@MYSQL_BRANDED_BASE_VERSION@
-Description: mysql database server (meta package depending on the latest version)
- This is an empty package that depends on the current "best" version of
- mysql-server (currently mysql-server-@MYSQL_BRANDED_BASE_VERSION@), as determined by the MySQL
- maintainers. Install this package if in doubt about which MySQL version
- you want, as this is the one we consider to be in the best shape.
-
-Package: mysql-client
-Architecture: all
-Depends: mysql-client-@MYSQL_BRANDED_BASE_VERSION@
-Description: mysql database client (meta package depending on the latest version)
- This is an empty package that depends on the current "best" version of
- mysql-client (currently mysql-client-@MYSQL_BRANDED_BASE_VERSION@), as determined by the MySQL
- maintainers. Install this package if in doubt about which MySQL version
- you want, as this is the one we consider to be in the best shape.
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644
index f3c7b8624ca..00000000000
--- a/debian/copyright
+++ /dev/null
@@ -1,139 +0,0 @@
-The Debian package of MySQL was first debianzed on 1997-04-12 by Christian
-Schwarz <schwarz@debian.org> and ist maintained since 1999-04-20 by
-Christian Hammers <ch@debian.org>.
-
-It can be downloaded from http://www.mysql.com/
-
-Copyright:
-
-According to the file "COPYING" all parts of this package are licenced
-under the terms of the GNU GPL Version 2 of which a copy is available
-in /usr/share/common-licenses.
-
-To allow free software with other licences than the GPL to link against the
-shared library, special terms for "derived works" are defined in the file
-"EXCEPTIONS-CLIENT" which is quoted below.
-
-More information can be found on http://www.mysql.com/company/legal/licensing/
-
-The manual had to be removed as it is not free in the sense of the
-Debian Free Software Guidelines (DFSG).
-
--------------------------------------------------------------------------
-
-
-Appendix I MySQL FLOSS License Exception
-****************************************
-
- Version 0.3, 10 February 2005
-
-The MySQL AB Exception for Free/Libre and Open Source Software-only
-Applications Using MySQL Client Libraries (the "FLOSS Exception").
-
-Exception Intent
-================
-
-We want specified Free/Libre and Open Source Software ("FLOSS")
-applications to be able to use specified GPL-licensed MySQL client
-libraries (the "Program") despite the fact that not all FLOSS licenses
-are compatible with version 2 of the GNU General Public License (the
-"GPL").
-
-Legal Terms and Conditions
-==========================
-
-As a special exception to the terms and conditions of version 2.0 of the
-GPL:
-
- 1. You are free to distribute a Derivative Work that is formed
- entirely from the Program and one or more works (each, a "FLOSS
- Work") licensed under one or more of the licenses listed below in
- section 1, as long as:
-
- a. You obey the GPL in all respects for the Program and the
- Derivative Work, except for identifiable sections of the
- Derivative Work which are not derived from the Program, and
- which can reasonably be considered independent and separate
- works in themselves,
-
- b. all identifiable sections of the Derivative Work which are not
- derived from the Program, and which can reasonably be
- considered independent and separate works in themselves,
-
- i
- are distributed subject to one of the FLOSS licenses
- listed below, and
-
- ii
- the object code or executable form of those sections are
- accompanied by the complete corresponding
- machine-readable source code for those sections on the
- same medium and under the same FLOSS license as the
- corresponding object code or executable forms of those
- sections, and
-
- c. any works which are aggregated with the Program or with a
- Derivative Work on a volume of a storage or distribution
- medium in accordance with the GPL, can reasonably be
- considered independent and separate works in themselves which
- are not derivatives of either the Program, a Derivative Work
- or a FLOSS Work.
-
- If the above conditions are not met, then the Program may only be
- copied, modified, distributed or used under the terms and
- conditions of the GPL or another valid licensing option from MySQL
- AB.
-
- 2. FLOSS License List
-
- *License name* *Version(s)/Copyright Date*
- Academic Free License 2.0
- Apache Software License 1.0/1.1/2.0
- Apple Public Source License 2.0
- Artistic license From Perl 5.8.0
- BSD license "July 22 1999"
- Common Public License 1.0
- GNU Library or "Lesser" General Public 2.0/2.1
- License (LGPL)
- Jabber Open Source License 1.0
- MIT license -
- Mozilla Public License (MPL) 1.0/1.1
- Open Software License 2.0
- OpenSSL license (with original SSLeay "2003" ("1998")
- license)
- PHP License 3.0
- Python license (CNRI Python License) -
- Python Software Foundation License 2.1.1
- Sleepycat License "1999"
- W3C License "2001"
- X11 License "2001"
- Zlib/libpng License -
- Zope Public License 2.0
-
- Due to the many variants of some of the above licenses, we require
- that any version follow the 2003 version of the Free Software
- Foundation's Free Software Definition
- (`http://www.gnu.org/philosophy/free-sw.html') or version 1.9 of
- the Open Source Definition by the Open Source Initiative
- (`http://www.opensource.org/docs/definition.php').
-
- 3. Definitions
-
- a. Terms used, but not defined, herein shall have the meaning
- provided in the GPL.
-
- b. Derivative Work means a derivative work under copyright law.
-
- 4. Applicability This FLOSS Exception applies to all Programs that
- contain a notice placed by MySQL AB saying that the Program may be
- distributed under the terms of this FLOSS Exception. If you
- create or distribute a work which is a Derivative Work of both the
- Program and any other work licensed under the GPL, then this FLOSS
- Exception is not available for that work; thus, you must remove
- the FLOSS Exception notice from that work and comply with the GPL
- in all respects, including by retaining all GPL notices. You may
- choose to redistribute a copy of the Program exclusively under the
- terms of the GPL by removing the FLOSS Exception notice from that
- copy of the Program, provided that the copy has never been
- modified by you or any third party.
-
diff --git a/debian/copyright.more b/debian/copyright.more
deleted file mode 100644
index b7ac36bc9fa..00000000000
--- a/debian/copyright.more
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# Some random bits of interest.
-#
-
-#
-# Arjen about OpenSSL
-#
-http://bugs.mysql.com/?id=6924
-Updated by: Arjen Lentz
-Date: 2005-11-05
-
-Linking with the client library is covered by the FLOSS exception which
-includes OpenSSL now. So that's clean. Indeed, the OpenSSL is not
-compliant with the FSF free software guidelines, however it *is*
-compliant with the OSI guidelines. And that's good enough for us.
-Christian is correct in saying that the author of a GPL app that links
-with MySQL may find themselves in a licensing headache (or may not
-realize that OpenSSL is involved) but that is their responsibility.
-The MySQL client can be linked with a number of other licenses, it
-would not be feasible for MySQL to take over the responsibility for
-"the next level" of how combinations of licenses work out. There are
-too many possibilities, and combinations of more just 2 licenses.
-
-
-#
-# Steve Langasek about OpenSSL vs libmysqlclient
-#
-Subject: Bug#291945: eleventh-hour transition for mysql-using packages related to apache
-Date: Sat, 12 Feb 2005 00:39:58 -0800
-From: Steve Langasek <vorlon@debian.org>
-
-> > > > that's great to hear! i'm cc'ing the relevant wishlist bug i have open
-> > > > against mysql-server. christian: any chance of getting an openssl enabled
-> > > > version of the mysql-client and mysql-server packages?
-
-> > > Yes, I will re-enable openssl in the next upload.
-
-> > Please make sure this does not introduce an openssl dependency to
-> > libmysqlclient itself; just because MySQL AB have granted a license
-> > exception for OpenSSL does not mean everyone who links to libmysqlclient
-> > has done so.
-
-> > I know of at least one GPL-without-exception package that is now using
-> > libmysqlclient12 in Debian.
-
-> Nice, so we should check that any linked GPL library directly (obviuolsy) or
-> indirectly (with N=1,2,3... levels of indirection) linked against
-> openssl adds the exception.
-
-No, we should simply not be linking libmysqlclient against OpenSSL. The
-exemption was needed because there exists software that uses both
-libmysqlclient and libssl, but making libmysqlclient itself use libssl just
-because we now have the exemption will cause licensing problems for
-applications which currently do *not* depend on libssl.
-
-> This is a great reason to move asap all possible programs to gnutls,
-> indeed.
-
-There are plenty of reasons to move software to gnutls, but doing so is
-non-trivial.
diff --git a/debian/defs.mk.in b/debian/defs.mk.in
deleted file mode 100644
index dd2c44313be..00000000000
--- a/debian/defs.mk.in
+++ /dev/null
@@ -1,14 +0,0 @@
-MYSQL_BUILD_OPTS=--with-comment='MySQL Server (custom)' --with-server-suffix='-custom'
-MYSQL_BUILD_CXXFLAGS=-DBIG_JOINS=1 -felide-constructors -fno-rtti -O2
-MYSQL_BUILD_CFLAGS=-DBIG_JOINS=1 -O2
-MYSQL_BUILD_CC=gcc
-MYSQL_BUILD_CXX=gcc
-# we re-write state into this file. MYSQL_BASE_VERSION might get a suffix added
-# by debian/rules which could result in a nasty loop. VER is there to hold the
-# original unadorned version from autoconf
-MYSQL_BASE_VERSION=@MYSQL_BASE_VERSION@
-MYSQL_PREVIOUS_BASE_VERSION=@MYSQL_PREVIOUS_BASE_VERSION@
-MYSQL_BRANDED_BASE_VERSION=@MYSQL_BRANDED_BASE_VERSION@
-MYSQL_BRANDED_PREVIOUS_BASE_VERSION=@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@
-SHARED_LIB_MAJOR_VERSION=@SHARED_LIB_MAJOR_VERSION@
-NDB_SHARED_LIB_MAJOR_VERSION=@NDB_SHARED_LIB_MAJOR_VERSION@
diff --git a/debian/libmysqlclientSLIB-dev.README.Maintainer.in b/debian/libmysqlclientSLIB-dev.README.Maintainer.in
deleted file mode 100644
index 56b4088cbfb..00000000000
--- a/debian/libmysqlclientSLIB-dev.README.Maintainer.in
+++ /dev/null
@@ -1,4 +0,0 @@
-The examples directory includes files that might be needed by some
-developers:
-- header files not installed by default
-- the example file udf_example.cc
diff --git a/debian/libmysqlclientSLIB-dev.dirs.in b/debian/libmysqlclientSLIB-dev.dirs.in
deleted file mode 100644
index f6ad2870431..00000000000
--- a/debian/libmysqlclientSLIB-dev.dirs.in
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/include/
-usr/lib/
diff --git a/debian/libmysqlclientSLIB-dev.docs.in b/debian/libmysqlclientSLIB-dev.docs.in
deleted file mode 100644
index eccf2c9c565..00000000000
--- a/debian/libmysqlclientSLIB-dev.docs.in
+++ /dev/null
@@ -1 +0,0 @@
-EXCEPTIONS-CLIENT
diff --git a/debian/libmysqlclientSLIB-dev.examples.in b/debian/libmysqlclientSLIB-dev.examples.in
deleted file mode 100644
index f1649c311c4..00000000000
--- a/debian/libmysqlclientSLIB-dev.examples.in
+++ /dev/null
@@ -1 +0,0 @@
-sql/udf_example.c
diff --git a/debian/libmysqlclientSLIB-dev.files.in b/debian/libmysqlclientSLIB-dev.files.in
deleted file mode 100644
index b4a87c1bb2b..00000000000
--- a/debian/libmysqlclientSLIB-dev.files.in
+++ /dev/null
@@ -1,7 +0,0 @@
-usr/bin/mysql_config
-usr/bin/comp_err
-usr/include/*
-usr/lib/libmysqlclient.a
-usr/lib/libmysqlclient.la
-usr/lib/mysql
-usr/share/man/man1/mysql_config.1
diff --git a/debian/libmysqlclientSLIB-dev.links.in b/debian/libmysqlclientSLIB-dev.links.in
deleted file mode 100644
index 4a24953a06b..00000000000
--- a/debian/libmysqlclientSLIB-dev.links.in
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/lib/libmysqlclient.so.15 usr/lib/libmysqlclient.so
-usr/lib/libmysqlclient_r.so.15 usr/lib/libmysqlclient_r.so
diff --git a/debian/libmysqlclientSLIBoff.README.Debian.in b/debian/libmysqlclientSLIBoff.README.Debian.in
deleted file mode 100644
index 26549106092..00000000000
--- a/debian/libmysqlclientSLIBoff.README.Debian.in
+++ /dev/null
@@ -1,30 +0,0 @@
-* Crashs on systems with Cyrix or other old i486 CPUs
-=====================================================
-
-As reported http://bugs.mysql.com/bug.php?id=21765 MySQL will segfault on very
-old CPUs that do not have support for the "cpuid" instruction.
-
-
-
-* Self-build binaries that are linked against libmysqlclient15 MUST be rebuild!
-===============================================================================
-
-This only affects binaries that are build on a Debian unstable/testing system
-before 2006-03-31 or version 5.0.19. "objdump -T myprogram | grep MYSQL_5.0"
-will give a couple of lines output in such a case.
-
-Until now libmysqlclient.so.15 had versioned symbols provided by a Debian
-patch. Now MySQL finally decided to adopt this patch but sadly chosed a
-different symbol name.
-
-Binaries linked against the old version of the library with my symbol name will
-not run with the new version with MySQL's symbol name ("version `MYSQL_5.0' not
-found"). The actual name /usr/lib/libmysqlclient.so.15 must stay because else
-binaries coming from systems other than Debian would never run on a Debian
-server.
-
-So the Debian package had to be renamed from "libmysqlclient15" to
-"libmysqlclient15off" and do now conflict with their former version.
-
--- 2006-03-14, Christian Hammers <ch@debian.org>
-
diff --git a/debian/libmysqlclientSLIBoff.dirs.in b/debian/libmysqlclientSLIBoff.dirs.in
deleted file mode 100644
index 2964de6141b..00000000000
--- a/debian/libmysqlclientSLIBoff.dirs.in
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/
diff --git a/debian/libmysqlclientSLIBoff.docs.in b/debian/libmysqlclientSLIBoff.docs.in
deleted file mode 100644
index eccf2c9c565..00000000000
--- a/debian/libmysqlclientSLIBoff.docs.in
+++ /dev/null
@@ -1 +0,0 @@
-EXCEPTIONS-CLIENT
diff --git a/debian/libmysqlclientSLIBoff.files.in b/debian/libmysqlclientSLIBoff.files.in
deleted file mode 100644
index 5162b7b9639..00000000000
--- a/debian/libmysqlclientSLIBoff.files.in
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libmysqlclient*.so.*
diff --git a/debian/libmysqlclientSLIBoff.postinst.in b/debian/libmysqlclientSLIBoff.postinst.in
deleted file mode 100644
index 29d3b86f978..00000000000
--- a/debian/libmysqlclientSLIBoff.postinst.in
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash -e
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
-
-# vim: ts=4
-
-
diff --git a/debian/libndbclientNLIB-dev.dirs.in b/debian/libndbclientNLIB-dev.dirs.in
deleted file mode 100644
index 4a854656b34..00000000000
--- a/debian/libndbclientNLIB-dev.dirs.in
+++ /dev/null
@@ -1,3 +0,0 @@
-usr/include/mysql/storage/ndb/
-usr/include/
-usr/lib/
diff --git a/debian/libndbclientNLIB-dev.files.in b/debian/libndbclientNLIB-dev.files.in
deleted file mode 100644
index 995eb2c71fb..00000000000
--- a/debian/libndbclientNLIB-dev.files.in
+++ /dev/null
@@ -1,3 +0,0 @@
-usr/include/mysql/storage/ndb/*
-usr/lib/libndbclient.a
-usr/lib/libndbclient.la
diff --git a/debian/libndbclientNLIB-dev.links.in b/debian/libndbclientNLIB-dev.links.in
deleted file mode 100644
index 4e0bf17ebd5..00000000000
--- a/debian/libndbclientNLIB-dev.links.in
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libndbclient.so.4 usr/lib/libndbclient.so
diff --git a/debian/libndbclientNLIB.README.Debian.in b/debian/libndbclientNLIB.README.Debian.in
deleted file mode 100644
index 26549106092..00000000000
--- a/debian/libndbclientNLIB.README.Debian.in
+++ /dev/null
@@ -1,30 +0,0 @@
-* Crashs on systems with Cyrix or other old i486 CPUs
-=====================================================
-
-As reported http://bugs.mysql.com/bug.php?id=21765 MySQL will segfault on very
-old CPUs that do not have support for the "cpuid" instruction.
-
-
-
-* Self-build binaries that are linked against libmysqlclient15 MUST be rebuild!
-===============================================================================
-
-This only affects binaries that are build on a Debian unstable/testing system
-before 2006-03-31 or version 5.0.19. "objdump -T myprogram | grep MYSQL_5.0"
-will give a couple of lines output in such a case.
-
-Until now libmysqlclient.so.15 had versioned symbols provided by a Debian
-patch. Now MySQL finally decided to adopt this patch but sadly chosed a
-different symbol name.
-
-Binaries linked against the old version of the library with my symbol name will
-not run with the new version with MySQL's symbol name ("version `MYSQL_5.0' not
-found"). The actual name /usr/lib/libmysqlclient.so.15 must stay because else
-binaries coming from systems other than Debian would never run on a Debian
-server.
-
-So the Debian package had to be renamed from "libmysqlclient15" to
-"libmysqlclient15off" and do now conflict with their former version.
-
--- 2006-03-14, Christian Hammers <ch@debian.org>
-
diff --git a/debian/libndbclientNLIB.dirs.in b/debian/libndbclientNLIB.dirs.in
deleted file mode 100644
index 2964de6141b..00000000000
--- a/debian/libndbclientNLIB.dirs.in
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/
diff --git a/debian/libndbclientNLIB.files.in b/debian/libndbclientNLIB.files.in
deleted file mode 100644
index f212e302299..00000000000
--- a/debian/libndbclientNLIB.files.in
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libndbclient*.so.*
diff --git a/debian/libndbclientNLIB.postinst.in b/debian/libndbclientNLIB.postinst.in
deleted file mode 100644
index 29d3b86f978..00000000000
--- a/debian/libndbclientNLIB.postinst.in
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash -e
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
-
-# vim: ts=4
-
-
diff --git a/debian/mysql-client-BASE.NEWS.in b/debian/mysql-client-BASE.NEWS.in
deleted file mode 100644
index 272621ff48d..00000000000
--- a/debian/mysql-client-BASE.NEWS.in
+++ /dev/null
@@ -1,6 +0,0 @@
-mysql-dfsg-5.0 (5.0.24a-2) unstable; urgency=low
-
- This package now includes "mysqlreport" from hackmysql.com which generates
- a friendly report on the performance relevant variables from SHOW STATUS.
-
- -- Christian Hammers <ch@debian.org> Sun, 3 Sep 2006 16:26:41 +0200
diff --git a/debian/mysql-client-BASE.README.Debian.in b/debian/mysql-client-BASE.README.Debian.in
deleted file mode 100644
index b245638f9c9..00000000000
--- a/debian/mysql-client-BASE.README.Debian.in
+++ /dev/null
@@ -1,4 +0,0 @@
-FAQ:
-
-Q: My <tab> completition is gone, why?
-A: You have "no-auto-rehash" in the "[mysql]" section of /etc/mysql/my.cnf!
diff --git a/debian/mysql-client-BASE.dirs.in b/debian/mysql-client-BASE.dirs.in
deleted file mode 100644
index 63c303b03fc..00000000000
--- a/debian/mysql-client-BASE.dirs.in
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/bin/
-usr/share/man/man1/
diff --git a/debian/mysql-client-BASE.docs.in b/debian/mysql-client-BASE.docs.in
deleted file mode 100644
index 5bb6d569f28..00000000000
--- a/debian/mysql-client-BASE.docs.in
+++ /dev/null
@@ -1,2 +0,0 @@
-README
-EXCEPTIONS-CLIENT
diff --git a/debian/mysql-client-BASE.files.in b/debian/mysql-client-BASE.files.in
deleted file mode 100644
index df635f5e911..00000000000
--- a/debian/mysql-client-BASE.files.in
+++ /dev/null
@@ -1,18 +0,0 @@
-usr/bin/msql2mysql
-usr/bin/mysql
-usr/bin/mysql_find_rows
-usr/bin/mysql_tableinfo
-usr/bin/mysql_waitpid
-usr/bin/mysqlaccess
-usr/bin/mysqladmin
-usr/bin/mysqlbinlog
-usr/bin/mysqlcheck
-usr/bin/mysqldump
-usr/bin/mysqlimport
-usr/bin/mysqlshow
-usr/share/lintian/overrides/mysql-client-@MYSQL_BRANDED_BASE_VERSION@
-usr/share/man/man1/mysql.1
-usr/share/man/man1/mysqlaccess.1
-usr/share/man/man1/mysqladmin.1
-usr/share/man/man1/mysqldump.1
-usr/share/man/man1/mysqlshow.1
diff --git a/debian/mysql-client-BASE.lintian-overrides.in b/debian/mysql-client-BASE.lintian-overrides.in
deleted file mode 100644
index 9de261e2154..00000000000
--- a/debian/mysql-client-BASE.lintian-overrides.in
+++ /dev/null
@@ -1 +0,0 @@
-mysql-client-@MYSQL_BRANDED_BASE_VERSION@: package-has-a-duplicate-relation
diff --git a/debian/mysql-common.README.Debian.in b/debian/mysql-common.README.Debian.in
deleted file mode 100644
index ab7d01defe1..00000000000
--- a/debian/mysql-common.README.Debian.in
+++ /dev/null
@@ -1,20 +0,0 @@
-[passwords]
-If you change the password of the root user (which is strongly recommended)
-you have to create a personal mysql config file in order to let cron run
-the /etc/cron.daily script without asking you for the password.
-The /root/.my.cnf file should be chmod 0600 (-rw------- root root .my.cnf)
-and have the following content:
-[mysqladmin]
-user = root
-password = <secret>
-
-[more than one process]
-Note that the shutdown script cannot use the pid number stored in
-/var/run, since it is for the first mysqld thread, but we need to kill
-the most recent thread to shutdown the server. The upstream developers
-are aware of this bug. When maintaining your database, you should use
-mysqladmin with your password to shutdown and reload the server rather
-than /etc/init.d/mysql.
-
-Scott Hanson and Christian Hammers
-<shanson@debian.org> <ch@debian.org>
diff --git a/debian/mysql-common.dirs.in b/debian/mysql-common.dirs.in
deleted file mode 100644
index a5a88ede9c1..00000000000
--- a/debian/mysql-common.dirs.in
+++ /dev/null
@@ -1 +0,0 @@
-etc/mysql/conf.d/
diff --git a/debian/mysql-common.files.in b/debian/mysql-common.files.in
deleted file mode 100644
index c052beb0027..00000000000
--- a/debian/mysql-common.files.in
+++ /dev/null
@@ -1,2 +0,0 @@
-etc/mysql/my.cnf
-usr/share/mysql-common/internal-use-only
diff --git a/debian/mysql-common.postrm.in b/debian/mysql-common.postrm.in
deleted file mode 100644
index 3ca45870165..00000000000
--- a/debian/mysql-common.postrm.in
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-if [ "$1" = "purge" ]; then
- rmdir /etc/mysql 2>/dev/null || true
-fi
-
-#DEBHELPER#
diff --git a/debian/mysql-common.preinst.in b/debian/mysql-common.preinst.in
deleted file mode 100644
index 362990bd130..00000000000
--- a/debian/mysql-common.preinst.in
+++ /dev/null
@@ -1,215 +0,0 @@
-#!/bin/bash -e
-#
-# summary of how this script can be called:
-# * <new-preinst> install
-# * <new-preinst> install <old-version>
-# * <new-preinst> upgrade <old-version>
-# * <old-preinst> abort-upgrade <new-version>
-#
-
-if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
-${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
-
-export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin
-
-# Try to stop the server in a sane way. If it does not success let the admin
-# do it himself. No database directories should be removed while the server
-# is running! Another mysqld in e.g. a different chroot is fine for us.
-stop_server() {
- if [ ! -x /etc/init.d/mysql ]; then return; fi
-
- set +e
- if [ -x /usr/sbin/invoke-rc.d ]; then
- cmd="invoke-rc.d mysql stop"
- else
- cmd="/etc/init.d/mysql stop"
- fi
- $cmd
- errno=$?
- set -e
-
- # 0=ok, 100=no init script (fresh install)
- if [ "$errno" != 0 -a "$errno" != 100 ]; then
- echo "${cmd/ */} returned $errno" 1>&2
- echo "There is a MySQL server running, but we failed in our attempts to stop it." 1>&2
- echo "Stop it yourself and try again!" 1>&2
- exit 1
- fi
-}
-
-start_server() {
- if [ ! -x /etc/init.d/mysql ]; then return; fi
-
- set +e
- if [ -x /usr/sbin/invoke-rc.d ]; then
- cmd="invoke-rc.d mysql start"
- else
- cmd="/etc/init.d/mysql start"
- fi
- $cmd
- set -e
-}
-
-##### here's a bunch of helper functions for converting database formats ######
-
-cvt_get_param(){
- /usr/sbin/mysqld --print-defaults \
- | tr " " "\n" \
- | grep -- "--$1" \
- | tail -n 1 \
- | cut -d= -f2
-}
-
-cvt_setup_stuff(){
- mytmp=`mktemp -d -t mysql-ISAM-convert.XXXXXX`
- cvt_log="$mytmp/conversion.log"
- if [ ! -d "$mytmp" ]; then
- echo "can't create temporary directory, oh well." >&2
- exit 1
- fi
-
- chgrp mysql $mytmp
- chmod g+rwx $mytmp
- cvt_socket=${mytmp}/mysql.sock
-
- cvt_mysqld="mysqld --skip-grant-tables --skip-networking --socket $cvt_socket"
- cvt_mysql="mysql --socket $cvt_socket"
- cvt_mysqladmin="mysqladmin --socket $cvt_socket"
-}
-
-cvt_get_databases(){
- echo fetching database list ... >&2
- $cvt_mysql -e 'show databases' | sed -n -e '2,$p'
-}
-
-cvt_get_tables(){
- echo querying tables in $1 ... >&2
- $cvt_mysql $1 -e 'show table status' | sed -n -e '2,$p' | \
- cut -f 1,2 | grep -w 'ISAM$' | cut -f 1
-}
-
-cvt_convert_table(){
- echo converting $1.$2 ... >&2
- $cvt_mysql $1 -e "alter table $2 type=MyISAM"
-}
-
-cvt_wait_for_server(){
- local count
- echo -n waiting for server startup.. >&2
- while ! $cvt_mysql </dev/null >/dev/null 2>&1; do
- echo -n . >&2
- sleep 1
- count=".$count"
- if [ -f $mytmp/mysql.done ]; then
- echo "sorry... looks like the server crashed :(" >&2
- return 1
- elif [ "$count" = "...................." ]; then
- echo "sorry... looks like the server didn't start :(" >&2
- return 1
- fi
- done
- echo ok. >&2
-}
-
-cvt_wait_for_exit(){
- local count
- echo -n waiting for server shutdown.. >&2
- while [ ! -f $mytmp/mysql.done ]; do
- echo -n . >&2
- sleep 1
- count=".$count"
- if [ "$count" = "...................." ]; then
- echo "hrm... guess it never started?" >&2
- return 0
- fi
- done
- echo ok. >&2
-}
-
-cvt_cleanup(){
- local mysql_kids
- rm -rf $mytmp
- # kill any mysqld child processes left over. there *shouldn't* be any,
- # but let's not take chances with that
- mysql_kids=`ps o 'pid command' --ppid $$ | grep -E '^[[:digit:]]+ mysqld ' | cut -d' ' -f1`
- if [ "$mysql_kids" ]; then
- echo "strange, some mysql processes left around. killing them now." >&2
- kill $mysql_kids
- sleep 10
- mysql_kids=`ps o 'pid command' --ppid $$ | grep -E '^[[:digit:]]+ mysqld ' | cut -d' ' -f1`
- if [ "$mysql_kids" ]; then
- echo "okay, they're really not getting the hint..." >&2
- kill -9 $mysql_kids
- fi
- fi
-}
-
-################################ main() ##########################
-
-# test if upgrading from non conffile state
-if [ "$1" = "upgrade" ] && [ -x /usr/sbin/mysqld ]; then
- cvt_datadir=`cvt_get_param datadir`
- # test for ISAM tables, which we must convert NOW
- if [ -n "`find $cvt_datadir -name '*.ISM' 2>/dev/null`" ]; then
- pidfile=`cvt_get_param pid-file`
- if [ "$pidfile" ] && [ -f "$pidfile" ]; then
- server_pid=`cat $pidfile`
- if [ "$server_pid" ] && ps $server_pid >/dev/null 2>&1; then
- server_running="yes"
- fi
- fi
- # to be sure
- stop_server
-
- set +e
- cat << EOF >&2
-----------------------------------------
-WARNING WARNING WARNING
-----------------------------------------
-
-It has been detected that are are using ISAM format on some of your
-mysql database tables. This format has been deprecated and no longer
-supported. to prevent these databases from essentially disappearing,
-an attempt at format conversion will now be made. please check after
-your upgrade that all tables are present and accounted for.
-
-apologies for the noise, but we thought you'd appreciate it :)
-
-----------------------------------------
-WARNING WARNING WARNING
-----------------------------------------
-EOF
- cvt_setup_stuff
- ($cvt_mysqld >$cvt_log 2>&1; touch $mytmp/mysql.done ) &
-
- if cvt_wait_for_server; then
- dbs=`cvt_get_databases`
- for db in $dbs; do
- tables=`cvt_get_tables $db`
- for tbl in $tables; do
- cvt_convert_table $db $tbl
- done
- done
- else
- cvt_error="yes"
- fi
-
- echo shutting down server... >&2
- $cvt_mysqladmin shutdown
- cvt_wait_for_exit
- echo "all done!" >&2
- if [ ! "$cvt_error" = "yes" ]; then
- cvt_cleanup
- else
- echo "you might want to look in $mytmp..." >&2
- fi
-
- if [ "$server_running" ]; then
- start_server
- fi
-
- set -e
- fi
-fi
-
-exit 0
diff --git a/debian/mysql-extra-BASE.dirs.in b/debian/mysql-extra-BASE.dirs.in
deleted file mode 100644
index e7724817552..00000000000
--- a/debian/mysql-extra-BASE.dirs.in
+++ /dev/null
@@ -1 +0,0 @@
-usr/bin
diff --git a/debian/mysql-extra-BASE.files.in b/debian/mysql-extra-BASE.files.in
deleted file mode 100644
index 2ecc73d3f2e..00000000000
--- a/debian/mysql-extra-BASE.files.in
+++ /dev/null
@@ -1,3 +0,0 @@
-usr/bin/ndb_drop_index
-usr/bin/ndb_drop_table
-usr/bin/ndb_delete_all
diff --git a/debian/mysql-management-BASE.dirs.in b/debian/mysql-management-BASE.dirs.in
deleted file mode 100644
index 236670a2d0f..00000000000
--- a/debian/mysql-management-BASE.dirs.in
+++ /dev/null
@@ -1 +0,0 @@
-usr/sbin
diff --git a/debian/mysql-management-BASE.files.in b/debian/mysql-management-BASE.files.in
deleted file mode 100644
index f828b13bd5f..00000000000
--- a/debian/mysql-management-BASE.files.in
+++ /dev/null
@@ -1 +0,0 @@
-usr/sbin/ndb_mgmd
diff --git a/debian/mysql-management-BASE.mysql-management.init.in b/debian/mysql-management-BASE.mysql-management.init.in
deleted file mode 100644
index 8b3f6e25f4b..00000000000
--- a/debian/mysql-management-BASE.mysql-management.init.in
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/bin/bash
-#
-### BEGIN INIT INFO
-# Provides: mysql-ndb-mgm
-# Required-Start: $syslog
-# Required-Stop: $syslog mysql
-# Should-Start: $local_fs $remote_fs $network $named $time
-# Should-Stop: $local_fs $remote_fs $network $named $time
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: Start and stop the mysql database cluster management daemon
-# Description: Controls the MySQL NDB Management Node daemon "ndb_mgmd".
-### END INIT INFO
-#
-set -e
-set -u
-${DEBIAN_SCRIPT_DEBUG:+ set -v -x}
-
-# Variables
-SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
-DAEMON=/usr/sbin/ndb_mgmd
-CONF=/etc/mysql/ndb_mgmd.cnf
-export HOME=/etc/mysql/
-
-# Safeguard (relative paths, core dumps..)
-cd /
-umask 077
-
-# Exit *silently* if we're not supposed to be started.
-#
-# The Debian scripts should execute these scripts to stop and start
-# the daemon when upgrading if it is started. On the other hand it should
-# remain silently if the server has not even been configured.
-# See /usr/share/doc/mysql-server-*/README.Debian for more information.
-test -x $DAEMON || exit 0
-test -r $CONF || exit 0
-. /lib/lsb/init-functions
-
-#
-# main()
-#
-case "${1:-''}" in
- 'start')
- # Start daemon
- log_daemon_msg "Starting MySQL NDB Management Node" "ndb_mgmd"
- # --pid-file does not work as the daemon forks itself with $PID=$PID+1
- if start-stop-daemon \
- --start \
- --exec $DAEMON \
- --user mysql \
- -- \
- -f $CONF
- then
- log_end_msg 0
- else
- log_end_msg 1
- log_warning_msg "Please take a look at the syslog."
- exit 1
- fi
- ;;
-
- 'stop')
- log_daemon_msg "Stopping MySQL NDB Management Node" "ndb_mgmd"
- if start-stop-daemon \
- --stop \
- --oknodo \
- --exec $DAEMON
- then
- log_end_msg 0
- else
- log_end_msg 1
- exit 1
- fi
- ;;
-
- 'restart'|'force-reload')
- set +e; $SELF stop; set -e
- $SELF start
- ;;
-
- *)
- echo "Usage: $SELF start|stop|restart|force-reload"
- exit 1
- ;;
-esac
-
diff --git a/debian/mysql-server-BASE.NEWS.in b/debian/mysql-server-BASE.NEWS.in
deleted file mode 100644
index 9884e2694e7..00000000000
--- a/debian/mysql-server-BASE.NEWS.in
+++ /dev/null
@@ -1,10 +0,0 @@
-mysql-dfsg-5.0 (5.0.18-9) unstable; urgency=low
-
- Rotation of the binary logs is now configured in /etc/mysql/my.cnf with
- "expire-logs-days" which defaults to 20 days. The old file
- /etc/mysql/debian-log-rotate.conf should be removed together with
- /etc/cron.daily/mysql-server after this value has been adjusted. Note that
- the old variable defined the number of files whereas the new one defines
- a time span in days.
-
- -- Christian Hammers <ch@debian.org> Tue, 24 Jan 2006 22:18:21 +0100
diff --git a/debian/mysql-server-BASE.README.Debian.in b/debian/mysql-server-BASE.README.Debian.in
deleted file mode 100644
index ca9eca271c0..00000000000
--- a/debian/mysql-server-BASE.README.Debian.in
+++ /dev/null
@@ -1,125 +0,0 @@
-
-* REMEMBER TO SET THE ROOT PASSWORD !!!
-============================================================================
-
-* MYSQL WON'T INSTALL?
-======================
-MySQL will only install if you have a non-numeric hostname that is resolvable
-via the /etc/hosts file. E.g. if the "hostname" command returns "myhostname"
-then there must be a line like "10.0.0.1 myhostname".
-
-On upgrades from MySQL 3.23, as shipped with Debian Woody, symlinks in place of
-/var/lib/mysql or /var/log/mysql gets accidently removed and have manually be
-restored.
-
-* MYSQL WON'T START OR STOP?
-============================
-You may never ever delete the special mysql user "debian-sys-maint". This
-user together with the credentials in /etc/mysql/debian.cnf are used by the
-init scripts to stop the server as they would require knowledge of the mysql
-root users password else.
-So in most of the times you can fix the situation by making sure that the
-debian.cnf file contains the right password, e.g. by setting a new one
-(remember to do a "flush privileges" then).
-
-* WHAT TO DO AFTER UPGRADES:
-============================
- - running mysql_upgrade to be able to make use of possibly added new
- privilege columns. This script does not give any use more rights.
-
-* WHAT TO DO AFTER INSTALLATION:
-================================
-The MySQL manual describes certain steps to do at this stage in a separate
-chapter. They are not necessary as the Debian packages does them
-automatically.
-
-The only thing that is left over for the admin is
- - setting the *passwords* !!!
- - creating new users and databases
- - read the rest of this text
-
-* DOWNGRADING TO 4.0 or 4.1:
-============================
-Unsupported. Period.
-But if you do and get problems or make interesting experiences, mail me, it
-might help others.
-Ok, if you really want, I would recommend to "mysqldump --opt" all tables,
-then purge 4.1, delete /var/lib/mysql, install 4.0 and insert the dumps. Be
-carefully, though, with the "mysql" table, you might not simply overwrite that
-one as the password for the mysql "debian-sys-maint" user is stored in
-/etc/mysql/debian.cnf and needed by /etc/init.d/ to start mysql and check if
-it's alive.
-
-* SOME APPLICATION CAN NO LONGER CONNECT:
-=========================================
-This application is probably linked against libmysqlclient12 or below and
-somebody has created a mysql user with new-style passwords.
-The old_passwords option which forces backwards compatibility, can be set
-in /etc/mysql/conf.d/old_passwords.conf.
-If that does not help, the password can be set manually, the application that
-inserted the user should be changed or the application that tries to connect
-should be updated to libmysqlclient14 or -15.
-Read http://dev.mysql.com/doc/refman/5.0/en/old-client.html
-
-* NETWORKING:
-=============
-For security reasons, the Debian package has enabled networking only on the
-loop-back device using "bind-address" in /etc/mysql/my.cnf. Check with
-"netstat -tlnp" where it is listening. If your connection is aborted
-immediately see if "mysqld: all" or similar is in /etc/hosts.allow and read
-hosts_access(5).
-
-* WHERE IS THE DOCUMENTATION?:
-==============================
-Unfortunately due to licensing restrictions, debian currently not able
-to provide the mysql-doc package in any format. For the most up to date
-documentation, please go to http://dev.mysql.com/doc.
-
-* PASSWORDS:
-============
-It is strongly recommended to set a password for the mysql root user (which
-is NOT the same as the "normal" root user) with the command:
- /usr/bin/mysqladmin -u root password 'enter-your-good-new-password-here'
-If you already had a password set add " -p " before "-u" to the line above.
-
-If you are tired to type the password in every time or want to automate your
-scripts you can store it in the file $HOME/.my.cnf. It should be chmod 0600
-(-rw------- username username .my.cnf) to ensure that nobody else can read
-it. Every other configuration parameter can be stored there, too. You will
-find an example below and more information in the MySQL manual in
-/usr/share/doc/mysql-doc or www.mysql.com.
-
-ATTENTION: It is necessary, that a .my.cnf from root always contains a "user"
-line wherever there is a "password" line, else, the Debian maintenance
-scripts, that use /etc/mysql/debian.cnf, will use the username
-"debian-sys-maint" but the password that is in root's .my.cnf. Also note,
-that every change you make in the /root/.my.cnf will affect the mysql cron
-script, too.
-
- # an example of $HOME/.my.cnf
- [client]
- user = your-mysql-username
- password = enter-your-good-new-password-here
-
-* BIG_ROWS FOR EVEN MORE ROWS IN A TABLE:
-=========================================
-If you ever run out of rows in a table there is the possibility of building
-the package with "-DBIG_ROWS" which, according to a MySQL employee on
-packagers@lists.mysql.com should lead to a 64bit row index (I guess > 2^32
-rows) but also to an approx. 5% performance loss.
-
-* NDB CLUSTER ENGINE:
-=====================
-NDB is the shared-nothing cluster engine since MySQL-4.1.
-This package contains the all three components, the mysql backend, the NDB
-Data Node and the NDB Management Node. The init scripts of the cluster
-daemons will silently exit unless their configuration is provided:
- mysql-ndb: needs "ndb-connectstring" in /etc/mysql/my.cnf
- mysql-ndb-mgm: needs /etc/mysql/ndb_mgmd.cnf
-
-* EXPIRE_LOGS_DAYS AND LOG_BIN:
-===============================
-Having expire_logs_days enabled but log-bin not crashes the server. Using both
-or none of those options is safe. To prevent this happening during the nightly
-log rotation via /etc/logrotate.d/mysql the initscript checks for malicious
-combination of options. This is Debian bug #368547 and MySQL bug #17733.
diff --git a/debian/mysql-server-BASE.config.in b/debian/mysql-server-BASE.config.in
deleted file mode 100644
index c89c6127dc2..00000000000
--- a/debian/mysql-server-BASE.config.in
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash -e
-
-. /usr/share/debconf/confmodule
-
-if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
-${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
-
-CNF=/etc/mysql/my.cnf
-
-# Beware that there are two ypwhich one of them needs the 2>/dev/null!
-if test -n "`which ypwhich 2>/dev/null`" && ypwhich >/dev/null 2>&1; then
- db_input high mysql-server-@MYSQL_BRANDED_BASE_VERSION@/nis_warning || true
- db_go
-fi
-
-# only ask this question on fresh installs and during "reconfiguration".
-# there is also an additional check for empty root passwords in the
-# postinst script when the tools are available for us to use.
-if [ "$1" = "configure" ] && [ -z "$2" ] || [ "$1" = "reconfigure" ]; then
- db_input medium mysql-server/root_password || true
- db_go
-fi
-
-# If this is an upgrade of an already existing installation ask the user if
-# we may use the backwards incompatible but more secure password format.
-# This should not be shown at dpkg-reconfigure and except for the dist-upgrade,
-# config files are for the admin only!
-# Read: If mysql was already installed but not from Etch and it was either 4.0
-# or had old_passwords enabled before then the system is affected.
-if [ "$1" = "configure" ] &&
- [ -f $CNF ] &&
- (
- [ ! -f /var/lib/mysql/debian-4.1.flag ] ||
- egrep -q -i '^[[:space:]]*old.passwords[[:space:]]*=[[:space:]]*(1|true)' $CNF
- )
-then
- db_input medium mysql-server-@MYSQL_BRANDED_BASE_VERSION@/need_sarge_compat || true
- db_go
-fi
diff --git a/debian/mysql-server-BASE.dirs.in b/debian/mysql-server-BASE.dirs.in
deleted file mode 100644
index 62ce062ac84..00000000000
--- a/debian/mysql-server-BASE.dirs.in
+++ /dev/null
@@ -1,13 +0,0 @@
-etc/init.d
-etc/logrotate.d
-usr/bin
-usr/lib
-usr/lib/mysql
-usr/sbin
-usr/share/man/man8
-usr/share/info
-usr/share/mysql
-usr/lib/pkgconfig
-var/run/mysqld
-var/lib/mysql-upgrade
-var/lib/mysql-cluster
diff --git a/debian/mysql-server-BASE.docs.in b/debian/mysql-server-BASE.docs.in
deleted file mode 100644
index d624701bb8f..00000000000
--- a/debian/mysql-server-BASE.docs.in
+++ /dev/null
@@ -1,2 +0,0 @@
-EXCEPTIONS-CLIENT
-debian/copyright.more
diff --git a/debian/mysql-server-BASE.files.in b/debian/mysql-server-BASE.files.in
deleted file mode 100644
index 3481faa968a..00000000000
--- a/debian/mysql-server-BASE.files.in
+++ /dev/null
@@ -1,50 +0,0 @@
-usr/bin/my_print_defaults
-usr/bin/myisam_ftdump
-usr/bin/myisamchk
-usr/bin/myisamlog
-usr/bin/myisampack
-usr/bin/mysql_convert_table_format
-usr/bin/mysql_explain_log
-usr/bin/mysql_fix_extensions
-usr/bin/mysql_fix_privilege_tables
-usr/bin/mysql_install_db
-usr/bin/mysql_secure_installation
-usr/bin/mysql_setpermission
-usr/bin/mysql_tzinfo_to_sql
-usr/bin/mysql_upgrade
-usr/bin/mysql_zap
-usr/bin/mysqlbug
-usr/bin/mysqld_multi
-usr/bin/mysqld_safe
-usr/bin/mysqldumpslow
-usr/bin/mysqlhotcopy
-usr/bin/mysqltest
-usr/bin/perror
-usr/bin/replace
-usr/bin/resolve_stack_dump
-usr/bin/resolveip
-usr/sbin/mysqld
-usr/sbin/mysqlmanager
-usr/lib/mysql/mysqld.sym
-usr/share/lintian/overrides/mysql-server-@MYSQL_BRANDED_BASE_VERSION@
-usr/share/info/mysql.info
-usr/share/man/man1/mysqlman.1
-usr/share/man/man1/my_print_defaults.1
-usr/share/man/man1/myisam_ftdump.1
-usr/share/man/man1/myisamchk.1
-usr/share/man/man1/myisamlog.1
-usr/share/man/man1/myisampack.1
-usr/share/man/man1/mysql_explain_log.1
-usr/share/man/man8/mysqld.8
-usr/share/man/man1/mysqld_multi.1
-usr/share/man/man1/mysqld_safe.1
-usr/share/man/man1/mysql_fix_privilege_tables.1
-usr/share/man/man1/mysql_install_db.1
-usr/share/man/man1/mysqlhotcopy.1
-usr/share/man/man8/mysqlmanager.8
-usr/share/man/man1/mysql_upgrade.1
-usr/share/man/man1/mysql_tzinfo_to_sql.1
-usr/share/man/man1/mysql_zap.1
-usr/share/man/man1/perror.1
-usr/share/man/man1/replace.1
-usr/share/man/man1/safe_mysqld.1
diff --git a/debian/mysql-server-BASE.links.in b/debian/mysql-server-BASE.links.in
deleted file mode 100644
index b023931144d..00000000000
--- a/debian/mysql-server-BASE.links.in
+++ /dev/null
@@ -1 +0,0 @@
-usr/bin/mysqld_safe usr/bin/safe_mysqld
diff --git a/debian/mysql-server-BASE.lintian-overrides.in b/debian/mysql-server-BASE.lintian-overrides.in
deleted file mode 100644
index 7eceabc1aec..00000000000
--- a/debian/mysql-server-BASE.lintian-overrides.in
+++ /dev/null
@@ -1,4 +0,0 @@
-mysql-server-@MYSQL_BRANDED_BASE_VERSION@: possible-bashism-in-maintainer-script postinst:81 'p{("a".."z","A".."Z",0..9)[int(rand(62))]}'
-mysql-server-@MYSQL_BRANDED_BASE_VERSION@: possible-bashism-in-maintainer-script preinst:33 '${cmd/ */}'
-mysql-server-@MYSQL_BRANDED_BASE_VERSION@: statically-linked-binary ./usr/bin/mysql_tzinfo_to_sql
-mysql-server-@MYSQL_BRANDED_BASE_VERSION@: statically-linked-binary ./usr/sbin/mysqld
diff --git a/debian/mysql-server-BASE.logcheck.ignore.paranoid.in b/debian/mysql-server-BASE.logcheck.ignore.paranoid.in
deleted file mode 100644
index 61231af32fc..00000000000
--- a/debian/mysql-server-BASE.logcheck.ignore.paranoid.in
+++ /dev/null
@@ -1,10 +0,0 @@
-/etc/init.d/mysql\[[0-9]+\]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists\!$
-/etc/init.d/mysql\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$
-mysqld\[[0-9]+\]: $
-mysqld\[[0-9]+\]: Support MySQL by buying support/licenses at http://shop.mysql.com$
-mysqld\[[0-9]+\]: Version: .* socket: '/var/run/mysqld/mysqld.sock' port: 3306$
-mysqld\[[0-9]+\]: Warning: Ignoring user change to 'mysql' because the user was set to 'mysql' earlier on the command line$
-mysqld_safe\[[0-9]+\]: started$
-mysqld_safe\[[0-9]+\]: Support MySQL by buying support/licenses at http://shop.mysql.com *$
-usermod\[[0-9]+\]: change user `mysql' GID from `([0-9]+)' to `\1'$
-usermod\[[0-9]+\]: change user `mysql' shell from `/bin/false' to `/bin/false'$
diff --git a/debian/mysql-server-BASE.logcheck.ignore.server.in b/debian/mysql-server-BASE.logcheck.ignore.server.in
deleted file mode 100644
index 3a7de17f3f8..00000000000
--- a/debian/mysql-server-BASE.logcheck.ignore.server.in
+++ /dev/null
@@ -1,31 +0,0 @@
-/etc/init.d/mysql\[[0-9]+\]: [0-9]+ processes alive and '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$
-/etc/init.d/mysql\[[0-9]+\]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists\!$
-/etc/init.d/mysql\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$
-mysqld\[[0-9]+\]: ?$
-mysqld\[[0-9]+\]: .*InnoDB: Shutdown completed
-mysqld\[[0-9]+\]: .*InnoDB: Started;
-mysqld\[[0-9]+\]: .*InnoDB: Starting shutdown\.\.\.$
-mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: Normal shutdown$
-mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: ready for connections\.$
-mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: Shutdown complete$
-mysqld\[[0-9]+\]: Support MySQL by buying support/licenses at http://shop.mysql.com$
-mysqld\[[0-9]+\]: /usr/sbin/mysqld: ready for connections\.$
-mysqld\[[0-9]+\]: .*/usr/sbin/mysqld: Shutdown Complete$
-mysqld\[[0-9]+\]: Version: .* socket
-mysqld\[[0-9]+\]: Warning: Ignoring user change to 'mysql' because the user was set to 'mysql' earlier on the command line$
-mysqld_safe\[[0-9]+\]: ?$
-mysqld_safe\[[0-9]+\]: able to use the new GRANT command!$
-mysqld_safe\[[0-9]+\]: ended$
-mysqld_safe\[[0-9]+\]: http://www.mysql.com$
-mysqld_safe\[[0-9]+\]: NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run$
-mysqld_safe\[[0-9]+\]: PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !$
-mysqld_safe\[[0-9]+\]: Please report any problems with the /usr/bin/mysqlbug script!$
-mysqld_safe\[[0-9]+\]: See the manual for more instructions.$
-mysqld_safe\[[0-9]+\]: started$
-mysqld_safe\[[0-9]+\]: Support MySQL by buying support/licenses at
-mysqld_safe\[[0-9]+\]: The latest information about MySQL is available on the web at$
-mysqld_safe\[[0-9]+\]: the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be$
-mysqld_safe\[[0-9]+\]: To do so, start the server, then issue the following commands:$
-mysqld_safe\[[0-9]+\]: /usr/bin/mysqladmin -u root password 'new-password'$
-usermod\[[0-9]+\]: change user `mysql' GID from `([0-9]+)' to `\1'$
-usermod\[[0-9]+\]: change user `mysql' shell from `/bin/false' to `/bin/false'$
diff --git a/debian/mysql-server-BASE.logcheck.ignore.workstation.in b/debian/mysql-server-BASE.logcheck.ignore.workstation.in
deleted file mode 100644
index 3a7de17f3f8..00000000000
--- a/debian/mysql-server-BASE.logcheck.ignore.workstation.in
+++ /dev/null
@@ -1,31 +0,0 @@
-/etc/init.d/mysql\[[0-9]+\]: [0-9]+ processes alive and '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$
-/etc/init.d/mysql\[[0-9]+\]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists\!$
-/etc/init.d/mysql\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$
-mysqld\[[0-9]+\]: ?$
-mysqld\[[0-9]+\]: .*InnoDB: Shutdown completed
-mysqld\[[0-9]+\]: .*InnoDB: Started;
-mysqld\[[0-9]+\]: .*InnoDB: Starting shutdown\.\.\.$
-mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: Normal shutdown$
-mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: ready for connections\.$
-mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: Shutdown complete$
-mysqld\[[0-9]+\]: Support MySQL by buying support/licenses at http://shop.mysql.com$
-mysqld\[[0-9]+\]: /usr/sbin/mysqld: ready for connections\.$
-mysqld\[[0-9]+\]: .*/usr/sbin/mysqld: Shutdown Complete$
-mysqld\[[0-9]+\]: Version: .* socket
-mysqld\[[0-9]+\]: Warning: Ignoring user change to 'mysql' because the user was set to 'mysql' earlier on the command line$
-mysqld_safe\[[0-9]+\]: ?$
-mysqld_safe\[[0-9]+\]: able to use the new GRANT command!$
-mysqld_safe\[[0-9]+\]: ended$
-mysqld_safe\[[0-9]+\]: http://www.mysql.com$
-mysqld_safe\[[0-9]+\]: NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run$
-mysqld_safe\[[0-9]+\]: PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !$
-mysqld_safe\[[0-9]+\]: Please report any problems with the /usr/bin/mysqlbug script!$
-mysqld_safe\[[0-9]+\]: See the manual for more instructions.$
-mysqld_safe\[[0-9]+\]: started$
-mysqld_safe\[[0-9]+\]: Support MySQL by buying support/licenses at
-mysqld_safe\[[0-9]+\]: The latest information about MySQL is available on the web at$
-mysqld_safe\[[0-9]+\]: the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be$
-mysqld_safe\[[0-9]+\]: To do so, start the server, then issue the following commands:$
-mysqld_safe\[[0-9]+\]: /usr/bin/mysqladmin -u root password 'new-password'$
-usermod\[[0-9]+\]: change user `mysql' GID from `([0-9]+)' to `\1'$
-usermod\[[0-9]+\]: change user `mysql' shell from `/bin/false' to `/bin/false'$
diff --git a/debian/mysql-server-BASE.mysql-server.logrotate.in b/debian/mysql-server-BASE.mysql-server.logrotate.in
deleted file mode 100644
index d32bef50588..00000000000
--- a/debian/mysql-server-BASE.mysql-server.logrotate.in
+++ /dev/null
@@ -1,28 +0,0 @@
-# - I put everything in one block and added sharedscripts, so that mysql gets
-# flush-logs'd only once.
-# Else the binary logs would automatically increase by n times every day.
-# - The error log is obsolete, messages go to syslog now.
-/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log {
- daily
- rotate 7
- missingok
- create 640 mysql adm
- compress
- sharedscripts
- postrotate
- test -x /usr/bin/mysqladmin || exit 0
-
- # If this fails, check debian.conf!
- export HOME=/etc/mysql/my.cnf
- MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
- if [ -z "`$MYADMIN ping 2>/dev/null`" ]; then
- # Really no mysqld or rather a missing debian-sys-maint user?
- # If this occurs and is not a error please report a bug.
- if ps cax | grep -q mysqld; then
- exit 1
- fi
- else
- $MYADMIN flush-logs
- fi
- endscript
-}
diff --git a/debian/mysql-server-BASE.postinst.in b/debian/mysql-server-BASE.postinst.in
deleted file mode 100644
index 19ae1892de8..00000000000
--- a/debian/mysql-server-BASE.postinst.in
+++ /dev/null
@@ -1,276 +0,0 @@
-#!/bin/bash -e
-
-. /usr/share/debconf/confmodule
-
-if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
-${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
-
-export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin
-
-# This command can be used as pipe to syslog. With "-s" it also logs to stderr.
-ERR_LOGGER="logger -p daemon.err -t mysqld_safe -i"
-
-invoke() {
- if [ -x /usr/sbin/invoke-rc.d ]; then
- invoke-rc.d mysql $1
- else
- /etc/init.d/mysql $1
- fi
-}
-
-MYSQL_BOOTSTRAP="/usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables --skip-bdb --skip-innodb "
-
-test_mysql_access() {
- mysql --no-defaults -u root -h localhost </dev/null >/dev/null 2>&1
-}
-
-# call with $1 = "online" to connect to the server, otherwise it bootstraps
-set_mysql_rootpw() {
- # forget we ever saw the password. don't use reset to keep the seen status
- db_set mysql-server/root_password ""
-
- tfile=`mktemp`
- if [ ! -f "$tfile" ]; then
- return 1
- fi
-
- # this avoids us having to call "test" or "[" on $rootpw
- cat << EOF > $tfile
-USE mysql;
-UPDATE user SET password=PASSWORD("$rootpw") WHERE user='root';
-FLUSH PRIVILEGES;
-EOF
- if grep -q 'PASSWORD("")' $tfile; then
- retval=0
- elif [ "$1" = "online" ]; then
- mysql --no-defaults -u root -h localhost <$tfile >/dev/null
- retval=$?
- else
- $MYSQL_BOOTSTRAP <$tfile
- retval=$?
- fi
- rm -f $tfile
- return $retval
-}
-
-# This is necessary because mysql_install_db removes the pid file in /var/run
-# and because changed configuration options should take effect immediately.
-# In case the server wasn't running at all it should be ok if the stop
-# script fails. I can't tell at this point because of the cleaned /var/run.
-set +e; invoke stop; set -e
-
-case "$1" in
- configure)
- mysql_cnf=/etc/mysql/my.cnf
- mysql_datadir=/usr/share/mysql
- mysql_statedir=/var/lib/mysql
- mysql_rundir=/var/run/mysqld
- mysql_logdir=/var/log
- mysql_cfgdir=/etc/mysql
- mysql_newlogdir=/var/log/mysql
- mysql_upgradedir=/var/lib/mysql-upgrade
-
- # first things first, if the following symlink exists, it is a preserved
- # copy the old data dir from a mysql upgrade that would have otherwise
- # been replaced by an empty mysql dir. this should restore it.
- for dir in DATADIR LOGDIR; do
- if [ "$dir" = "DATADIR" ]; then targetdir=$mysql_statedir; else targetdir=$mysql_newlogdir; fi
- savelink="$mysql_upgradedir/$dir.link"
- if [ -L "$savelink" ]; then
- # If the targetdir was a symlink before we upgraded it is supposed
- # to be either still be present or not existing anymore now.
- if [ -L "$targetdir" ]; then
- rm "$savelink"
- elif [ ! -d "$targetdir" ]; then
- mv "$savelink" "$targetdir"
- else
- # this should never even happen, but just in case...
- mysql_tmp=`mktemp -d -t mysql-symlink-restore-XXXXXX`
- echo "this is very strange! see $mysql_tmp/README..." >&2
- mv "$targetdir" "$mysql_tmp"
- cat << EOF > "$mysql_tmp/README"
-
-if you're reading this, it's most likely because you had replaced /var/lib/mysql
-with a symlink, then upgraded to a new version of mysql, and then dpkg
-removed your symlink (see #182747 and others). the mysql packages noticed
-that this happened, and as a workaround have restored it. however, because
-/var/lib/mysql seems to have been re-created in the meantime, and because
-we don't want to rm -rf something we don't know as much about, we're going
-to leave this unexpected directory here. if your database looks normal,
-and this is not a symlink to your database, you should be able to blow
-this all away.
-
-EOF
- fi
- fi
- rmdir $mysql_upgradedir 2>/dev/null || true
- done
-
- # Ensure the existence and right permissions for the database and
- # log files.
- if [ ! -d "$mysql_statedir" -a ! -L "$mysql_statedir" ]; then mkdir "$mysql_statedir"; fi
- if [ ! -d "$mysql_statedir/mysql" -a ! -L "$mysql_statedir/mysql" ]; then mkdir "$mysql_statedir/mysql"; fi
- if [ ! -d "$mysql_newlogdir" -a ! -L "$mysql_newlogdir" ]; then mkdir "$mysql_newlogdir"; fi
- # When creating an ext3 jounal on an already mounted filesystem like e.g.
- # /var/lib/mysql, you get a .journal file that is not modifyable by chown.
- # The mysql_datadir must not be writable by the mysql user under any
- # circumstances as it contains scripts that are executed by root.
- set +e
- chown -R 0.0 $mysql_datadir
- chown -R mysql $mysql_statedir
- chown -R mysql $mysql_rundir
- chown -R mysql:adm $mysql_newlogdir; chmod 2750 $mysql_newlogdir;
- for i in log err; do
- touch $mysql_logdir/mysql.$i
- chown mysql:adm $mysql_logdir/mysql.$i
- chmod 0640 $mysql_logdir/mysql.$i
- done
- set -e
-
- # This is important to avoid dataloss when there is a removed
- # mysql-server version from Woody lying around which used the same
- # data directory and then somewhen gets purged by the admin.
- db_set mysql-server/postrm_remove_database false || true
-
- # So that mysql-server (4.0) can check if it's safe to install.
- touch $mysql_statedir/debian-@VER@.flag
-
- # On dist-upgrades, we ensure that the old_password setting is updated
- # before passwords are changed. Except for that config files are taboo!
- db_get mysql-server-@MYSQL_BRANDED_BASE_VERSION@/need_sarge_compat_done || true
- if [ "$RET" = "false" ]; then
- db_get mysql-server-@MYSQL_BRANDED_BASE_VERSION@/need_sarge_compat
- echo -e "# created by debconf but save to be edited\n[mysqld]\nold_passwords = $RET" > /etc/mysql/conf.d/old_passwords.cnf
- fi
- db_set mysql-server-@MYSQL_BRANDED_BASE_VERSION@/need_sarge_compat_done true
-
- # initiate databases. Output is not allowed by debconf :-(
- # Debian: beware of the bashisms...
- # Debian: can safely run on upgrades with existing databases
- set +e
- /bin/bash /usr/bin/mysql_install_db --rpm 2>&1 | $ERR_LOGGER
- if [ "$?" != "0" ]; then
- echo "ATTENTION: An error has occured. More info is in the syslog!"
- fi
- set -e
-
- ## On every reconfiguration the maintenance user is recreated.
- #
- # - It is easier to regenerate the password every time but as people
- # use fancy rsync scripts and file alteration monitors, the existing
- # password is used and existing files not touched.
- # - The mysqld statement is like that in mysql_install_db because the
- # server is not already running. This has some implications:
- # - The amount of newlines and semicolons in the query is important!
- # - GRANT is not possible with --skipt-grant-tables and "INSERT
- # (user,host..) VALUES" is not --ansi compliant
- # - The echo is just for readability. ash's buildin has no "-e" so use /bin/echo.
- # - The Super_priv, Show_db_priv, Create_tmp_table_priv and Lock_tables_priv
- # may not be present as old Woody 3.23 databases did not have it and the
- # admin might not already have run mysql_upgrade which adds them.
- # As the binlog cron scripts to need at least the Super_priv, I do first
- # the old query which always succeeds and then the new which may or may not.
-
- # recreate the credentials file if not present or without mysql_upgrade stanza
- dc=$mysql_cfgdir/debian.cnf;
- if [ -e "$dc" -a -n "`fgrep mysql_upgrade $dc 2>/dev/null`" ]; then
- pass="`sed -n 's/password *= *// p' $dc | head -n 1`"
- else
- pass=`perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..16)'`;
- if [ ! -d "$mysql_cfgdir" ]; then install -o 0 -g 0 -m 0755 -d $mysql_cfgdir; fi
- cat /dev/null > $dc
- echo "# Automatically generated for Debian scripts. DO NOT TOUCH!" >>$dc
- echo "[client]" >>$dc
- echo "host = localhost" >>$dc
- echo "user = debian-sys-maint" >>$dc
- echo "password = $pass" >>$dc
- echo "socket = $mysql_rundir/mysqld.sock" >>$dc
- echo "[mysql_upgrade]" >>$dc
- echo "user = debian-sys-maint" >>$dc
- echo "password = $pass" >>$dc
- echo "socket = $mysql_rundir/mysqld.sock" >>$dc
- echo "basedir = /usr" >>$dc
- fi
- # If this dir chmod go+w then the admin did it. But this file should not.
- chown 0:0 $dc
- chmod 0600 $dc
-
- # update privilege and timezone tables
- password_column_fix_query=`/bin/echo -e \
- "USE mysql\n" \
- "ALTER TABLE user CHANGE password Password varchar(41) collate utf8_bin NOT NULL default ''"`;
- replace_query=`/bin/echo -e \
- "USE mysql\n" \
- "REPLACE INTO user SET " \
- " host='localhost', user='debian-sys-maint', password=password('$pass'), " \
- " Select_priv='Y', Insert_priv='Y', Update_priv='Y', Delete_priv='Y', " \
- " Create_priv='Y', Drop_priv='Y', Reload_priv='Y', Shutdown_priv='Y', " \
- " Process_priv='Y', File_priv='Y', Grant_priv='Y', References_priv='Y', " \
- " Index_priv='Y', Alter_priv='Y' __EXTRA_PRIVS__"`;
- extra_privs=`/bin/echo -e \
- ", Show_db_priv='Y' " \
- ", Super_priv='Y' " \
- ", Create_tmp_table_priv='Y' " \
- ", Lock_tables_priv='Y' " \
- ", Execute_priv='Y' " \
- ", Repl_slave_priv='Y' " \
- ", Repl_client_priv='Y' "`;
-
- # Upgrade password column format before the root password gets set.
- echo "$password_column_fix_query" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER
-
- db_get mysql-server/root_password && rootpw="$RET"
- if ! set_mysql_rootpw; then
- password_error="yes"
- fi
-
- echo "$replace_query" | sed "s/__EXTRA_PRIVS__//" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER
- set +e
- echo "$replace_query" | sed "s/__EXTRA_PRIVS__/$extra_privs/" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER
- set -e
- mysql_tzinfo_to_sql /usr/share/zoneinfo/ 2>&1 | egrep -v 'Skipping it.$' | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER
-
- # The Sarge package "mysql-server" which used to include the mysqld daemon
- # may still be in unselected-configured state (i.e. after a remove but not
- # purge) in which case its now obsolete cronscript has to be moved away.
- for i in /etc/cron.daily/mysql-server /etc/cron.daily/mysql-server-41 /etc/mysql/debian-log-rotate.conf; do
- if [ -f $i ]; then mv $i $i.dpkg-old; fi
- done
- ;;
-
- abort-upgrade|abort-remove|abort-configure)
- ;;
-
- *)
- echo "postinst called with unknown argument '$1'" 1>&2
- exit 1
- ;;
-esac
-
-#DEBHELPER#
-
-# here we check to see if we can connect as root without a password
-# this should catch upgrades from previous verisons where the root
-# password wasn't set. if there is a password, or if the connection
-# fails for any other reason, nothing happens.
-if [ "$1" = "configure" ]; then
- if test_mysql_access; then
- db_input medium mysql-server/root_password || true
- db_go
- db_get mysql-server/root_password && rootpw="$RET"
-
- if ! set_mysql_rootpw "online"; then
- password_error="yes"
- fi
- fi
-
- if [ "$password_error" = "yes" ]; then
- db_input high mysql-server/error_setting_password || true
- db_go
- fi
-
-fi
-
-db_stop # in case invoke failes
-
-exit 0
diff --git a/debian/mysql-server-BASE.postrm.in b/debian/mysql-server-BASE.postrm.in
deleted file mode 100644
index 8021068d87a..00000000000
--- a/debian/mysql-server-BASE.postrm.in
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/bin/bash -e
-
-. /usr/share/debconf/confmodule
-
-if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
-${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
-
-MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
-
-# Try to stop the server in a sane way. If it does not success let the admin
-# do it himself. No database directories should be removed while the server
-# is running!
-stop_server() {
- set +e
- if [ -x /usr/sbin/invoke-rc.d ]; then
- invoke-rc.d mysql stop
- else
- /etc/init.d/mysql stop
- fi
- errno=$?
- set -e
-
- if [ "$?" != 0 ]; then
- echo "Trying to stop the MySQL server resulted in exitcode $?." 1>&2
- echo "Stop it yourself and try again!" 1>&2
- exit 1
- fi
-}
-
-case "$1" in
- purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
- if [ -n "`$MYADMIN ping 2>/dev/null`" ]; then
- stop_server
- sleep 2
- fi
- ;;
- *)
- echo "postrm called with unknown argument '$1'" 1>&2
- exit 1
- ;;
-esac
-
-#
-# - Do NOT purge logs or data if another mysql-sever* package is installed (#307473)
-# - Remove the mysql user only after all his owned files are purged.
-#
-if [ "$1" = "purge" -a ! \( -x /usr/sbin/mysqld -o -L /usr/sbin/mysqld \) ]; then
- # we remove the mysql user only after all his owned files are purged
- rm -f /var/log/mysql.{log,err}{,.0,.[1234567].gz}
- rm -rf /var/log/mysql
-
- db_input high mysql-server-@MYSQL_BRANDED_BASE_VERSION@/postrm_remove_databases || true
- db_go
- db_get mysql-server-@MYSQL_BRANDED_BASE_VERSION@/postrm_remove_databases || true
- if [ "$RET" = "true" ]; then
- # never remove the debian.cnf when the databases are still existing
- # else we ran into big trouble on the next install!
- rm -f /etc/mysql/conf.d/old_passwords.cnf
- rm -f /etc/mysql/debian.cnf
- rm -rf /var/lib/mysql
- rm -rf /var/run/mysqld
- userdel mysql || true
- fi
-
- # (normally) Automatically added by dh_installinit
- if [ "$1" = "purge" ] ; then
- update-rc.d mysql remove >/dev/null || exit 0
- fi
- # (normally) End automatically added section
-fi
-
-# (normally) Automatically added by dh_installdebconf
-if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
- . /usr/share/debconf/confmodule
- db_purge
-fi
-# (normally) End automatically added section
-
-# (normally) Automatically added by dh_installinit
-if [ "$1" = "purge" ] ; then
- update-rc.d mysql-ndb-mgm remove >/dev/null || exit 0
-fi
-# (normally) End automatically added section
-# (normally) Automatically added by dh_installinit
-if [ "$1" = "purge" ] ; then
- update-rc.d mysql-ndb remove >/dev/null || exit 0
-fi
-# (normally) End automatically added section
-
-# no DEBHELPER here, "update-rc.d remove" fails if mysql-server-@MYSQL_BRANDED_BASE_VERSION@ is installed
-
-exit 0
diff --git a/debian/mysql-server-BASE.preinst.in b/debian/mysql-server-BASE.preinst.in
deleted file mode 100644
index 529867f98e0..00000000000
--- a/debian/mysql-server-BASE.preinst.in
+++ /dev/null
@@ -1,167 +0,0 @@
-#!/bin/bash -e
-#
-# summary of how this script can be called:
-# * <new-preinst> install
-# * <new-preinst> install <old-version>
-# * <new-preinst> upgrade <old-version>
-# * <old-preinst> abort-upgrade <new-version>
-#
-
-. /usr/share/debconf/confmodule
-
-if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
-${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
-
-export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin
-MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
-DATADIR=/var/lib/mysql
-LOGDIR=/var/log/mysql
-UPGRADEDIR=/var/lib/mysql-upgrade
-
-# Try to stop the server in a sane way. If it does not success let the admin
-# do it himself. No database directories should be removed while the server
-# is running! Another mysqld in e.g. a different chroot is fine for us.
-stop_server() {
- if [ ! -x /etc/init.d/mysql ]; then return; fi
-
- set +e
- if [ -x /usr/sbin/invoke-rc.d ]; then
- cmd="invoke-rc.d mysql stop"
- else
- cmd="/etc/init.d/mysql stop"
- fi
- $cmd
- errno=$?
- set -e
-
- # 0=ok, 100=no init script (fresh install)
- if [ "$errno" != 0 -a "$errno" != 100 ]; then
- echo "${cmd/ */} returned $errno" 1>&2
- echo "There is a MySQL server running, but we failed in our attempts to stop it." 1>&2
- echo "Stop it yourself and try again!" 1>&2
- db_stop
- exit 1
- fi
-}
-
-################################ main() ##########################
-
-this_version=@VER@
-
-# Safe the user from stupidities.
-show_downgrade_warning=0
-for i in `ls $DATADIR/debian-*.flag 2>/dev/null`; do
- found_version=`echo $i | sed 's/.*debian-\([0-9\.]\+\).flag/\1/'`
- if dpkg --compare-versions "$this_version" '<<' "$found_version"; then
- show_downgrade_warning=1
- break;
- fi
-done
-if [ "$show_downgrade_warning" = 1 ]; then
- db_fset mysql-server-$this_version/really_downgrade seen false || true
- db_input medium mysql-server-$this_version/really_downgrade || true
- db_go
- db_get mysql-server-$this_version/really_downgrade || true
- if [ "$RET" = "true" ]; then
- rm -f $DATADIR/debian-*.flag
- touch $DATADIR/debian-$this_version.flag
- else
- echo "Aborting downgrade from (at least) $found_version to $this_version." 1>&2
- db_stop
- exit 1
- fi
-fi
-
-# to be sure
-stop_server
-
-# If we use NIS then errors should be tolerated. It's up to the
-# user to ensure that the mysql user is correctly setup.
-# Beware that there are two ypwhich one of them needs the 2>/dev/null!
-if test -n "`which ypwhich 2>/dev/null`" && ypwhich >/dev/null 2>&1; then
- set +e
-fi
-
-#
-# Now we have to ensure the following state:
-# /etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false
-# /etc/group: mysql:x:101:
-#
-# Sadly there could any state be present on the system so we have to
-# modify everything carefully i.e. not doing a chown before creating
-# the user etc...
-#
-
-# creating mysql group if he isn't already there
-if ! getent group mysql >/dev/null; then
- # Adding system group: mysql.
- addgroup --system mysql >/dev/null
-fi
-
-# creating mysql user if he isn't already there
-if ! getent passwd mysql >/dev/null; then
- # Adding system user: mysql.
- adduser \
- --system \
- --disabled-login \
- --ingroup mysql \
- --home $DATADIR \
- --gecos "MySQL Server" \
- --shell /bin/false \
- mysql >/dev/null
-fi
-
-# end of NIS tolerance zone
-set -e
-
-# if there's a symlink, let's store where it's pointing, because otherwise
-# it's going to be lost in some situations
-for dir in DATADIR LOGDIR; do
- checkdir=`eval echo "$"$dir`
- if [ -L "$checkdir" ]; then
- mkdir -p "$UPGRADEDIR"
- cp -d "$checkdir" "$UPGRADEDIR/$dir.link"
- fi
-done
-
-# creating mysql home directory
-if [ ! -d $DATADIR -a ! -L $DATADIR ]; then
- mkdir $DATADIR
-fi
-
-# checking disc space
-if LC_ALL=C BLOCKSIZE= df --portability $DATADIR/. | tail -n 1 | awk '{ exit ($4>1000) }'; then
- echo "ERROR: There's not enough space in $DATADIR/" 1>&2
- db_stop
- exit 1
-fi
-
-# Since the home directory was created before putting the user into
-# the mysql group and moreover we cannot guarantee that the
-# permissions were correctly *before* calling this script, we fix them now.
-# In case we use NIS and no mysql user is present then this script should
-# better fail now than later..
-# The "set +e" is necessary as e.g. a ".journal" of a ext3 partition is
-# not chgrp'able (#318435).
-set +e
-chown mysql:mysql $DATADIR
-find $DATADIR -follow -not -group mysql -print0 2>/dev/null \
- | xargs -0 --no-run-if-empty chgrp mysql
-set -e
-
-# Some files below /etc/ were possibly in the mysql-server-4.1/sarge package
-# before. They get overwritten by current ones to avoid unnecessary dpkg questions.
-while read md5 file; do
- if [ "`md5sum $file 2>/dev/null`" = "$md5 $file" ]; then
- cp /usr/share/mysql-common/internal-use-only/`echo $file | sed 's°/°_°g'` $file
- fi
-done <<EOT
-6691f2fdc5c6d27ff0260eb79813e1bc /etc/init.d/mysql
-b53b9552d44661361d39157c3c7c51d3 /etc/logrotate.d/mysql-server
-EOT
-
-db_stop
-
-#DEBHELPER#
-
-exit 0
diff --git a/debian/mysql-server-BASE.prerm.in b/debian/mysql-server-BASE.prerm.in
deleted file mode 100644
index 03e9ea37420..00000000000
--- a/debian/mysql-server-BASE.prerm.in
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash -e
-
-. /usr/share/debconf/confmodule
-
-if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
-${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
-
-#DEBHELPER#
diff --git a/debian/mysql-server-BASE.templates.in b/debian/mysql-server-BASE.templates.in
deleted file mode 100644
index 888f61345bf..00000000000
--- a/debian/mysql-server-BASE.templates.in
+++ /dev/null
@@ -1,71 +0,0 @@
-Template: mysql-server-@MYSQL_BRANDED_BASE_VERSION@/really_downgrade
-Type: boolean
-Default: false
-_Description: Do you really want to downgrade?
- WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a
- mysql-server package with a higher version has been installed before.
- It can not be guaranteed that this version can use its data.
-
-Template: mysql-server-@MYSQL_BRANDED_BASE_VERSION@/nis_warning
-Type: note
-_Description: Important note for NIS/YP users!
- To use mysql you must install an equivalent user and group to the
- following and ensure yourself that /var/lib/mysql has the right
- permissions (the uid/gid may be different).
- .
- /etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false
- .
- /etc/group: mysql:x:101:
- .
- /var/lib/mysql: drwxr-xr-x mysql mysql
-
-Template: mysql-server-@MYSQL_BRANDED_BASE_VERSION@/postrm_remove_databases
-Type: boolean
-Default: false
-_Description: Remove the databases used by all MySQL versions?
- The script is about to remove the data directory /var/lib/mysql.
- If it is planned to just install a higher MySQL version or if a different
- mysql-server package is already using it, the data should be kept.
-
-Template: mysql-server-@MYSQL_BRANDED_BASE_VERSION@/start_on_boot
-Type: boolean
-Default: true
-_Description: Should MySQL start on boot?
- The MySQL can start automatically on boot time or only if you manually
- type '/etc/init.d/mysql start'.
-
-Template: mysql-server/root_password
-Type: password
-_Description: New password for MySQL "root" user:
- It is highly recommended that you set a password for the MySQL administrative
- "root" user.
- .
- If you do not provide a password no changes will be made to the account.
-
-Template: mysql-server/error_setting_password
-Type: error
-_Description: Unable to set password for MySQL "root" user
- It seems an error occurred while setting the password for the MySQL
- administrative user. This may have happened because the user already
- has a password, or because there was a problem communicating with the
- MySQL server.
- .
- When installation finishes, you should verify that the account
- is properly protected with a password (see README.Debian for more
- information).
-
-Template: mysql-server-@MYSQL_BRANDED_BASE_VERSION@/need_sarge_compat
-Type: boolean
-Default: false
-_Description: Support MySQL connections from hosts running Debian "sarge" or older?
- The way passwords were stored was not very secure. This has been improved
- with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 Sarge
- will not be able to connect to account which are new or whose password have
- been changed. See /usr/share/doc/mysql-server-@MYSQL_BRANDED_BASE_VERSION@/README.Debian.
-
-Template: mysql-server-@MYSQL_BRANDED_BASE_VERSION@/need_sarge_compat_done
-Type: boolean
-Default: false
-Description: for internal use
- Only internally used.
-
diff --git a/debian/mysql-server-PREV.preinst.in b/debian/mysql-server-PREV.preinst.in
deleted file mode 100644
index 7440c476f55..00000000000
--- a/debian/mysql-server-PREV.preinst.in
+++ /dev/null
@@ -1,191 +0,0 @@
-#!/bin/bash -e
-#
-# summary of how this script can be called:
-# * <new-preinst> install
-# * <new-preinst> install <old-version>
-# * <new-preinst> upgrade <old-version>
-# * <old-preinst> abort-upgrade <new-version>
-#
-
-if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
-${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
-
-export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin
-
-# Try to stop the server in a sane way. If it does not success let the admin
-# do it himself. No database directories should be removed while the server
-# is running! Another mysqld in e.g. a different chroot is fine for us.
-stop_server() {
- if [ ! -x /etc/init.d/mysql ]; then return; fi
-
- set +e
- if [ -x /usr/sbin/invoke-rc.d ]; then
- cmd="invoke-rc.d mysql stop"
- else
- cmd="/etc/init.d/mysql stop"
- fi
- $cmd
- errno=$?
- set -e
-
- # 0=ok, 100=no init script (fresh install)
- if [ "$errno" != 0 -a "$errno" != 100 ]; then
- echo "${cmd/ */} returned $errno" 1>&2
- echo "There is a MySQL server running, but we failed in our attempts to stop it." 1>&2
- echo "Stop it yourself and try again!" 1>&2
- exit 1
- fi
-}
-
-##### here's a bunch of helper functions for converting database formats ######
-
-cvt_get_param(){
- /usr/sbin/mysqld --print-defaults \
- | tr " " "\n" \
- | grep -- "--$1" \
- | tail -n 1 \
- | cut -d= -f2
-}
-
-cvt_setup_stuff(){
- mytmp=`mktemp -d -t mysql-ISAM-convert.XXXXXX`
- cvt_log="$mytmp/conversion.log"
- if [ ! -d "$mytmp" ]; then
- echo "can't create temporary directory, oh well." >&2
- exit 1
- fi
-
- chgrp mysql $mytmp
- chmod g+rwx $mytmp
- cvt_socket=${mytmp}/mysql.sock
-
- cvt_mysqld="mysqld --skip-grant-tables --skip-networking --socket $cvt_socket"
- cvt_mysql="mysql --socket $cvt_socket"
- cvt_mysqladmin="mysqladmin --socket $cvt_socket"
-}
-
-cvt_get_databases(){
- echo fetching database list ... >&2
- $cvt_mysql -e 'show databases' | sed -n -e '2,$p'
-}
-
-cvt_get_tables(){
- echo querying tables in $1 ... >&2
- $cvt_mysql $1 -e 'show table status' | sed -n -e '2,$p' | \
- cut -f 1,2 | grep -w 'ISAM$' | cut -f 1
-}
-
-cvt_convert_table(){
- echo converting $1.$2 ... >&2
- $cvt_mysql $1 -e "alter table $2 type=MyISAM"
-}
-
-cvt_wait_for_server(){
- local count
- echo -n waiting for server startup.. >&2
- while ! $cvt_mysql </dev/null >/dev/null 2>&1; do
- echo -n . >&2
- sleep 1
- count=".$count"
- if [ -f $mytmp/mysql.done ]; then
- echo "sorry... looks like the server crashed :(" >&2
- return 1
- elif [ "$count" = "...................." ]; then
- echo "sorry... looks like the server didn't start :(" >&2
- return 1
- fi
- done
- echo ok. >&2
-}
-
-cvt_wait_for_exit(){
- local count
- echo -n waiting for server shutdown.. >&2
- while [ ! -f $mytmp/mysql.done ]; do
- echo -n . >&2
- sleep 1
- count=".$count"
- if [ "$count" = "...................." ]; then
- echo "hrm... guess it never started?" >&2
- return 0
- fi
- done
- echo ok. >&2
-}
-
-cvt_cleanup(){
- local mysql_kids
- rm -rf $mytmp
- # kill any mysqld child processes left over. there *shouldn't* be any,
- # but let's not take chances with that
- mysql_kids=`ps o 'pid command' --ppid $$ | grep -E '^[[:digit:]]+ mysqld ' | cut -d' ' -f1`
- if [ "$mysql_kids" ]; then
- echo "strange, some mysql processes left around. killing them now." >&2
- kill $mysql_kids
- sleep 10
- mysql_kids=`ps o 'pid command' --ppid $$ | grep -E '^[[:digit:]]+ mysqld ' | cut -d' ' -f1`
- if [ "$mysql_kids" ]; then
- echo "okay, they're really not getting the hint..." >&2
- kill -9 $mysql_kids
- fi
- fi
-}
-
-################################ main() ##########################
-
-# to be sure
-stop_server
-
-# test if upgrading from non conffile state
-if [ "$1" = "upgrade" ] && [ -x /usr/sbin/mysqld ]; then
- cvt_datadir=`cvt_get_param datadir`
- # test for ISAM tables, which we must convert NOW
- if [ -n "`find $cvt_datadir -name '*.ISM' 2>/dev/null`" ]; then
- set +e
- cat << EOF >&2
-----------------------------------------
-WARNING WARNING WARNING
-----------------------------------------
-
-It has been detected that are are using ISAM format on some of your
-mysql database tables. This format has been deprecated and no longer
-supported. to prevent these databases from essentially disappearing,
-an attempt at format conversion will now be made. please check after
-your upgrade that all tables are present and accounted for.
-
-apologies for the noise, but we thought you'd appreciate it :)
-
-----------------------------------------
-WARNING WARNING WARNING
-----------------------------------------
-EOF
- cvt_setup_stuff
- ($cvt_mysqld >$cvt_log 2>&1; touch $mytmp/mysql.done ) &
-
- if cvt_wait_for_server; then
- dbs=`cvt_get_databases`
- for db in $dbs; do
- tables=`cvt_get_tables $db`
- for tbl in $tables; do
- cvt_convert_table $db $tbl
- done
- done
- else
- cvt_error="yes"
- fi
-
- echo shutting down server... >&2
- $cvt_mysqladmin shutdown
- cvt_wait_for_exit
- echo "all done!" >&2
- if [ ! "$cvt_error" = "yes" ]; then
- cvt_cleanup
- else
- echo "you might want to look in $mytmp..." >&2
- fi
-
- set -e
- fi
-fi
-
-exit 0
diff --git a/debian/mysql-server.preinst.in b/debian/mysql-server.preinst.in
deleted file mode 100644
index 7440c476f55..00000000000
--- a/debian/mysql-server.preinst.in
+++ /dev/null
@@ -1,191 +0,0 @@
-#!/bin/bash -e
-#
-# summary of how this script can be called:
-# * <new-preinst> install
-# * <new-preinst> install <old-version>
-# * <new-preinst> upgrade <old-version>
-# * <old-preinst> abort-upgrade <new-version>
-#
-
-if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
-${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
-
-export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin
-
-# Try to stop the server in a sane way. If it does not success let the admin
-# do it himself. No database directories should be removed while the server
-# is running! Another mysqld in e.g. a different chroot is fine for us.
-stop_server() {
- if [ ! -x /etc/init.d/mysql ]; then return; fi
-
- set +e
- if [ -x /usr/sbin/invoke-rc.d ]; then
- cmd="invoke-rc.d mysql stop"
- else
- cmd="/etc/init.d/mysql stop"
- fi
- $cmd
- errno=$?
- set -e
-
- # 0=ok, 100=no init script (fresh install)
- if [ "$errno" != 0 -a "$errno" != 100 ]; then
- echo "${cmd/ */} returned $errno" 1>&2
- echo "There is a MySQL server running, but we failed in our attempts to stop it." 1>&2
- echo "Stop it yourself and try again!" 1>&2
- exit 1
- fi
-}
-
-##### here's a bunch of helper functions for converting database formats ######
-
-cvt_get_param(){
- /usr/sbin/mysqld --print-defaults \
- | tr " " "\n" \
- | grep -- "--$1" \
- | tail -n 1 \
- | cut -d= -f2
-}
-
-cvt_setup_stuff(){
- mytmp=`mktemp -d -t mysql-ISAM-convert.XXXXXX`
- cvt_log="$mytmp/conversion.log"
- if [ ! -d "$mytmp" ]; then
- echo "can't create temporary directory, oh well." >&2
- exit 1
- fi
-
- chgrp mysql $mytmp
- chmod g+rwx $mytmp
- cvt_socket=${mytmp}/mysql.sock
-
- cvt_mysqld="mysqld --skip-grant-tables --skip-networking --socket $cvt_socket"
- cvt_mysql="mysql --socket $cvt_socket"
- cvt_mysqladmin="mysqladmin --socket $cvt_socket"
-}
-
-cvt_get_databases(){
- echo fetching database list ... >&2
- $cvt_mysql -e 'show databases' | sed -n -e '2,$p'
-}
-
-cvt_get_tables(){
- echo querying tables in $1 ... >&2
- $cvt_mysql $1 -e 'show table status' | sed -n -e '2,$p' | \
- cut -f 1,2 | grep -w 'ISAM$' | cut -f 1
-}
-
-cvt_convert_table(){
- echo converting $1.$2 ... >&2
- $cvt_mysql $1 -e "alter table $2 type=MyISAM"
-}
-
-cvt_wait_for_server(){
- local count
- echo -n waiting for server startup.. >&2
- while ! $cvt_mysql </dev/null >/dev/null 2>&1; do
- echo -n . >&2
- sleep 1
- count=".$count"
- if [ -f $mytmp/mysql.done ]; then
- echo "sorry... looks like the server crashed :(" >&2
- return 1
- elif [ "$count" = "...................." ]; then
- echo "sorry... looks like the server didn't start :(" >&2
- return 1
- fi
- done
- echo ok. >&2
-}
-
-cvt_wait_for_exit(){
- local count
- echo -n waiting for server shutdown.. >&2
- while [ ! -f $mytmp/mysql.done ]; do
- echo -n . >&2
- sleep 1
- count=".$count"
- if [ "$count" = "...................." ]; then
- echo "hrm... guess it never started?" >&2
- return 0
- fi
- done
- echo ok. >&2
-}
-
-cvt_cleanup(){
- local mysql_kids
- rm -rf $mytmp
- # kill any mysqld child processes left over. there *shouldn't* be any,
- # but let's not take chances with that
- mysql_kids=`ps o 'pid command' --ppid $$ | grep -E '^[[:digit:]]+ mysqld ' | cut -d' ' -f1`
- if [ "$mysql_kids" ]; then
- echo "strange, some mysql processes left around. killing them now." >&2
- kill $mysql_kids
- sleep 10
- mysql_kids=`ps o 'pid command' --ppid $$ | grep -E '^[[:digit:]]+ mysqld ' | cut -d' ' -f1`
- if [ "$mysql_kids" ]; then
- echo "okay, they're really not getting the hint..." >&2
- kill -9 $mysql_kids
- fi
- fi
-}
-
-################################ main() ##########################
-
-# to be sure
-stop_server
-
-# test if upgrading from non conffile state
-if [ "$1" = "upgrade" ] && [ -x /usr/sbin/mysqld ]; then
- cvt_datadir=`cvt_get_param datadir`
- # test for ISAM tables, which we must convert NOW
- if [ -n "`find $cvt_datadir -name '*.ISM' 2>/dev/null`" ]; then
- set +e
- cat << EOF >&2
-----------------------------------------
-WARNING WARNING WARNING
-----------------------------------------
-
-It has been detected that are are using ISAM format on some of your
-mysql database tables. This format has been deprecated and no longer
-supported. to prevent these databases from essentially disappearing,
-an attempt at format conversion will now be made. please check after
-your upgrade that all tables are present and accounted for.
-
-apologies for the noise, but we thought you'd appreciate it :)
-
-----------------------------------------
-WARNING WARNING WARNING
-----------------------------------------
-EOF
- cvt_setup_stuff
- ($cvt_mysqld >$cvt_log 2>&1; touch $mytmp/mysql.done ) &
-
- if cvt_wait_for_server; then
- dbs=`cvt_get_databases`
- for db in $dbs; do
- tables=`cvt_get_tables $db`
- for tbl in $tables; do
- cvt_convert_table $db $tbl
- done
- done
- else
- cvt_error="yes"
- fi
-
- echo shutting down server... >&2
- $cvt_mysqladmin shutdown
- cvt_wait_for_exit
- echo "all done!" >&2
- if [ ! "$cvt_error" = "yes" ]; then
- cvt_cleanup
- else
- echo "you might want to look in $mytmp..." >&2
- fi
-
- set -e
- fi
-fi
-
-exit 0
diff --git a/debian/mysql-storage-BASE.dirs.in b/debian/mysql-storage-BASE.dirs.in
deleted file mode 100644
index 236670a2d0f..00000000000
--- a/debian/mysql-storage-BASE.dirs.in
+++ /dev/null
@@ -1 +0,0 @@
-usr/sbin
diff --git a/debian/mysql-storage-BASE.files.in b/debian/mysql-storage-BASE.files.in
deleted file mode 100644
index 126c17cb802..00000000000
--- a/debian/mysql-storage-BASE.files.in
+++ /dev/null
@@ -1 +0,0 @@
-usr/sbin/ndbd
diff --git a/debian/mysql-storage-BASE.mysql-storage.init.in b/debian/mysql-storage-BASE.mysql-storage.init.in
deleted file mode 100644
index 32ec82c6244..00000000000
--- a/debian/mysql-storage-BASE.mysql-storage.init.in
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/bash
-#
-### BEGIN INIT INFO
-# Provides: mysql-ndb
-# Required-Start: $syslog mysql mysql-ndb-mgm
-# Required-Stop: $syslog mysql mysql-ndb-mgm
-# Should-Start: $local_fs $remote_fs $network $named $time
-# Should-Stop: $local_fs $remote_fs $network $named $time
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: Start and stop the mysql database cluster server daemon
-# Description: Controls the MySQL NDB Data Node daemon "ndbd".
-### END INIT INFO
-#
-set -e
-set -u
-${DEBIAN_SCRIPT_DEBUG:+ set -v -x}
-
-# Variables
-SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
-DAEMON=/usr/sbin/ndbd
-CONF=/etc/mysql/my.cnf
-export HOME=/etc/mysql/
-
-# Safeguard (relative paths, core dumps..)
-cd /
-umask 077
-
-# Exit *silently* if we're not supposed to be started.
-#
-# The Debian scripts should execute these scripts to stop and start
-# the daemon when upgrading if it is started. On the other hand it should
-# remain silently if the server has not even been configured.
-# See /usr/share/doc/mysql-server-*/README.Debian for more information.
-test -x $DAEMON || exit 0
-if $DAEMON --help | grep -q '^ndb-connectstring.*No default value'; then exit 0; fi
-. /lib/lsb/init-functions
-
-#
-# main()
-#
-case "${1:-''}" in
- 'start')
- # Start daemon
- # Creatign a PID file does not work as the master process forks
- # a child with different PID and then terminates itself.
- log_daemon_msg "Starting MySQL NDB Data Node" "ndbd"
- if start-stop-daemon \
- --start \
- --exec $DAEMON \
- --user mysql
- then
- log_end_msg 0
- else
- log_end_msg 1
- log_warning_msg "Please take a look at the syslog."
- exit 1
- fi
- ;;
-
- 'stop')
- log_daemon_msg "Stopping MySQL NDB Data Node" "ndbd"
- if start-stop-daemon \
- --stop \
- --oknodo \
- --exec $DAEMON
- then
- log_end_msg 0
- else
- log_end_msg 1
- exit 1
- fi
- ;;
-
- 'restart'|'force-reload')
- set +e; $SELF stop; set -e
- $SELF start
- ;;
-
- *)
- echo "Usage: $SELF start|stop|restart|force-reload"
- exit 1
- ;;
-esac
-
diff --git a/debian/mysql-test-BASE.dirs.in b/debian/mysql-test-BASE.dirs.in
deleted file mode 100644
index b1eee9d9a12..00000000000
--- a/debian/mysql-test-BASE.dirs.in
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/bin
-usr/share/mysql/mysql-test
diff --git a/debian/mysql-test-BASE.files.in b/debian/mysql-test-BASE.files.in
deleted file mode 100644
index 7f99c28ca5e..00000000000
--- a/debian/mysql-test-BASE.files.in
+++ /dev/null
@@ -1,6 +0,0 @@
-usr/share/mysql-test/*
-usr/bin/mysql_client_test
-usr/bin/mysqltestmanager
-usr/bin/mysqltestmanager-pwgen
-usr/bin/mysqltestmanagerc
-
diff --git a/debian/mysql-tools-BASE.dirs.in b/debian/mysql-tools-BASE.dirs.in
deleted file mode 100644
index 00b2ed2562d..00000000000
--- a/debian/mysql-tools-BASE.dirs.in
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/bin
-usr/share/mysql
diff --git a/debian/mysql-tools-BASE.files.in b/debian/mysql-tools-BASE.files.in
deleted file mode 100644
index d2f37a570be..00000000000
--- a/debian/mysql-tools-BASE.files.in
+++ /dev/null
@@ -1,13 +0,0 @@
-usr/bin/ndb_mgm
-usr/bin/ndb_restore
-usr/bin/ndb_waiter
-usr/bin/ndb_select_all
-usr/bin/ndb_select_count
-usr/bin/ndb_desc
-usr/bin/ndb_show_tables
-usr/bin/ndb_test_platform
-usr/bin/ndb_config
-usr/bin/ndb_error_reporter
-usr/bin/ndb_size
-
-
diff --git a/debian/po/POTFILES.in.in b/debian/po/POTFILES.in.in
deleted file mode 100644
index 01e1e87fc55..00000000000
--- a/debian/po/POTFILES.in.in
+++ /dev/null
@@ -1 +0,0 @@
-[type: gettext/rfc822deb] mysql-server-@MYSQL_BRANDED_BASE_VERSION@.templates
diff --git a/debian/po/ca.po b/debian/po/ca.po
deleted file mode 100644
index 9dc1fc0de77..00000000000
--- a/debian/po/ca.po
+++ /dev/null
@@ -1,290 +0,0 @@
-# mysql-dfsg (debconf) translation to Catalan.
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-# Aleix Badia i Bosch <abadia@ica.es> 2004
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: mysql-dfsg-4.1\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2007-02-16 22:27+0100\n"
-"PO-Revision-Date: 2004-01-31 19:20GMT\n"
-"Last-Translator: Aleix Badia i Bosch <abadia@ica.es>\n"
-"Language-Team: Debian L10n Catalan <debian-l10n-catalan@lists.debian.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=ISO-8859-1\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid "Do you really want to downgrade?"
-msgstr ""
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid ""
-"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
-"mysql-server package with a higher version has been installed before. It can "
-"not be guaranteed that this version can use its data."
-msgstr ""
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "Important note for NIS/YP users!"
-msgstr "Nota important pels usuaris de NIS/YP"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-#, fuzzy
-msgid ""
-"To use mysql you must install an equivalent user and group to the following "
-"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
-"gid may be different)."
-msgstr ""
-"Per utilitzar la base de dades de MySQL heu d'afegir un usuari i grup "
-"equivalent al següent i assegurar-vos que el directori /var/lib/mysql tingui "
-"els permisos correctes."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-msgstr ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/group: mysql:x:101:"
-msgstr "/etc/group: mysql:x:101:"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
-msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid "Remove the databases used by all MySQL versions?"
-msgstr ""
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid ""
-"The script is about to remove the data directory /var/lib/mysql. If it is "
-"planned to just install a higher MySQL version or if a different mysql-"
-"server package is already using it, the data should be kept."
-msgstr ""
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid "Should MySQL start on boot?"
-msgstr "Voleu que el MySQL s'iniciï a l'arrencada ?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-#, fuzzy
-msgid ""
-"The MySQL can start automatically on boot time or only if you manually type "
-"'/etc/init.d/mysql start'."
-msgstr ""
-"El MySQL es pot executar a l'arrencada o només si executeu manualment '/etc/"
-"init.d/mysql start'. Seleccioneu 'sí' si voleu que s'inicialitzi "
-"automàticament."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "New password for MySQL \"root\" user:"
-msgstr ""
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"It is highly recommended that you set a password for the MySQL "
-"administrative \"root\" user."
-msgstr ""
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"If you do not provide a password no changes will be made to the account."
-msgstr ""
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid "Unable to set password for MySQL \"root\" user"
-msgstr ""
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"It seems an error occurred while setting the password for the MySQL "
-"administrative user. This may have happened because the user already has a "
-"password, or because there was a problem communicating with the MySQL server."
-msgstr ""
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"When installation finishes, you should verify that the account is properly "
-"protected with a password (see README.Debian for more information)."
-msgstr ""
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
-msgstr ""
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid ""
-"The way passwords were stored was not very secure. This has been improved "
-"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
-"Sarge will not be able to connect to account which are new or whose password "
-"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
-msgstr ""
-
-#, fuzzy
-#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html"
-#~ msgstr ""
-#~ "Feu una ullada al document: http://www.mysql.com/doc/en/Upgrade.html"
-
-#, fuzzy
-#~ msgid ""
-#~ "MySQL will only install if you have a non-numeric hostname that is "
-#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command "
-#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 "
-#~ "myhostname\"."
-#~ msgstr ""
-#~ "El MySQL només s'instal·la en cas de tenir un nom d'ordinador central que "
-#~ "no sigui numèric i que es pugui resoldre a través del fitxer /etc/hosts. "
-#~ "Ex. si l'ordre \"hostname\" retorna \"myhostname\", llavors hi ha d'haver "
-#~ "una línia com la següent \"10.0.0.1 myhostname\"."
-
-#, fuzzy
-#~ msgid ""
-#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account "
-#~ "is used in the start/stop and cron scripts. Don't delete."
-#~ msgstr ""
-#~ "Es crea un nou usuari de mysql \"debian-sys-maint\". S'utilitza per les "
-#~ "seqüències d'inicialització i aturada del cron, no el suprimiu."
-
-#, fuzzy
-#~ msgid ""
-#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /"
-#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in "
-#~ "there, never only the password!"
-#~ msgstr ""
-#~ "Recordeu posar una contrasenya al superusuari del MySQL. Si utilitzeu un "
-#~ "fitxer /root/.my.cnf, escriviu sempre allà les línies \"user\" i "
-#~ "\"password\".; mai només la contrasenya. Per a més informació feu una "
-#~ "ullada a /usr/share/doc/mysql-server/README.Debian."
-
-#, fuzzy
-#~ msgid ""
-#~ "Should I remove all databases below /var/lib/mysql as you are purging the "
-#~ "mysql-server package?"
-#~ msgstr ""
-#~ "Voleu suprimir totes les bases de dades en purgar el paquet mysql-server ?"
-
-#~ msgid ""
-#~ "Networking is disabled by default for security reasons. You can enable it "
-#~ "by commenting out the skip-networking option in /etc/mysql/my.cnf."
-#~ msgstr ""
-#~ "La xarxa està inhabilitada per defecte per a raons de seguretat. La podeu "
-#~ "habilitar descomentant l'opció de skip-networking del fitxer /etc/mysql/"
-#~ "my.cnf."
-
-#~ msgid "security and update notice"
-#~ msgstr "Avís de seguretat i actualització"
-
-#~ msgid "Please run mysql_fix_privilege_tables !"
-#~ msgstr "Executeu mysql_fix_privilege_tables"
-
-#~ msgid ""
-#~ "I will ensure secure permissions of /var/lib/mysql by replacing GIDs "
-#~ "other than root and mysql with mysql."
-#~ msgstr ""
-#~ "S'asseguren els permisos de seguretat de /var/lib/mysql canviant a mysql "
-#~ "tots els GIDs diferents a root i mysql."
-
-#~ msgid ""
-#~ "Instructions how to enable SSL support are in /usr/share/doc/mysql-server/"
-#~ msgstr ""
-#~ "Per habilitar el suport de SSL podeu seguir les instruccions de /usr/"
-#~ "share/doc/mysql-server/"
-
-#~ msgid "mysql_fix_privileges_tables will be executed"
-#~ msgstr "s'executa mysql_fix_privileges_tables"
-
-#~ msgid ""
-#~ "The latest MySQL versions have an enhanced, more fine grained, privilege "
-#~ "system. To make use of it, some new fields must be added to the tables "
-#~ "in the \"mysql\" database. This is done by the "
-#~ "mysql_fix_privilege_tables script during this upgrade regardless of if "
-#~ "the server is currently running or not!"
-#~ msgstr ""
-#~ "Les últimes versions de MySQL tenen un sistema de privilegis més "
-#~ "elaborat. Per utilitzar-lo cal afegir nous camps a les taules de la base "
-#~ "de dades \"mysql\". Aquesta tasca la realitza la seqüència "
-#~ "mysql_fix_privilege_tables durant l'actualització independentment de si "
-#~ "el servidor s'està executant o no!"
-
-#~ msgid ""
-#~ "This script is not supposed to give any user more rights that he had "
-#~ "before, if you encounter such a case, please contact me."
-#~ msgstr ""
-#~ "Aquesta seqüència no assigna privilegis d'usuari diferents als que ja "
-#~ "tenia, en cas que us trobéssiu en aquesta situació, poseu-vos en contacte "
-#~ "amb mi."
-
-#~ msgid ""
-#~ "Should I remove everything below /var/lib/mysql when you purge the mysql-"
-#~ "server package with the \"dpkg --purge mysql-server\" command (i.e. "
-#~ "remove everything including the configuration) somewhen? (default is not)"
-#~ msgstr ""
-#~ "Voleu suprimir tots els continguts de /var/lib/mysql quan es purgui el "
-#~ "paquet mysql-server amb l'ordre \"dpkg --purge mysql-server\". (ex. "
-#~ "suprimir-ho tot inclòs la configuració) ? (per defecte no)"
-
-#~ msgid "Make MySQL reachable via network?"
-#~ msgstr "Voleu fer accessible el MySQL via xarxa ?"
-
-#~ msgid ""
-#~ "Should MySQL listen on a network reachable TCP port? This is not "
-#~ "necessary for use on a single computer and could be a security problem."
-#~ msgstr ""
-#~ "Voleu que el MySQL escolti a un port TCP accessible des de la xarxa ? "
-#~ "Aquesta opció no és imprescindible en ordinadors aïllats i podria "
-#~ "provocar un problema de seguretat."
-
-#~ msgid "Enable chroot mode?"
-#~ msgstr "Permetre el mode chroot ?"
-
-#~ msgid ""
-#~ "MySQL is able to jail itself into the /var/lib/mysql_jail directory so "
-#~ "that users cannot modify any files outside this directory. This improves "
-#~ "resistence against crackers, too, as they are not able to modify system "
-#~ "files."
-#~ msgstr ""
-#~ "El MySQL es pot executar en una entorn tancat al directori /var/lib/"
-#~ "mysql_jail perquè els usuaris no puguin modificar cap fitxer fora del "
-#~ "directori.Aquesta opció també augmenta la seguretat envers els crackers, "
-#~ "jaque no poden modificar els fitxers del sistema."
diff --git a/debian/po/cs.po b/debian/po/cs.po
deleted file mode 100644
index 33e4f213bb2..00000000000
--- a/debian/po/cs.po
+++ /dev/null
@@ -1,259 +0,0 @@
-#
-# Translators, if you are not familiar with the PO format, gettext
-# documentation is worth reading, especially sections dedicated to
-# this format, e.g. by running:
-# info -n '(gettext)PO Files'
-# info -n '(gettext)Header Entry'
-#
-# Some information specific to po-debconf are available at
-# /usr/share/doc/po-debconf/README-trans
-# or http://www.debian.org/intl/l10n/po-debconf/README-trans
-#
-# Developers do not need to manually edit POT or PO files.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: mysql-dfsg-5.0\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2007-02-16 22:27+0100\n"
-"PO-Revision-Date: 2007-02-18 12:49+0100\n"
-"Last-Translator: Miroslav Kure <kurem@debian.cz>\n"
-"Language-Team: Czech <debian-l10n-czech@lists.debian.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid "Do you really want to downgrade?"
-msgstr "Opravdu chcete degradovat?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid ""
-"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
-"mysql-server package with a higher version has been installed before. It can "
-"not be guaranteed that this version can use its data."
-msgstr ""
-"VAROVÃNÃ: Existuje soubor /var/lib/mysql/debian-*.flag, což znamená, že již "
-"byl instalován balíÄek mysql-server s vyšší verzí. Nemůžeme zaruÄit, zda "
-"tato verze umí použít data z novÄ›jšího balíÄku."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "Important note for NIS/YP users!"
-msgstr "Důležitá poznámka pro uživatele NIS/YP!"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"To use mysql you must install an equivalent user and group to the following "
-"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
-"gid may be different)."
-msgstr ""
-"Abyste mohli mysql používat, musíte do následujících souborů přidat "
-"ekvivalentního uživatele a skupinu a zajistit, že /var/lib/mysql má správná "
-"práva (uid/gid se mohou lišit)."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-msgstr ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/group: mysql:x:101:"
-msgstr "/etc/group: mysql:x:101:"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
-msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid "Remove the databases used by all MySQL versions?"
-msgstr "Odstranit databáze používané všemi verzemi MySQL?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid ""
-"The script is about to remove the data directory /var/lib/mysql. If it is "
-"planned to just install a higher MySQL version or if a different mysql-"
-"server package is already using it, the data should be kept."
-msgstr ""
-"Skript se chystá odstranit datový adresář /var/lib/mysql. Jestliže pouze "
-"plánujete nainstalovat novější verzi MySQL, nebo pokud tato data souběžně "
-"využívá jiný balík mysql-server, měli byste data ponechat."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid "Should MySQL start on boot?"
-msgstr "Má se MySQL spustit při startu systému?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid ""
-"The MySQL can start automatically on boot time or only if you manually type "
-"'/etc/init.d/mysql start'."
-msgstr ""
-"MySQL se může spouÅ¡tÄ›t automaticky pÅ™i startu systému, nebo ruÄnÄ› příkazem '/"
-"etc/init.d/mysql start'."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "New password for MySQL \"root\" user:"
-msgstr "Nové heslo MySQL uživatele \"root\":"
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"It is highly recommended that you set a password for the MySQL "
-"administrative \"root\" user."
-msgstr "Nastavit heslo u správcovského úÄtu \"root\" je silnÄ› doporuÄeno."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"If you do not provide a password no changes will be made to the account."
-msgstr "Nezadáte-li heslo, žádné zmÄ›ny se s úÄtem neprovedou."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid "Unable to set password for MySQL \"root\" user"
-msgstr "Nelze nastavit heslo MySQL uživatele \"root\""
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"It seems an error occurred while setting the password for the MySQL "
-"administrative user. This may have happened because the user already has a "
-"password, or because there was a problem communicating with the MySQL server."
-msgstr ""
-"Během nastavování hesla pro správcovského uživatele MySQL se vyskytla chyba. "
-"To se mohlo stát třeba proto, protože uživatel již měl neslo nastaveno, nebo "
-"protože nastal problém v komunikaci s MySQL serverem."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"When installation finishes, you should verify that the account is properly "
-"protected with a password (see README.Debian for more information)."
-msgstr ""
-"Po skonÄení instalace byste mÄ›li ověřit, že je úÄet chránÄ›n heslem (více "
-"informací naleznete v souboru README.Debian)."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
-msgstr ""
-"Podporovat MySQL pÅ™ipojení z poÄítaÄů používajících Debian Sarge nebo starší?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid ""
-"The way passwords were stored was not very secure. This has been improved "
-"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
-"Sarge will not be able to connect to account which are new or whose password "
-"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
-msgstr ""
-"Způsob, jakým se dříve ukládala hesla, nebyl příliÅ¡ bezpeÄný. To se nyní "
-"změnilo, ale nevýhodou je, že se klienti z Debianu 3.1 Sarge nebudou moci "
-"pÅ™ipojit na nové úÄty, nebo na úÄty, u nichž se zmÄ›nilo heslo. Podrobnosti "
-"viz /usr/share/doc/mysql-server-5.0/README.Debian."
-
-#~ msgid "Cannot upgrade if ISAM tables are present!"
-#~ msgstr "Aktualizace nelze provést pokud jsou přítomny tabulky ISAM!"
-
-#~ msgid ""
-#~ "Recent versions of MySQL can no longer use the old ISAM table format and "
-#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by "
-#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". "
-#~ "The installation of mysql-server-5.0 will now abort. In case your old "
-#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert "
-#~ "those tables."
-#~ msgstr ""
-#~ "Poslední verze MySQL již nemohou používat starý formát tabulek ISAM a "
-#~ "před aktualizací je nutné převést tyto tabulky např. do formátu MyISAM "
-#~ "pomocí \"mysql_convert_table_format\" nebo \"ALTER TABLE x ENGINE=MyISAM"
-#~ "\". Instalace mysql-server-5.0 se nyní přeruší. V případě, že se mezitím "
-#~ "odinstaloval původní mysql-server-4.1, jednoduše jej znovu nainstalujte a "
-#~ "tabulky pÅ™eveÄte."
-
-#~ msgid "Update Hints"
-#~ msgstr "Poznámky k aktualizaci"
-
-#~ msgid ""
-#~ "You have to run \"mysql_upgrade\" after the upgrade, else tables can be "
-#~ "corrupted! This script also enhances the privilege tables but is not "
-#~ "supposed to give any user more rights that he had before,"
-#~ msgstr ""
-#~ "Po aktualizaci ještě musíte spustit \"mysql_upgrade\", protože jinak by "
-#~ "se tabulky mohly narušit! Tento skript také rozšiřuje tabulky privilegií, "
-#~ "ovšem neměl by uživatelům přidat více práv, než měli dosud."
-
-#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html"
-#~ msgstr "Také si pÅ™eÄtÄ›te http://www.mysql.com/doc/en/Upgrade.html"
-
-#~ msgid ""
-#~ "MySQL will only install if you have a non-numeric hostname that is "
-#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command "
-#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 "
-#~ "myhostname\"."
-#~ msgstr ""
-#~ "MySQL se nainstaluje pouze v případě, že používáte nenumerické jméno "
-#~ "poÄítaÄe, které se dá pÅ™eložit pÅ™es soubor /etc/hosts. NapÅ™. když příkaz "
-#~ "\"hostname\" vrátí \"diamond\", tak v /etc/hosts musí existovat obdobný "
-#~ "řádek jako \"10.0.0.1 diamond\"."
-
-#~ msgid ""
-#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account "
-#~ "is used in the start/stop and cron scripts. Don't delete."
-#~ msgstr ""
-#~ "Bude vytvoÅ™en nový mysql uživatel \"debian-sys-maint\". Tento mysql úÄet "
-#~ "se používá ve startovacích, ukonÄovacích a cronových skriptech. Nemažte "
-#~ "jej."
-
-#~ msgid ""
-#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /"
-#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in "
-#~ "there, never only the password!"
-#~ msgstr ""
-#~ "Nezapomeňte nastavit heslo pro úÄet administrátora MySQL! Používáte-li /"
-#~ "root/.my.cnf, vždy zde zadejte jak řádek \"user\", tak řádek \"password"
-#~ "\". Nikdy zde nezadávejte jenom heslo!"
-
-#~ msgid ""
-#~ "See /usr/share/doc/mysql-server-5.0/README.Debian for more information."
-#~ msgstr ""
-#~ "Více informací naleznete v /usr/share/doc/mysql-server-5.0/README.Debian."
-
-#~ msgid ""
-#~ "Should I remove the complete /var/lib/mysql directory tree which is used "
-#~ "by all MySQL versions, not necessarily only the one you are about to "
-#~ "purge?"
-#~ msgstr ""
-#~ "Mám odstranit kompletní adresářový strom /var/lib/mysql, který se používá "
-#~ "pro všechny verze MySQL, tedy ne nutně pouze pro verzi, kterou se "
-#~ "chystáte vyÄistit?"
diff --git a/debian/po/da.po b/debian/po/da.po
deleted file mode 100644
index 5e93e3f7b33..00000000000
--- a/debian/po/da.po
+++ /dev/null
@@ -1,283 +0,0 @@
-#
-# Translators, if you are not familiar with the PO format, gettext
-# documentation is worth reading, especially sections dedicated to
-# this format, e.g. by running:
-# info -n '(gettext)PO Files'
-# info -n '(gettext)Header Entry'
-# Some information specific to po-debconf are available at
-# /usr/share/doc/po-debconf/README-trans
-# or http://www.debian.org/intl/l10n/po-debconf/README-trans#
-# Developers do not need to manually edit POT or PO files.
-#
-# Claus Hindsgaul <claus_h@image.dk>, 2005, 2006.
-# Claus Hindsgaul <claus.hindsgaul@gmail.com>, 2006, 2007.
-msgid ""
-msgstr ""
-"Project-Id-Version: mysql-dfsg-4.1\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2007-02-16 22:27+0100\n"
-"PO-Revision-Date: 2007-02-18 10:42+0100\n"
-"Last-Translator: Claus Hindsgaul <claus.hindsgaul@gmail.com>\n"
-"Language-Team: Danish\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=ISO-8859-1\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: KBabel 1.11.4\n"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid "Do you really want to downgrade?"
-msgstr "Ønsker du virkelig at nedgradere?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid ""
-"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
-"mysql-server package with a higher version has been installed before. It can "
-"not be guaranteed that this version can use its data."
-msgstr ""
-"Advarsel: Filen /var/lib/mysql/debian-*.flag eksisterer. Det tyder på at der "
-"tidligere har været installeret en højere version af mysql-server-pakken. "
-"Det kan ikke garanteres at denne version kan benytte data fra den højere "
-"version."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "Important note for NIS/YP users!"
-msgstr "Vigtig bemærkning for NIS/YP-brugere!"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"To use mysql you must install an equivalent user and group to the following "
-"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
-"gid may be different)."
-msgstr ""
-"For at kunne bruge mysql skal du installere en bruger og en gruppe, der "
-"svarer til nedenstående, og sikre dig at /var/lib/mysql har de rigtige "
-"adgangsrettigheder (uid/gid kan afvige)."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-msgstr "etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/group: mysql:x:101:"
-msgstr "/etc/group: mysql:x:101:"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
-msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid "Remove the databases used by all MySQL versions?"
-msgstr "Fjern de databaser, der benyttes af samtlige MySQL-versioner?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid ""
-"The script is about to remove the data directory /var/lib/mysql. If it is "
-"planned to just install a higher MySQL version or if a different mysql-"
-"server package is already using it, the data should be kept."
-msgstr ""
-"Scriptet skal til at fjerne datamappen /var/lib/mysql. Hvis du regner "
-"medblot at installere en højere MySQL-version, eller hvis der allerede kører "
-"en anden MySQL-serverpakke, bør dataene bevares."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid "Should MySQL start on boot?"
-msgstr "Skal MySQL startes under systemopstart?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid ""
-"The MySQL can start automatically on boot time or only if you manually type "
-"'/etc/init.d/mysql start'."
-msgstr ""
-"MySQL kan enten startes op under systemopstarten eller kun hvis du manuelt "
-"skriver '/etc/init.d/mysql start'."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "New password for MySQL \"root\" user:"
-msgstr "Ny adgangskode for MySQL's \"root\"-bruger:"
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"It is highly recommended that you set a password for the MySQL "
-"administrative \"root\" user."
-msgstr ""
-"Det anbefales kraftigt, at du sætter en adgangskode for MySQL's "
-"administrationsbruger \"root\"."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "If you do not provide a password no changes will be made to the account."
-msgstr "Hvis du ikke angiver en adgangskode, vil kontoen ikke blive ændret."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid "Unable to set password for MySQL \"root\" user"
-msgstr "Kunne ikke sætte adgangskoden for MySQL's \"root\"-bruger"
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"It seems an error occurred while setting the password for the MySQL "
-"administrative user. This may have happened because the user already has a "
-"password, or because there was a problem communicating with the MySQL server."
-msgstr ""
-"Det lader til, at der opstod en fejl, da adgangskoden for MySQL's "
-"administrationsbruger skulle ændres. Dette kan være sket, fordi brugeren "
-"allerede har en adgangskode, eller fordi der var problemer med at "
-"kommunikere med MySQL-serveren."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"When installation finishes, you should verify that the account is properly "
-"protected with a password (see README.Debian for more information)."
-msgstr ""
-"Når installationen afsluttes, bør du tjekke at kontoen er ordentligt "
-"beskyttet med en adgangskode (se README.Debian for yderligere oplysninger)."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
-msgstr "Understøt MySQL-forbindelser fra maskiner, der kører Debian \"Sarge\" eller ældre?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid ""
-"The way passwords were stored was not very secure. This has been improved "
-"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
-"Sarge will not be able to connect to account which are new or whose password "
-"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
-msgstr ""
-"Den måde, adgangskoder blev gemt på tidligere, var ikke ret sikker. Dette er "
-"blevet forbedret med den bivirkning, at klienter (f.eks. PHP) fra maskiner, "
-"der kører Debian 3.1 Sarge ikke vil kunne forbindes til en konto, der er ny, "
-"eller hvis adgangskode er blevet ændret. Se /usr/share/doc/mysql-server-5.0/"
-"README.Debian."
-
-#~ msgid "Cannot upgrade if ISAM tables are present!"
-#~ msgstr "Kan ikke opgradere hvis der er ISAM-tabeller!"
-
-#~ msgid ""
-#~ "Recent versions of MySQL can no longer use the old ISAM table format and "
-#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by "
-#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". "
-#~ "The installation of mysql-server-5.0 will now abort. In case your old "
-#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert "
-#~ "those tables."
-#~ msgstr ""
-#~ "Nyere versioner af MySQL kan ikke længere benytte det gamle ISAM-"
-#~ "tabelformat, og det er derfor nødvendigt at konvertere dine tabeller til "
-#~ "f.eks. MyISAM forud for opgraderingen med \"mysql_convert_table_format\" "
-#~ "eller \"ALTER TABLE x ENGINE=MyISAM\". Installationen af mysql-server-5.0 "
-#~ "afbrydes nu. Skulle din gamle mysql-server-4.1 alligevel bliver "
-#~ "afinstalleret, så geninstallér den blot og konverter tabellerne."
-
-#~ msgid "Update Hints"
-#~ msgstr "Opdateringstips"
-
-#~ msgid ""
-#~ "You have to run \"mysql_upgrade\" after the upgrade, else tables can be "
-#~ "corrupted! This script also enhances the privilege tables but is not "
-#~ "supposed to give any user more rights that he had before,"
-#~ msgstr ""
-#~ "Du skal køre \"mysql_upgrade\" efter opgraderingen, da tabellerne eller "
-#~ "kan blive ødelagt! Dette script forbedrer også rettighedstabellerne, men "
-#~ "burde ikke give nogen bruger flere rettigheder, end han havde tidligere,"
-
-#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html"
-#~ msgstr "Læs også http://www.mysql.com/doc/en/Upgrade.html"
-
-#~ msgid "Install Hints"
-#~ msgstr "Installationstips"
-
-#~ msgid ""
-#~ "On upgrades from MySQL 3.23, as shipped with Debian Woody, symlinks in "
-#~ "place of /var/lib/mysql or /var/log/mysql gets accidently removed and "
-#~ "have manually be restored."
-#~ msgstr ""
-#~ "Ved opgraderinger fra MySQL 3.23, der fulgte med Debian Woody, kan de "
-#~ "symbolske /var/lib/mysql or /var/log/mysql blive fjernet ved et uheld, og "
-#~ "må genskabes manuelt."
-
-#~ msgid ""
-#~ "MySQL will only install if you have a non-numeric hostname that is "
-#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command "
-#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 "
-#~ "myhostname\"."
-#~ msgstr ""
-#~ "MySQL vil kun blive installeret, hvis du har et ikke-numerisk værtsnavn, "
-#~ "som kan slås op i filen /ets/hosts. Hvis f.eks. kommandoen \"hostname\" "
-#~ "svarer med \"mitvaertsnavn\", skal du have en linje a'la \"10.0.0.1 "
-#~ "mitvaertsnavn\" i /etc/hosts."
-
-#~ msgid ""
-#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account "
-#~ "is used in the start/stop and cron scripts. Don't delete."
-#~ msgstr ""
-#~ "Det vil blive oprettet en ny mysql-bruger, \"debian-sys-maint\". Denne "
-#~ "mysql-konto bruges i start/stop-cron-scripterne. Slet den ikke."
-
-#~ msgid ""
-#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /"
-#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in "
-#~ "there, never only the password!"
-#~ msgstr ""
-#~ "Husk at sætte en ADGANGSKODE for MySQLs root-bruger! Hvis du bruger en /"
-#~ "etc/.my.cnf, så skriv altid \"user\"- og \"password\"-linjer ind her, "
-#~ "ikke kun adgangskoden!"
-
-#~ msgid ""
-#~ "See /usr/share/doc/mysql-server-5.0/README.Debian for more information."
-#~ msgstr ""
-#~ "Se /usr/share/doc/mysql-server-5.0/README.Debian for yderligere "
-#~ "oplysninger."
-
-#~ msgid ""
-#~ "Should I remove the complete /var/lib/mysql directory tree which is used "
-#~ "by all MySQL versions, not necessarily only the one you are about to "
-#~ "purge?"
-#~ msgstr ""
-#~ "Skal jeg fjerne hele mappetræet /var/lib/mysql, som benyttes af alle "
-#~ "MySQL-versioner, ikke kun den version, du er ved at slette?"
-
-#~ msgid ""
-#~ "Rarely, e.g. on new major versions, the privilege system is improved. To "
-#~ "make use of it mysql_fix_privilege_tables must be executed manually. The "
-#~ "script is not supposed to give any user more rights that he had before,"
-#~ msgstr ""
-#~ "En sjælden gang imellem, f.eks. ved nye hovedversioner, sker det at "
-#~ "rettighedssystemet forbedres. For at gøre brug af dette, skal "
-#~ "mysql_fix_privilege_tables køres manuelt. Scriptet vil ikke give nogen "
-#~ "bruger flere rettigheder, end vedkommende havde tidligere,"
-
diff --git a/debian/po/de.po b/debian/po/de.po
deleted file mode 100644
index 60c9a984622..00000000000
--- a/debian/po/de.po
+++ /dev/null
@@ -1,195 +0,0 @@
-# translation of mysql-dfsg-5.0_5.0.32-6_de.po to german
-#
-# Translators, if you are not familiar with the PO format, gettext
-# documentation is worth reading, especially sections dedicated to
-# this format, e.g. by running:
-# info -n '(gettext)PO Files'
-# info -n '(gettext)Header Entry'
-# Some information specific to po-debconf are available at
-# /usr/share/doc/po-debconf/README-trans
-# or http://www.debian.org/intl/l10n/po-debconf/README-trans#
-# Developers do not need to manually edit POT or PO files.
-#
-# Alwin Meschede <ameschede@gmx.de>, 2006, 2007.
-msgid ""
-msgstr ""
-"Project-Id-Version: mysql-dfsg-5.0_5.0.32-6_de\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2007-02-16 22:27+0100\n"
-"PO-Revision-Date: 2007-02-19 12:23+0100\n"
-"Last-Translator: Alwin Meschede <ameschede@gmx.de>\n"
-"Language-Team: german <debian-l10n-german@lists.debian.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: KBabel 1.11.4\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid "Do you really want to downgrade?"
-msgstr "Möchten Sie wirklich eine ältere Version einspielen?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid ""
-"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
-"mysql-server package with a higher version has been installed before. It can "
-"not be guaranteed that this version can use its data."
-msgstr ""
-"WARNUNG: Die Datei /var/lib/mysql/debian-*.flag existiert. Dies zeigt an, "
-"dass früher ein MySQL-Server-Paket mit einer höheren Version installiert "
-"worden war. Es kann nicht garantiert werden, dass diese Version dessen Daten "
-"benutzen kann."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "Important note for NIS/YP users!"
-msgstr "Wichtige Anmerkung für NIS/YP-Benutzer!"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"To use mysql you must install an equivalent user and group to the following "
-"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
-"gid may be different)."
-msgstr ""
-"Um MySQL benutzen zu können, müssen Sie einen zum folgenden Eintrag "
-"äquivalenten Benutzer und Gruppe einrichten, und sich vergewissern, dass /"
-"var/lib/mysql die richtigen Rechte hat (die UID/GID dürfen sich "
-"unterscheiden)."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-msgstr "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/group: mysql:x:101:"
-msgstr "/etc/group: mysql:x:101:"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
-msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid "Remove the databases used by all MySQL versions?"
-msgstr "Die von allen MySQL-Versionen benutzten Datenbanken entfernen?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid ""
-"The script is about to remove the data directory /var/lib/mysql. If it is "
-"planned to just install a higher MySQL version or if a different mysql-"
-"server package is already using it, the data should be kept."
-msgstr ""
-"Dieses Skript wird das Daten-Verzeichnis /var/lib/mysql entfernen. Falls "
-"geplant ist, nur eine höhere Version von MySQL zu installieren oder ein "
-"anderes mysql-server-Paket dieses bereits benutzt, sollten die Daten "
-"behalten werden."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid "Should MySQL start on boot?"
-msgstr "Soll MySQL automatisch beim Booten starten?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid ""
-"The MySQL can start automatically on boot time or only if you manually type "
-"'/etc/init.d/mysql start'."
-msgstr ""
-"Der MySQL-Dienst kann entweder beim Systemstart oder nur nach der Eingabe "
-"von /etc/init.d/mysql start gestartet werden."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "New password for MySQL \"root\" user:"
-msgstr "Neues Passwort für den MySQL »root«-Benutzer:"
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"It is highly recommended that you set a password for the MySQL "
-"administrative \"root\" user."
-msgstr ""
-"Es wird nachdrücklich empfohlen für den administrativen MySQL »root«-Benutzer "
-"ein Passwort zu setzen."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "If you do not provide a password no changes will be made to the account."
-msgstr ""
-"Falls Sie kein Passwort angeben, werden keine Änderungen am Konto "
-"vorgenommen."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid "Unable to set password for MySQL \"root\" user"
-msgstr "Konnte für den MySQL-»root«-Benutzer kein Passwort setzen"
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"It seems an error occurred while setting the password for the MySQL "
-"administrative user. This may have happened because the user already has a "
-"password, or because there was a problem communicating with the MySQL server."
-msgstr ""
-"Es scheint, dass beim Passwort setzen für den administrativen MySQL-Benutzer "
-"ein Fehler aufgetreten ist. Dies könnte daran liegen, dass der Benutzer "
-"bereits ein Passwort hat oder dass es ein Problem mit der Kommunikation mit "
-"dem MySQL-Server gibt."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"When installation finishes, you should verify that the account is properly "
-"protected with a password (see README.Debian for more information)."
-msgstr ""
-"Nach Ende der Installation sollten Sie überprüfen, ob das Konto angemessen "
-"mit einem Passwort geschützt ist (lesen Sie README.Debian für weitere "
-"Informationen)."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
-msgstr ""
-"Sollen MySQL-Verbindungen von Rechnern mit Debian »Sarge« oder älter "
-"unterstützt werden?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid ""
-"The way passwords were stored was not very secure. This has been improved "
-"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
-"Sarge will not be able to connect to account which are new or whose password "
-"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
-msgstr ""
-"Die Art, wie Passwörter bislang gespeichert wurden, war nicht sehr sicher. "
-"Dies wurde verbessert, allerdings werden Clients (z. B. PHP) von Hosts mit "
-"Debian 3.1 Sarge sich nicht mehr mit MySQL-Konten verbinden können, die neu "
-"angelegt werden oder deren Passwort geändert wird. Siehe auch /usr/share/doc/"
-"mysql-server-5.0/README.Debian."
-
diff --git a/debian/po/es.po b/debian/po/es.po
deleted file mode 100644
index ddbb77d9607..00000000000
--- a/debian/po/es.po
+++ /dev/null
@@ -1,288 +0,0 @@
-# mysql-dfsg-5 translation to spanish
-# Copyright (C) 2005 Software in the Public Interest, SPI Inc.
-# This file is distributed under the same license as the XXXX package.
-#
-# Changes:
-# - Initial translation
-# Jesus Aneiros , 2006
-# - Updated
-# Javier Fernandez-Sanguino, 2006
-# - Revision
-# Nacho Barrientos Arias
-# Fernando Cerezal
-# David Martínez Moreno
-# Ricardo Mones
-# Carlos Galisteo
-# Javier Fernandez-Sanguino
-#
-#
-# Traductores, si no conoce el formato PO, merece la pena leer la
-# documentación de gettext, especialmente las secciones dedicadas a este
-# formato, por ejemplo ejecutando:
-# info -n '(gettext)PO Files'
-# info -n '(gettext)Header Entry'
-#
-# Equipo de traducción al español, por favor lean antes de traducir
-# los siguientes documentos:
-#
-# - El proyecto de traducción de Debian al español
-# http://www.debian.org/intl/spanish/
-# especialmente las notas y normas de traducción en
-# http://www.debian.org/intl/spanish/notas
-#
-# - La guía de traducción de po's de debconf:
-# /usr/share/doc/po-debconf/README-trans
-# o http://www.debian.org/intl/l10n/po-debconf/README-trans
-#
-# Si tiene dudas o consultas sobre esta traducción consulte con el último
-# traductor (campo Last-Translator) y ponga en copia a la lista de
-# traducción de Debian al español (<debian-l10n-spanish@lists.debian.org>)
-msgid ""
-msgstr ""
-"Project-Id-Version: mysql-dfsg-5.0_5.0.24-3\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2007-02-16 22:27+0100\n"
-"PO-Revision-Date: 2007-02-18 12:20+0100\n"
-"Last-Translator: Javier Fernández-Sanguino <jfs@debian.org>\n"
-"Language-Team: Debian l10 Spanish <debian-l10n-spanish@lists.debian.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid "Do you really want to downgrade?"
-msgstr "¿Desea realmente instalar una versión anterior?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid ""
-"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
-"mysql-server package with a higher version has been installed before. It can "
-"not be guaranteed that this version can use its data."
-msgstr ""
-"ATENCIÓN: El archivo /var/lib/mysql/debian-*.flag existe. Esto indica que ya "
-"se instaló una versión superior del paquete mysql-server. No se puede "
-"garantizar que esta versión pueda usar sus datos."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "Important note for NIS/YP users!"
-msgstr "¡Nota importante para los usuarios de NIS/YP!"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"To use mysql you must install an equivalent user and group to the following "
-"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
-"gid may be different)."
-msgstr ""
-"Para utilizar mysql debe instalar un usuario y grupo equivalente al "
-"siguiente y asegurarse de que /var/lib/mysql tiene los permisos correctos "
-"(los valores del «uid» y del «gid» pueden ser diferentes)."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-msgstr ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/group: mysql:x:101:"
-msgstr "/etc/group: mysql:x:101:"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
-msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid "Remove the databases used by all MySQL versions?"
-msgstr ""
-"¿Eliminar las bases de datos utilizadas por todas las versiones de MySQL?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid ""
-"The script is about to remove the data directory /var/lib/mysql. If it is "
-"planned to just install a higher MySQL version or if a different mysql-"
-"server package is already using it, the data should be kept."
-msgstr ""
-"Este guión va a eliminar el directorio de datos «/var/lib/mysql». Debería "
-"mantener los datos si tiene planificado instalar una versión de MySQL "
-"superior o ya hay un paquete «mysql-server» que los está utilizando."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid "Should MySQL start on boot?"
-msgstr "¿Debería ejecutarse MySQL al iniciarse el sistema?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid ""
-"The MySQL can start automatically on boot time or only if you manually type "
-"'/etc/init.d/mysql start'."
-msgstr ""
-"MySQL puede iniciarse en el momento de arranque del sistema o solamente si "
-"se escribe «/etc/init.d/mysql start»."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "New password for MySQL \"root\" user:"
-msgstr "Nueva cContraseña para el usuario «root» de MySQL:"
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"It is highly recommended that you set a password for the MySQL "
-"administrative \"root\" user."
-msgstr ""
-"Se recomienda que configure una contraseña para el usuario "
-"«root» (administrador) de MySQL."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"If you do not provide a password no changes will be made to the account."
-msgstr "No se hará ningún cambio en la cuenta si no introduce una contraseña."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid "Unable to set password for MySQL \"root\" user"
-msgstr "No se pudo fijar la contraseña para el usuario «root» de MySQL"
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"It seems an error occurred while setting the password for the MySQL "
-"administrative user. This may have happened because the user already has a "
-"password, or because there was a problem communicating with the MySQL server."
-msgstr ""
-"Parece que se produjo un error mientras intentaba fijar la contraseña para "
-"el usuario administrador de MySQL. Esto puede haber sucedido porque el "
-"usuario ya tenía una contraseña o porque se produjo un error de comunicación "
-"con el servidor MySQL."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"When installation finishes, you should verify that the account is properly "
-"protected with a password (see README.Debian for more information)."
-msgstr ""
-"Debería confirmar que la contraseña está correctamente protegida con una "
-"contraseña cuando termine la instalación (consulte el fichero README.Debian "
-"si desea más información)."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
-msgstr "¿Soportar las conexiones MySQL establecidadas desde sistemas que ejecutan Debian Sarge o versiones anteriores?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid ""
-"The way passwords were stored was not very secure. This has been improved "
-"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
-"Sarge will not be able to connect to account which are new or whose password "
-"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
-msgstr ""
-"No era muy segura la forma en la que se almacenaban las contraseñas antes. "
-"Este problema se ha mejorado con el inconveniente, sin embargo, de que "
-"clientes (por ejemplo, PHP) que ejecutan Debian 3.1 «Sarge» no podrán "
-"conectarse a cuentas que son nuevas o a las que se le haya cambiado la "
-"contraseña. Para más información consulte «/usr/share/doc/mysql-server-5.0/"
-"README.Debian»."
-
-#~ msgid "Install Hints"
-#~ msgstr "Sugerencias para la instalación"
-
-#~ msgid ""
-#~ "On upgrades from MySQL 3.23, as shipped with Debian Woody, symlinks in "
-#~ "place of /var/lib/mysql or /var/log/mysql gets accidently removed and "
-#~ "have manually be restored."
-#~ msgstr ""
-#~ "Al actualizar a la versión de MySQL 3.23, la vrsión proporcionada en "
-#~ "Debian Woody, se eliminan de manera accidental, los enlaces simbólicos a "
-#~ "«/var/lib/mysql» o «/var/log/mysql» y tienen que restaurarse manualmente."
-
-#~ msgid ""
-#~ "MySQL will only install if you have a non-numeric hostname that is "
-#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command "
-#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 "
-#~ "myhostname\"."
-#~ msgstr ""
-#~ "Sólo se instalará MySQL si tiene un nombre de equipo que no sea una "
-#~ "dirección IP y pueda resolverse a través del archivo /etc/hosts. Por "
-#~ "ejemplo, si la orden «hostname» devuelve «MiNombreEquipo» entonces deberá "
-#~ "existir una línea «10.0.0.1 MiNombreEquipo» en dicho archivo."
-
-#~ msgid ""
-#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account "
-#~ "is used in the start/stop and cron scripts. Don't delete."
-#~ msgstr ""
-#~ "Se creará un nuevo usuario «debian-sys-maint». Esta cuenta de mysql se "
-#~ "utilizará en los scripts de inicio y parada y en los scripts «cron». No "
-#~ "la elimine."
-
-#~ msgid ""
-#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /"
-#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in "
-#~ "there, never only the password!"
-#~ msgstr ""
-#~ "¡Por favor, recuerde crear una CONTRASEÑA para el usuario «root» de "
-#~ "MySQL! ¡Si utiliza /root/.my.cnf debe escribir las líneas «user» y "
-#~ "«password» en dicho archivo, no incluya sólo la contraseña!"
-
-#~ msgid ""
-#~ "See /usr/share/doc/mysql-server-5.0/README.Debian for more information."
-#~ msgstr ""
-#~ "Revise /usr/share/doc/mysql-server-5.0/README.Debian para más información."
-
-#~ msgid ""
-#~ "Should I remove the complete /var/lib/mysql directory tree which is used "
-#~ "by all MySQL versions, not necessarily only the one you are about to "
-#~ "purge?"
-#~ msgstr ""
-#~ "¿Debería eliminar el árbol de directorio /var/lib/mysql completo? Tenga "
-#~ "en cuenta que lo utilizan todas las versiones de MySQL y no sólo la que "
-#~ "está a punto de purgar."
-
-#~ msgid "Cannot upgrade if ISAM tables are present!"
-#~ msgstr "¡No se puede actualizar si ya hay tablas ISAM!"
-
-#~ msgid ""
-#~ "Recent versions of MySQL can no longer use the old ISAM table format and "
-#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by "
-#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". "
-#~ "The installation of mysql-server-5.0 will now abort. In case your old "
-#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert "
-#~ "those tables."
-#~ msgstr ""
-#~ "Las versiones recientes de MySQL ya no soportan el antiguo formato de "
-#~ "tabla ISAM. Antes de realizar la actualización es necesario convertir sus "
-#~ "tablas a por ejemplo, MyISAM, usando «mysql_convert_table_format» o "
-#~ "«ALTER TABLE x ENGINE=MyISAM». Se va a interrumpir ahora la instalación "
-#~ "de mysql-server-5.0. Si aún así su mysql-server-4.1 se elimina aún así, "
-#~ "puede reinstalarlo para convertir ese tipo de tablas."
diff --git a/debian/po/eu.po b/debian/po/eu.po
deleted file mode 100644
index ce50519e8be..00000000000
--- a/debian/po/eu.po
+++ /dev/null
@@ -1,163 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# Piarres BEobide <pi@beobide.net>, 2006.
-msgid ""
-msgstr ""
-"Project-Id-Version: mysql-dfsg-5.0_5.0.26-3-debconf_eu\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2007-02-16 22:27+0100\n"
-"PO-Revision-Date: 2007-02-19 09:33+0100\n"
-"Last-Translator: Piarres Beobide <pi@beobide.net>\n"
-"Language-Team: Euskara <Librezale@librezale.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Pootle 0.10.1\n"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid "Do you really want to downgrade?"
-msgstr "Benetan bertsio zaharragora itzuli nahi duzu?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid ""
-"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
-"mysql-server package with a higher version has been installed before. It can "
-"not be guaranteed that this version can use its data."
-msgstr "Oharra: /var/lib/mysql/debian-*.flag dago.. Honek aurretik bertsio berriagoko mysql-zerbitzari bat instalatu dela adierazten du. Ezin da ziurtatu bertsio honek datu horiek erabili ahal izango dituenik."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "Important note for NIS/YP users!"
-msgstr "NIS/YP erabiltzaileentzat ohar garrantzitsua!"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"To use mysql you must install an equivalent user and group to the following "
-"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
-"gid may be different)."
-msgstr ""
-"Mysql erabili ahal izateko beharrezko erabiltzaile eta taldea sortu eta /var/"
-"lib/mysql-ek beharrezko baimenak dituela ziurtatu behar duzu (uid/gid-a "
-"ezberdina izan daiteke)"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-msgstr ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/group: mysql:x:101:"
-msgstr "/etc/group: mysql:x:101:"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
-msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid "Remove the databases used by all MySQL versions?"
-msgstr "MySQL bertsio guztiek erabilitako databaseak ezabatu?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid ""
-"The script is about to remove the data directory /var/lib/mysql. If it is "
-"planned to just install a higher MySQL version or if a different mysql-"
-"server package is already using it, the data should be kept."
-msgstr "Script-a /var/lib/mysql data direktorioa ezabatzera doa. MySQL bertsio berriago bat instalatu behar bada edo beste mysql-server pakete bat berau erabiltzen ari bada, datuak mantendu egingo dira."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid "Should MySQL start on boot?"
-msgstr "Sistema abiaraztean MySQL abiarazi behar al da?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid ""
-"The MySQL can start automatically on boot time or only if you manually type "
-"'/etc/init.d/mysql start'."
-msgstr "MySQL abiaraztean automatikoki abiarazi daiteke edo eskuz /etc/init.d/mysql start' eginaz."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "New password for MySQL \"root\" user:"
-msgstr "MySQL \"root\" erabiltzailearen pasahitz berria:"
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"It is highly recommended that you set a password for the MySQL "
-"administrative \"root\" user."
-msgstr ""
-"Oso gomendagarria da MySQL administratzaile \"root\" erabiltzaileari "
-"pasahitz bat ezartzea."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"If you do not provide a password no changes will be made to the account."
-msgstr "Ez baduzu pasahitzik ezartzen ez da aldaketarik egingo kontuan."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid "Unable to set password for MySQL \"root\" user"
-msgstr "Ezinda MySQL \"root\" erabiltzailearen pasahitza ezarri"
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"It seems an error occurred while setting the password for the MySQL "
-"administrative user. This may have happened because the user already has a "
-"password, or because there was a problem communicating with the MySQL server."
-msgstr "Dirudienez errore bat gertatu da MySQL administratzaile kontuaren pasahitza ezartzean. Hau erabiltzaileak dagoeneko pasahitz bat duelako edo MySQL zerbitzariarekiko konexioan erroreak daudelako gertatu daiteke."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"When installation finishes, you should verify that the account is properly "
-"protected with a password (see README.Debian for more information)."
-msgstr ""
-"Instalazio amaitzean, kontua pasahitzez babesturik dagoela ziurtatu beharko "
-"zenuke (README.Debian irakurri xehetasun gehiagotarako)"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
-msgstr "Debian \"sarge\" edo zaharragoak erabiltzen duten ostalarietatik MySQL konexioak onartu?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid ""
-"The way passwords were stored was not very secure. This has been improved "
-"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
-"Sarge will not be able to connect to account which are new or whose password "
-"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
-msgstr "Pasahitzak biltegiratzeko modua ez da oso ziurra. Hau hobetua izan da baina Debian 3.1 Sarge erabiltzaileak ezingo dira kontu berri edo pasahitza aldatu duten kontuetara konektatu. Begiratu /usr/share/doc/mysql-server-5.0/README.Debian argibide gehiagorako."
diff --git a/debian/po/fr.po b/debian/po/fr.po
deleted file mode 100644
index 51196a0cba8..00000000000
--- a/debian/po/fr.po
+++ /dev/null
@@ -1,204 +0,0 @@
-# translation of fr.po to French
-# Translators, if you are not familiar with the PO format, gettext
-# documentation is worth reading, especially sections dedicated to
-# this format, e.g. by running:
-# info -n '(gettext)PO Files'
-# info -n '(gettext)Header Entry'
-#
-# Some information specific to po-debconf are available at
-# /usr/share/doc/po-debconf/README-trans
-# or http://www.debian.org/intl/l10n/po-debconf/README-trans
-#
-# Developers do not need to manually edit POT or PO files.
-#
-# Christian Perrier <bubulle@debian.org>, 2004, 2006.
-msgid ""
-msgstr ""
-"Project-Id-Version: fr\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2007-02-16 22:27+0100\n"
-"PO-Revision-Date: 2006-11-23 20:47+0100\n"
-"Last-Translator: Christian Perrier <bubulle@debian.org>\n"
-"Language-Team: French <debian-l10n-french@lists.debian.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=ISO-8859-15\n"
-"Content-Transfer-Encoding: 8bit\n"
-"debian.org>\n"
-"X-Generator: KBabel 1.11.4\n"
-"Plural-Forms: Plural-Forms: nplurals=2; plural=n>1;\n"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid "Do you really want to downgrade?"
-msgstr "Faut-il vraiment revenir à la version précédente ?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid ""
-"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
-"mysql-server package with a higher version has been installed before. It can "
-"not be guaranteed that this version can use its data."
-msgstr ""
-"Un fichier /var/lib/mysql/debian-*.flag est présent. Cela indique qu'une "
-"version plus récente du paquet mysql-server a été précédemment installée. Il "
-"n'est pas garanti que cette version puisse en utiliser les données."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "Important note for NIS/YP users!"
-msgstr "Note importante pour les utilisateurs NIS/YP"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"To use mysql you must install an equivalent user and group to the following "
-"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
-"gid may be different)."
-msgstr ""
-"Pour utiliser MySQL, vous devez créer un utilisateur et un groupe similaires "
-"à ce qui suit et vérifier que /var/lib/mysql possède les permissions "
-"appropriées (les identifiants numériques de groupe et d'utilisateur, uid et "
-"gid, peuvent être différents)."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-msgstr ""
-"/etc/passwd : mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/group: mysql:x:101:"
-msgstr "/etc/group : mysql:x:101:"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
-msgstr "/var/lib/mysql : drwxr-xr-x mysql mysql"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid "Remove the databases used by all MySQL versions?"
-msgstr "Supprimer les bases de données de toutes les versions de MySQL ?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid ""
-"The script is about to remove the data directory /var/lib/mysql. If it is "
-"planned to just install a higher MySQL version or if a different mysql-"
-"server package is already using it, the data should be kept."
-msgstr ""
-"Les données du répertoire /var/lib/mysql seront supprimées. Si vous prévoyez "
-"d'installer une version plus récente de MySQL ou si un autre paquet mysql-"
-"server les utilise déjà, vous devriez les conserver."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid "Should MySQL start on boot?"
-msgstr "Faut-il lancer MySQL au démarrage ?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid ""
-"The MySQL can start automatically on boot time or only if you manually type "
-"'/etc/init.d/mysql start'."
-msgstr ""
-"MySQL peut être lancé soit au démarrage, soit en entrant la commande « /etc/"
-"init.d/mysql start ». Choisissez cette option si vous voulez que MySQL soit "
-"lancé automatiquement."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "New password for MySQL \"root\" user:"
-msgstr "Mot de passe du superutilisateur de MySQL :"
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"It is highly recommended that you set a password for the MySQL "
-"administrative \"root\" user."
-msgstr ""
-"Il est très fortement recommandé d'établir un mot de passe pour le compte "
-"d'administration de MySQL (« root »)."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"If you do not provide a password no changes will be made to the account."
-msgstr "Si ce champ est laissé vide, le mot de passe ne sera pas changé."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid "Unable to set password for MySQL \"root\" user"
-msgstr ""
-"Impossible de changer le mot de passe de l'utilisateur « root » de MySQL"
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"It seems an error occurred while setting the password for the MySQL "
-"administrative user. This may have happened because the user already has a "
-"password, or because there was a problem communicating with the MySQL server."
-msgstr ""
-"Une erreur semble s'être produite lors du changement de mot de passe du "
-"compte d'administration. Un mot de passe existait peut-être déjà ou il n'a "
-"pas été possible de communiquer avec le serveur MySQL."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"When installation finishes, you should verify that the account is properly "
-"protected with a password (see README.Debian for more information)."
-msgstr ""
-"À la fin de l'installation, veuillez vérifier que le compte possède bien un "
-"mot de passe (veuillez consulter le fichier README.Debian pour plus "
-"d'informations)."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
-msgstr ""
-"Gérer les connexions d'hôtes qui utilisent les versions Debian « sarge » ou antérieures  ?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid ""
-"The way passwords were stored was not very secure. This has been improved "
-"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
-"Sarge will not be able to connect to account which are new or whose password "
-"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
-msgstr ""
-"La méthode de stockage des mots de passe n'était pas très sûre dans les "
-"version précédentes de ce paquet. Cette méthode a été améliorée mais les "
-"modifications empêchent la connexion avec de nouveaux comptes ou des comptes "
-"dont le mot de passe a été modifié, pour les clients (p. ex. PHP) depuis des "
-"hôtes qui utilisent Debian 3.1 « sarge ». Veuillez consulter le fichier /usr/"
-"share/doc/mysql-server-5.0/README.Debian pour plus d'informations."
-
-#~ msgid "internal"
-#~ msgstr "interne"
-
-#~ msgid "Only internally used."
-#~ msgstr ""
-#~ "message utilisé en interne uniquement et que cet andouille de mainteneur "
-#~ "a marqué comme traduisible"
diff --git a/debian/po/gl.po b/debian/po/gl.po
deleted file mode 100644
index 44fd58872cc..00000000000
--- a/debian/po/gl.po
+++ /dev/null
@@ -1,279 +0,0 @@
-# Galician translation of mysql-dfsg-5.0's debconf templates
-# This file is distributed under the same license as the mysql-dfsg-5.0 package.
-# Jacobo Tarrio <jtarrio@debian.org>, 2006.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: mysql-dfsg-5.0\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2007-02-16 22:27+0100\n"
-"PO-Revision-Date: 2007-02-18 15:42+0100\n"
-"Last-Translator: Jacobo Tarrio <jtarrio@debian.org>\n"
-"Language-Team: Galician <trasno@ceu.fi.udc.es>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid "Do you really want to downgrade?"
-msgstr "¿Quere pasar a unha versión anterior?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid ""
-"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
-"mysql-server package with a higher version has been installed before. It can "
-"not be guaranteed that this version can use its data."
-msgstr ""
-"AVISO: O ficheiro /var/lib/mysql/debian-*.flag existe. Isto indica que se "
-"instalou antes un paquete mysql-server dunha versión maior. Non se pode "
-"garantir que esta versión poida empregar os seus datos."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "Important note for NIS/YP users!"
-msgstr "Nota importante para usuarios de NIS/YP"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"To use mysql you must install an equivalent user and group to the following "
-"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
-"gid may be different)."
-msgstr ""
-"Para empregar mysql debe instalar un usuario e grupo equivalentes aos "
-"seguintes e asegurarse de que /var/lib/mysql teña os permisos correctos (o "
-"uid/gid poden ser diferentes)."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-msgstr ""
-"/etc/passwd: mysql:x:100:101:Servidor MySQL:/var/lib/mysql:/bin/false"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/group: mysql:x:101:"
-msgstr "/etc/group: mysql:x:101:"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
-msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid "Remove the databases used by all MySQL versions?"
-msgstr "¿Eliminar as bases de datos empregadas por tódalas versións de MySQL?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid ""
-"The script is about to remove the data directory /var/lib/mysql. If it is "
-"planned to just install a higher MySQL version or if a different mysql-"
-"server package is already using it, the data should be kept."
-msgstr ""
-"O script vai eliminar o directorio de datos /var/lib/mysql. Se se planea "
-"instalar unha versión superior de MySQL ou se hai outro paquete mysql-server "
-"que o estean a empregar, debería conservar os datos."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid "Should MySQL start on boot?"
-msgstr "¿MySQL debería iniciarse co ordenador?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid ""
-"The MySQL can start automatically on boot time or only if you manually type "
-"'/etc/init.d/mysql start'."
-msgstr ""
-"MySQL pode arrincar automaticamente ao iniciar o ordenador ou só se escribe "
-"\"/etc/init.d/mysql start\" a man."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "New password for MySQL \"root\" user:"
-msgstr "Novo contrasinal para o usuario \"root\" de MySQL"
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"It is highly recommended that you set a password for the MySQL "
-"administrative \"root\" user."
-msgstr ""
-"Recoméndase encarecidamente que estabreza un contrasinal para o usuario "
-"administrativo \"root\" de MySQL."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"If you do not provide a password no changes will be made to the account."
-msgstr "Se non fornece un contrasinal non se ha facer ningún cambio na conta."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid "Unable to set password for MySQL \"root\" user"
-msgstr "Non se puido establecer o contrasinal para o usuario \"root\" de MySQL"
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"It seems an error occurred while setting the password for the MySQL "
-"administrative user. This may have happened because the user already has a "
-"password, or because there was a problem communicating with the MySQL server."
-msgstr ""
-"Semella que houbo un erro ao establecer o contrasinal para o usuario "
-"administrativo de MySQL. Puido ocorrer porque o usuario xa teña un "
-"contrasinal ou porque teña habido un problema ao se comunicar co servidor "
-"MySQL."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"When installation finishes, you should verify that the account is properly "
-"protected with a password (see README.Debian for more information)."
-msgstr ""
-"Ao rematar a instalación debería comprobar que a conta estea correctamente "
-"protexida cun contrsinal (consulte o ficheiro README.Debian para ter máis "
-"información)."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
-msgstr ""
-"¿Soportar as conexións a MySQL de máquinas que empreguen Debian \"sarge\" ou "
-"anterior?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid ""
-"The way passwords were stored was not very secure. This has been improved "
-"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
-"Sarge will not be able to connect to account which are new or whose password "
-"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
-msgstr ""
-"O xeito no que se armacenaban os contrasinais non era moi seguro. Isto "
-"mellorouse co inconveniente de que os clientes (por exemplo, PHP) das "
-"máquinas que executen Debian 3.1 Sarge non se han poder conectar a contas "
-"novas ou nas que se cambiara o contrasinal. Consulte /usr/share/doc/mysql-"
-"server-5.0/README.Debian."
-
-#~ msgid "Cannot upgrade if ISAM tables are present!"
-#~ msgstr "Non se pode actualizar se hai táboas ISAM presentes"
-
-#~ msgid ""
-#~ "Recent versions of MySQL can no longer use the old ISAM table format and "
-#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by "
-#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". "
-#~ "The installation of mysql-server-5.0 will now abort. In case your old "
-#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert "
-#~ "those tables."
-#~ msgstr ""
-#~ "As versións recentes de MySQL xa non poden empregar o antigo formato de "
-#~ "táboas ISAM e é necesario converter as táboas a, por exemplo, MyISAM "
-#~ "antes de actualizar, empregando \"mysql_convert_table_format\" ou \"ALTER "
-#~ "TABLE x ENGINE=MyISAM\". A instalación de mysql-server-5.0 hase abortar "
-#~ "agora. Se o seu antigo mysql-server-4.1 se elimina volva instalalo para "
-#~ "converter esas táboas."
-
-#~ msgid "Update Hints"
-#~ msgstr "Consellos de actualización"
-
-#~ msgid ""
-#~ "You have to run \"mysql_upgrade\" after the upgrade, else tables can be "
-#~ "corrupted! This script also enhances the privilege tables but is not "
-#~ "supposed to give any user more rights that he had before,"
-#~ msgstr ""
-#~ "Ten que executar \"mysql_upgrade\" trala actualización; se non o fai, as "
-#~ "táboas poden quedar corrompidas. Este script tamén mellora as táboas de "
-#~ "privilexios, pero non se supón que vaia dar a ningún usuario máis "
-#~ "dereitos dos que tiña antes."
-
-#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html"
-#~ msgstr "Lea tamén http://www.mysql.com/doc/en/Upgrade.html"
-
-#~ msgid "Install Hints"
-#~ msgstr "Consellos de instalación"
-
-#~ msgid ""
-#~ "On upgrades from MySQL 3.23, as shipped with Debian Woody, symlinks in "
-#~ "place of /var/lib/mysql or /var/log/mysql gets accidently removed and "
-#~ "have manually be restored."
-#~ msgstr ""
-#~ "Nas actualizacións desde MySQL 3.23, tal como se fornecía con Debian "
-#~ "Woody, as ligazóns simbólicas no lugar de /var/lib/mysql ou /var/log/"
-#~ "mysql quedan eliminadas por accidente e hai que as restaurar a man."
-
-#~ msgid ""
-#~ "MySQL will only install if you have a non-numeric hostname that is "
-#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command "
-#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 "
-#~ "myhostname\"."
-#~ msgstr ""
-#~ "MySQL só se ha instalar se ten un nome de máquina non numérico que se "
-#~ "poida resolver polo ficheiro /etc/hosts. Por exemplo, se a orde \"hostname"
-#~ "\" devolve \"omeuordenador\" ten que haber unha liña coma \"10.0.0.1 "
-#~ "omeuordenador\"."
-
-#~ msgid ""
-#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account "
-#~ "is used in the start/stop and cron scripts. Don't delete."
-#~ msgstr ""
-#~ "Hase crear un novo usuario de mysql, \"debian-sys-maint\". Esta conta de "
-#~ "mysql emprégase nos scripts de inicio/parada e de cron. Non o borre."
-
-#~ msgid ""
-#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /"
-#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in "
-#~ "there, never only the password!"
-#~ msgstr ""
-#~ "Lembre estabrecer sempre un contrasinal para o usuario administrador de "
-#~ "MySQL. Se emprega un ficheiro /root/.my.cnf escriba sempre nel as liñas "
-#~ "\"user\" e \"password\", nunca o contrasinal só."
-
-#~ msgid ""
-#~ "See /usr/share/doc/mysql-server-5.0/README.Debian for more information."
-#~ msgstr ""
-#~ "Consulte /usr/share/doc/mysql-server-5.0/README.Debian para máis "
-#~ "información."
-
-#~ msgid ""
-#~ "Should I remove the complete /var/lib/mysql directory tree which is used "
-#~ "by all MySQL versions, not necessarily only the one you are about to "
-#~ "purge?"
-#~ msgstr ""
-#~ "¿Débese eliminar a árbore completa de directorios de /var/lib/mysql que "
-#~ "se emprega en tódalas versións de MySQL, non só necesariamente na que vai "
-#~ "eliminar?"
-
-#~ msgid ""
-#~ "Rarely, e.g. on new major versions, the privilege system is improved. To "
-#~ "make use of it mysql_fix_privilege_tables must be executed manually. The "
-#~ "script is not supposed to give any user more rights that he had before,"
-#~ msgstr ""
-#~ "Moi de cando en vez, por exemplo nos cambios grandes de versión, "
-#~ "mellórase o sistema de privilexios. Para poder empregalo hai que executar "
-#~ "manualmente mysql_fix_privilege_tables. Suponse que o script non vai dar "
-#~ "a ningún usuario máis dereitos dos que xa tiña antes."
diff --git a/debian/po/it.po b/debian/po/it.po
deleted file mode 100644
index 9a8741c5e90..00000000000
--- a/debian/po/it.po
+++ /dev/null
@@ -1,184 +0,0 @@
-# Italian (it) translation of debconf templates for mysql-dfsg-5.0
-# Copyright (C) 2006 Software in the Public Interest
-# This file is distributed under the same license as the mysql-dfsg-5.0 package.
-# Luca Monducci <luca.mo@tiscali.it>, 2006, 2007.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: mysql-dfsg-5.0 5.0.32-6 italian debconf templates\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2007-02-16 22:27+0100\n"
-"PO-Revision-Date: 2007-02-18 15:09+0100\n"
-"Last-Translator: Luca Monducci <luca.mo@tiscali.it>\n"
-"Language-Team: Italian <tp@lists.linux.it>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=ISO-8859-1\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid "Do you really want to downgrade?"
-msgstr "Si vuole realmente degradare?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid ""
-"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
-"mysql-server package with a higher version has been installed before. It can "
-"not be guaranteed that this version can use its data."
-msgstr ""
-"ATTENZIONE: Esiste un file /var/lib/mysql/debian-*.flag. Questo indica che "
-"precedenza è stata installata una versione più recente del pacchetto mysql-"
-"server. Non si garantisce che la versione che si sta installando possa usare "
-"i dati."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "Important note for NIS/YP users!"
-msgstr "Nota per gli utenti NIS/YP"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"To use mysql you must install an equivalent user and group to the following "
-"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
-"gid may be different)."
-msgstr ""
-"Per usare mysql si deve installare un utente e un gruppo equivalenti ai "
-"seguenti e assicurarsi di avere su /var/lib/mysql i permessi corretti (uid e "
-"gid possono anche essere diversi)."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-msgstr ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/group: mysql:x:101:"
-msgstr "/etc/group: mysql:x:101:"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
-msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid "Remove the databases used by all MySQL versions?"
-msgstr "Eliminare i database usati da tutte le versioni di MySQL?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid ""
-"The script is about to remove the data directory /var/lib/mysql. If it is "
-"planned to just install a higher MySQL version or if a different mysql-"
-"server package is already using it, the data should be kept."
-msgstr ""
-"Lo script sta per eliminare la directory con i dati /var/lib/mysql. Se ciò "
-"che si intende fare è un semplice aggiornamento a una nuova versione di "
-"MySQL oppure se è in uso un'altra di versione del pacchetto mysql-server, i "
-"dati non devono essere eliminati."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid "Should MySQL start on boot?"
-msgstr "Far partire MySQL all'avvio del sistema?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid ""
-"The MySQL can start automatically on boot time or only if you manually type "
-"'/etc/init.d/mysql start'."
-msgstr ""
-"MySQL può partire automaticamente all'avvio del sistema oppure solo "
-"manualmente con il comando «/etc/init.d/mysql start»."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "New password for MySQL \"root\" user:"
-msgstr "Nuova password per l'utente «root» di MySQL:"
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"It is highly recommended that you set a password for the MySQL "
-"administrative \"root\" user."
-msgstr ""
-"Si raccomanda d'impostare una password per l'utente d'amministrazione "
-"(«root») di MySQL."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"If you do not provide a password no changes will be made to the account."
-msgstr ""
-"Se non si fornisce la password non saranno fatte modifiche all'account."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid "Unable to set password for MySQL \"root\" user"
-msgstr "Impossible impostare la password per l'utente «root» di MySQL"
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"It seems an error occurred while setting the password for the MySQL "
-"administrative user. This may have happened because the user already has a "
-"password, or because there was a problem communicating with the MySQL server."
-msgstr ""
-"Pare che si sia verificato un errore durante l'impostazione della password "
-"per l'utente d'amministrazione di MySQL. Questo può essere dovuto al fatto "
-"che la password è già impostata oppure a un problema di comunicazione con il "
-"server MySQL."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"When installation finishes, you should verify that the account is properly "
-"protected with a password (see README.Debian for more information)."
-msgstr ""
-"Al termine dell'installazione si deve verificare che l'account root sia "
-"correttamente protetto da una password (si veda README.Debian per maggiori "
-"informazioni)."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
-msgstr ""
-"Supportare connessioni MySQL da macchine con Debian \"sarge\" o precedente?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid ""
-"The way passwords were stored was not very secure. This has been improved "
-"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
-"Sarge will not be able to connect to account which are new or whose password "
-"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
-msgstr ""
-"La modalità con la quale erano memorizzate le password in passato non era "
-"molto sicura; è stata migliorata con lo svantaggio che i client (per esempio "
-"PHP) presenti su una macchina con Debian 3.1 Sarge non saranno in grado di "
-"connettersi a un nuovo account oppure a un account la cui password sia stata "
-"cambiata. Si veda /usr/share/doc/mysql-server-5.0/README.Debian."
diff --git a/debian/po/ja.po b/debian/po/ja.po
deleted file mode 100644
index 14d97ed977b..00000000000
--- a/debian/po/ja.po
+++ /dev/null
@@ -1,278 +0,0 @@
-#
-# Translators, if you are not familiar with the PO format, gettext
-# documentation is worth reading, especially sections dedicated to
-# this format, e.g. by running:
-# info -n '(gettext)PO Files'
-# info -n '(gettext)Header Entry'
-#
-# Some information specific to po-debconf are available at
-# /usr/share/doc/po-debconf/README-trans
-# or http://www.debian.org/intl/l10n/po-debconf/README-trans
-#
-# Developers do not need to manually edit POT or PO files.
-#
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: mysql-dfsg-5.0 5.0.32-6\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2007-02-16 22:27+0100\n"
-"PO-Revision-Date: 2007-02-18 22:25+0900\n"
-"Last-Translator: Hideki Yamane (Debian-JP) <henrich@debian.or.jp>\n"
-"Language-Team: Japanese <debian-japanese@lists.debian.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid "Do you really want to downgrade?"
-msgstr "本当ã«ãƒ€ã‚¦ãƒ³ã‚°ãƒ¬ãƒ¼ãƒ‰ã—ã¾ã™ã‹?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid ""
-"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
-"mysql-server package with a higher version has been installed before. It can "
-"not be guaranteed that this version can use its data."
-msgstr ""
-"警告: /var/lib/mysql/debian-*.flag ファイルãŒå­˜åœ¨ã—ã¦ã„ã¾ã™ã€‚ã“ã‚Œã¯ã€ä»¥å‰ã«ã‚ˆ"
-"ã‚Šæ–°ã—ã„ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® mysql-server パッケージãŒã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•ã‚Œã¦ã„ãŸã“ã¨ã‚’示"
-"ã—ã¾ã™ã€‚データをã“ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã§ä½¿ãˆã‚‹ã‹ã©ã†ã‹ã€ä¿è¨¼ã§ãã¾ã›ã‚“。"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "Important note for NIS/YP users!"
-msgstr "NIS/YP ユーザã¸é‡è¦ãªæ³¨æ„!"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"To use mysql you must install an equivalent user and group to the following "
-"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
-"gid may be different)."
-msgstr ""
-"mysql を利用ã™ã‚‹ã«ã¯ 以下ã®ãƒ¦ãƒ¼ã‚¶ã¨ã‚°ãƒ«ãƒ¼ãƒ—を作æˆã—ã€/var/lib/mysql ãŒæ­£ã—ã„"
-"権é™ã«ãªã£ã¦ã„ã‚‹ã‹ã©ã†ã‹ã‚’確èªã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ (ãŠãらã uid/gid ãŒé•ã„ã¾"
-"ã™)。"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-msgstr ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/group: mysql:x:101:"
-msgstr "/etc/group: mysql:x:101:"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
-msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid "Remove the databases used by all MySQL versions?"
-msgstr "å…¨ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® MySQL ã§åˆ©ç”¨ã•ã‚Œã¦ã„るデータベースを削除ã—ã¾ã™ã‹?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid ""
-"The script is about to remove the data directory /var/lib/mysql. If it is "
-"planned to just install a higher MySQL version or if a different mysql-"
-"server package is already using it, the data should be kept."
-msgstr ""
-"ã“ã®ã‚¹ã‚¯ãƒªãƒ—トã¯ãƒ‡ãƒ¼ã‚¿ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒª /var/lib/mysql を削除ã™ã‚‹ãŸã‚ã®ã‚‚ã®ã§"
-"ã™ã€‚å˜ã«æ–°ã—ã„ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® MySQL をインストールã—よã†ã¨ã—ã¦ã„ã‚‹ã€ã‚ã‚‹ã„ã¯åˆ¥"
-"ã® mysql-server パッケージを既ã«ä½¿ã£ã¦ã„ã‚‹å ´åˆã€ãƒ‡ãƒ¼ã‚¿ã¯ä¿æŒã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾"
-"ã™ã€‚"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid "Should MySQL start on boot?"
-msgstr "MySQL をシステム起動時ã«é–‹å§‹ã—ã¾ã™ã‹?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid ""
-"The MySQL can start automatically on boot time or only if you manually type "
-"'/etc/init.d/mysql start'."
-msgstr ""
-"MySQL ã®èµ·å‹•æ–¹æ³•ã«ã¤ã„ã¦ã€ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•æ™‚ã«è‡ªå‹•çš„ã«é–‹å§‹ã™ã‚‹ã‹ã€ã‚ã‚‹ã„㯠'/etc/"
-"init.d/mysql start' ã¨æ‰‹ã§å…¥åŠ›ã—ãŸæ™‚ã®ã¿èµ·å‹•ã™ã‚‹ã‹ã‚’é¸ã¹ã¾ã™ã€‚"
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "New password for MySQL \"root\" user:"
-msgstr "MySQL ã® \"root\" ユーザã«å¯¾ã™ã‚‹æ–°ã—ã„パスワード:"
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"It is highly recommended that you set a password for the MySQL "
-"administrative \"root\" user."
-msgstr ""
-"MySQL を管ç†ã™ã‚‹ \"root\" ユーザã®ãƒ‘スワードを設定ã™ã‚‹ã“ã¨ã‚’å¼·ããŠå‹§ã‚ã—ã¾"
-"ã™ã€‚"
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"If you do not provide a password no changes will be made to the account."
-msgstr "パスワードを入力ã—ãªã„å ´åˆã€ã‚¢ã‚«ã‚¦ãƒ³ãƒˆã«å¯¾ã—ã¦å¤‰æ›´ã¯åŠ ãˆã‚‰ã‚Œã¾ã›ã‚“。"
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid "Unable to set password for MySQL \"root\" user"
-msgstr "MySQL ã® \"root\" ユーザã®ãƒ‘スワードを設定ã§ãã¾ã›ã‚“"
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"It seems an error occurred while setting the password for the MySQL "
-"administrative user. This may have happened because the user already has a "
-"password, or because there was a problem communicating with the MySQL server."
-msgstr ""
-"MySQL ã®ç®¡ç†è€…ユーザã«å¯¾ã—ã¦ãƒ‘スワードを設定ã—よã†ã¨ã—ãŸéš›ã€ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ãŸ"
-"よã†ã§ã™ã€‚ã“ã‚Œã¯æ—¢ã«ç®¡ç†è€…ユーザã«ãƒ‘スワードãŒè¨­å®šã•ã‚Œã¦ã„ãŸã‹ã€MySQL サーãƒ"
-"ã¨ã®æŽ¥ç¶šã«å•é¡ŒãŒã‚ã£ãŸãŸã‚ã ã¨æ€ã‚ã‚Œã¾ã™ã€‚"
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"When installation finishes, you should verify that the account is properly "
-"protected with a password (see README.Debian for more information)."
-msgstr ""
-"インストールãŒçµ‚了ã—ãŸéš›ã€ã‚¢ã‚«ã‚¦ãƒ³ãƒˆãŒãƒ‘スワードã§ãã¡ã‚“ã¨ä¿è­·ã•ã‚Œã¦ã„ã‚‹ã‹ã©"
-"ã†ã‹ã‚’確èªã—ã¦ãã ã•ã„ (詳細ã«ã¤ã„ã¦ã¯ README.Debian ã‚’å‚ç…§ã—ã¦ãã ã•ã„)。"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
-msgstr ""
-"Debian \"Sarge\" ã‚ã‚‹ã„ã¯ãれよりもå¤ã„ãƒãƒ¼ã‚¸ãƒ§ãƒ³ãŒç¨¼åƒã—ã¦ã„るホストã‹ã‚‰ã® "
-"MySQL 接続をサãƒãƒ¼ãƒˆã—ã¾ã™ã‹?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid ""
-"The way passwords were stored was not very secure. This has been improved "
-"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
-"Sarge will not be able to connect to account which are new or whose password "
-"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
-msgstr ""
-"パスワードã®ä¿å­˜æ–¹æ³•ã¯ã€ã‚ã¾ã‚Šå®‰å…¨ãªæ–¹æ³•ã§è¡Œã‚ã‚Œã¦ã„ã¾ã›ã‚“ã§ã—ãŸã€‚ã“ã‚Œã¯æ”¹å–„"
-"ã•ã‚Œã¾ã—ãŸãŒã€Debian 3.1 Sarge ãŒç¨¼åƒã—ã¦ã„るホストã‹ã‚‰ã‚¯ãƒ©ã‚¤ã‚¢ãƒ³ãƒˆ (PHP ãª"
-"ã©) ãŒæ–°ã—ã„アカウントやパスワードãŒå¤‰æ›´ã•ã‚ŒãŸã‚¢ã‚«ã‚¦ãƒ³ãƒˆã«ã¯æŽ¥ç¶šã§ããªããªã‚‹"
-"ã¨ã„ã†æ¬ ç‚¹ã‚‚ã§ã¦ã„ã¾ã™ã€‚詳細ã«ã¤ã„ã¦ã¯ /usr/share/doc/mysql-server-5.0/"
-"README.Debian ã‚’å‚ç…§ã—ã¦ãã ã•ã„。"
-
-#~ msgid "Cannot upgrade if ISAM tables are present!"
-#~ msgstr "ISAM テーブルãŒã‚ã‚‹å ´åˆã¯ã‚¢ãƒƒãƒ—グレードã§ãã¾ã›ã‚“!"
-
-#~ msgid ""
-#~ "Recent versions of MySQL can no longer use the old ISAM table format and "
-#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by "
-#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". "
-#~ "The installation of mysql-server-5.0 will now abort. In case your old "
-#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert "
-#~ "those tables."
-#~ msgstr ""
-#~ "MySQL ã®æœ€è¿‘ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã§ã¯ä»¥å‰ã® ISAM テーブル形å¼ã¯åˆ©ç”¨ã§ããªããªã£ã¦ã„"
-#~ "ã¾ã™ã€‚ãã®ãŸã‚ã€ä¾‹ãˆã° \"mysql_convert_table_format\" ã‚ã‚‹ã„㯠\"ALTER "
-#~ "TABLE x ENGINE=MyISAM\" ã¨ã—ã¦ã‚¢ãƒƒãƒ—グレードå‰ã« MyISAM ã«ã‚³ãƒ³ãƒãƒ¼ãƒˆã™ã‚‹ã“"
-#~ "ã¨ãªã©ãŒå¿…è¦ã§ã™ã€‚mysql-server-5.0 ã®ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã‚’中断ã—ã¾ã™ã€‚以å‰ã® "
-#~ "mysql-server-4.1 ãŒå‰Šé™¤ã•ã‚Œã¦ã—ã¾ã£ãŸå ´åˆã§ã‚ã£ã¦ã‚‚ã€ãƒ†ãƒ¼ãƒ–ルをコンãƒãƒ¼ãƒˆ"
-#~ "ã™ã‚‹ãŸã‚ã«å†ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã‚’ã—ã¦ãã ã•ã„。"
-
-#~ msgid "Install Hints"
-#~ msgstr "インストールã®ãƒ’ント"
-
-#~ msgid ""
-#~ "On upgrades from MySQL 3.23, as shipped with Debian Woody, symlinks in "
-#~ "place of /var/lib/mysql or /var/log/mysql gets accidently removed and "
-#~ "have manually be restored."
-#~ msgstr ""
-#~ "Debian Woody ã§ãƒªãƒªãƒ¼ã‚¹ã•ã‚ŒãŸ MySQL 3.23 ã‹ã‚‰ã®ã‚¢ãƒƒãƒ—グレードã§ã¯ã€/var/"
-#~ "lib/mysql ã‚ã‚‹ã„㯠/var/log/mysql ã®ä»£ã‚ã‚Šã«ã‚·ãƒ³ãƒœãƒªãƒƒã‚¯ãƒªãƒ³ã‚¯ã¯å¶ç„¶ã«ã‚‚削"
-#~ "除ã•ã‚Œã¦ã—ã¾ã£ã¦ã„ã‚‹ã®ã§ã€æ‰‹å‹•ã§ã®ãƒªã‚¹ãƒˆã‚¢ãŒå¿…è¦ã«ãªã‚Šã¾ã™ã€‚"
-
-#~ msgid ""
-#~ "MySQL will only install if you have a non-numeric hostname that is "
-#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command "
-#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 "
-#~ "myhostname\"."
-#~ msgstr ""
-#~ "MySQL 㯠/etc/hosts ファイル経由ã§è§£æ±ºã§ãる「数字ã®ã¿ã§æ§‹æˆã•ã‚Œã¦ãªã„ã€ãƒ›"
-#~ "ストåã®å ´åˆã®ã¿ã€ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•ã‚Œã¾ã™ã€‚ã¤ã¾ã‚Šã€\"hostname\" コマンド㌠"
-#~ "\"myhostname\" ã‚’è¿”ã™ãªã‚‰ã€\"10.0.0.1 myhostname\" ã¨ã„ã†è¡ŒãŒ /etc/hosts "
-#~ "ファイルã«ã‚ã‚‹ã¯ãšã§ã™ã€‚"
-
-#~ msgid ""
-#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account "
-#~ "is used in the start/stop and cron scripts. Don't delete."
-#~ msgstr ""
-#~ "æ–°è¦ã« mysql ユーザã¨ã—㦠\"debian-sys-maint\" ãŒä½œæˆã•ã‚Œã¾ã™ã€‚ã“ã® mysql "
-#~ "アカウント㯠start/stop 時㨠cron スクリプトã§åˆ©ç”¨ã•ã‚Œã¾ã™ã€‚消ã•ãªã„ã§ãã "
-#~ "ã•ã„。"
-
-#~ msgid ""
-#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /"
-#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in "
-#~ "there, never only the password!"
-#~ msgstr ""
-#~ "MySQL ã® root ユーザã«å¯¾ã—ã¦ã€Œãƒ‘スワードã®è¨­å®šã€ã‚’忘れãªã„ã§ãã ã•ã„! /"
-#~ "root/.my.cnf を使ã£ã¦ã„ã‚‹å ´åˆã€ã“ã®ãƒ•ã‚¡ã‚¤ãƒ«ä¸­ã® \"user\" 行㨠\"password"
-#~ "\" 行を記述ã—ã¦ãã ã•ã„。決ã—ã¦ãƒ‘スワードã ã‘ã§ã¯ã„ã‘ã¾ã›ã‚“!"
-
-#~ msgid ""
-#~ "See /usr/share/doc/mysql-server-5.0/README.Debian for more information."
-#~ msgstr ""
-#~ "詳細㯠/usr/share/doc/mysql-server-5.0/README.Debian ã‚’å‚ç…§ã—ã¦ãã ã•ã„。"
-
-#~ msgid ""
-#~ "Should I remove the complete /var/lib/mysql directory tree which is used "
-#~ "by all MySQL versions, not necessarily only the one you are about to "
-#~ "purge?"
-#~ msgstr ""
-#~ "ã“ã‚Œã‹ã‚‰ purge ã—よã†ã¨ã—ã¦ã„ã‚‹ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã ã‘ã§ã¯ç„¡ãã€å…¨ã¦ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® "
-#~ "MySQL ㌠/var/lib/mysql ディレクトリを使用ã—ã¦ã„ã¾ã™ã€‚ã“ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’完"
-#~ "å…¨ã«å‰Šé™¤ã—ã¾ã™ã‹?"
-
-#~ msgid "Update Hints"
-#~ msgstr "æ›´æ–°ã®ãƒ’ント"
-
-#~ msgid ""
-#~ "Rarely, e.g. on new major versions, the privilege system is improved. To "
-#~ "make use of it mysql_fix_privilege_tables must be executed manually. The "
-#~ "script is not supposed to give any user more rights that he had before,"
-#~ msgstr ""
-#~ "ã¾ã‚Œã«ã€ã¤ã¾ã‚Šã¯æ–°ã—ã„メジャーãƒãƒ¼ã‚¸ãƒ§ãƒ³ã«ãŠã„ã¦ã€ç‰¹æ¨©ã‚·ã‚¹ãƒ†ãƒ ãŒæ”¹å–„ã•ã‚Œã¾"
-#~ "ã™ã€‚ã“れを行ã†ã«ã¯ã€mysql_fix_privilege_table を手動ã§å®Ÿè¡Œã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾"
-#~ "ã™ã€‚スクリプトã¯ã€ã©ã®ã‚ˆã†ãªãƒ¦ãƒ¼ã‚¶ã«å¯¾ã—ã¦ã‚‚ã€ä»¥å‰ã«ä¿æŒã—ã¦ã„ãŸä»¥ä¸Šã®æ¨©é™"
-#~ "を与ãˆã‚‹ã‚ˆã†ã«ã¯ãªã£ã¦ã„ã¾ã›ã‚“。"
-
-#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html"
-#~ msgstr "http://www.mysql.com/doc/ja/Upgrade.html ã‚‚å‚ç…§ã—ã¦ãã ã•ã„"
diff --git a/debian/po/nb.po b/debian/po/nb.po
deleted file mode 100644
index e7a58534863..00000000000
--- a/debian/po/nb.po
+++ /dev/null
@@ -1,179 +0,0 @@
-# translation of mysql_nb.po to Norwegian Bokmål
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Bjørn Steensrud <bjornst@powertech.no>, 2007.
-msgid ""
-msgstr ""
-"Project-Id-Version: mysql_nb\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2007-02-16 22:27+0100\n"
-"PO-Revision-Date: 2007-02-18 12:13+0100\n"
-"Last-Translator: Bjørn Steensrud <bjornst@powertech.no>\n"
-"Language-Team: Norwegian Bokmål <i18n-nb@lister.ping.uio.no>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: KBabel 1.11.2\n"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid "Do you really want to downgrade?"
-msgstr "Er du sikker på at du vil nedgradere?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid ""
-"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
-"mysql-server package with a higher version has been installed before. It can "
-"not be guaranteed that this version can use its data."
-msgstr ""
-"ADVARSEL: Fila /var/lib/mysql/debian-*.flag finnes. Dette viser at en "
-"mysql-server-pakke med et høyere versjonsnummer har vært installert før. "
-"Det kan ikke garanteres at denne versjonen kan bruke data fra den høyere versjonen."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "Important note for NIS/YP users!"
-msgstr "Viktig merknad for NIS/YP-brukere!"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"To use mysql you must install an equivalent user and group to the following "
-"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
-"gid may be different)."
-msgstr ""
-"For å bruke MySQL må du installere en bruker og gruppe tilsvarende den "
-"nedenfor og se til at /var/lib/mysql har riktige rettigheter (uid/gid kan "
-"være forskjellig)."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-msgstr "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/group: mysql:x:101:"
-msgstr "/etc/group: mysql:x:101:"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
-msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid "Remove the databases used by all MySQL versions?"
-msgstr "Skal databasene brukt av alle MySQL-versjoner fjernes?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid ""
-"The script is about to remove the data directory /var/lib/mysql. If it is "
-"planned to just install a higher MySQL version or if a different mysql-"
-"server package is already using it, the data should be kept."
-msgstr ""
-"Dette skriptet skal til å fjerne data-mappa /var/lib/mysql. Denne mappa "
-"bør beholdes hvis det bare skal installeres en høyere MySQL-versjon, "
-"eller hvis en annen mysql-server-pakke allerede bruker den."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid "Should MySQL start on boot?"
-msgstr "Skal MySQL startes ved maskinoppstart?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid ""
-"The MySQL can start automatically on boot time or only if you manually type "
-"'/etc/init.d/mysql start'."
-msgstr ""
-"MySQL kan startes automatisk når maskinen starter, eller bare hvis du "
-"skriver «/etc/init.d/mysql start»."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "New password for MySQL \"root\" user:"
-msgstr "Nytt passord for MySQLs «root»-bruker:"
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"It is highly recommended that you set a password for the MySQL "
-"administrative \"root\" user."
-msgstr ""
-"Det anbefales sterkt at du oppgir et passord for den administrative "
-"«root»-brukeren i MySQl."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "If you do not provide a password no changes will be made to the account."
-msgstr "Hvis du ikke oppgir et passord blir det ikke gjort noen endringer med kontoen."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid "Unable to set password for MySQL \"root\" user"
-msgstr "Klarer ikke angi passord for MySQLs «root»-bruker"
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"It seems an error occurred while setting the password for the MySQL "
-"administrative user. This may have happened because the user already has a "
-"password, or because there was a problem communicating with the MySQL server."
-msgstr ""
-"Det ser ut til at det oppsto en feil mens det ble satt et passord for "
-"MySQLs administrative bruker. Dette kan være fordi brukeren allerede "
-"har et passord, eller fordi det var et kommunikasjonsproblem med "
-"MySQL-tjeneren."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"When installation finishes, you should verify that the account is properly "
-"protected with a password (see README.Debian for more information)."
-msgstr ""
-"Når installasjonen er ferdig bør det sjekkes at kontoen er ordentlig "
-"beskyttet med et passord (mer informasjon finnes i README.Debian)."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
-msgstr ""
-"Skal MySQL-tilkoblinger støttes fra vertsmaskiner som kjører Debian «sarge» "
-"eller eldre?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid ""
-"The way passwords were stored was not very secure. This has been improved "
-"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
-"Sarge will not be able to connect to account which are new or whose password "
-"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
-msgstr ""
-"Passord ble tidligere lagret på en lite sikker måte. Dette er nå forbedret, "
-"med den ulempen at klienter (f.eks. PHP) fra verter som kjører Debian 3.1 Sarge "
-"ikke vil kunne koble til en konto som er ny eller har fått endret passordet. "
-"Se /usr/share/doc/mysql-server-5.0/README.Debian."
-
diff --git a/debian/po/nl.po b/debian/po/nl.po
deleted file mode 100644
index 13b3e8c02b8..00000000000
--- a/debian/po/nl.po
+++ /dev/null
@@ -1,187 +0,0 @@
-# Dutch mysql-dfsg-5.0 po-debconf translation,
-# Copyright (C) 2006 THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the mysql-dfsg-5.0 package.
-# Vincent Zweije <zweije@xs4all.nl>, 2006.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: mysql-dfsg-5.0 5.0.30-1\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2007-02-16 22:27+0100\n"
-"PO-Revision-Date: 2006-02-19 10:20+0100\n"
-"Last-Translator: Thijs Kinkhorst <thijs@debian.org>\n"
-"Language-Team: Debian-Dutch <debian-l10n-dutch@lists.debian.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid "Do you really want to downgrade?"
-msgstr "Wilt u echt een oude versie herstellen?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid ""
-"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
-"mysql-server package with a higher version has been installed before. It can "
-"not be guaranteed that this version can use its data."
-msgstr ""
-"Waarschuwing: waarschijnlijk is een hogere versie van het mysql-server "
-"pakket geïnstalleerd geweest (het bestand /var/lib/mysql/debian-*.flag "
-"bestaat). Er is geen garantie dat de gegevensbestanden, bewerkt met die "
-"hogere versie, kunnen worden gebruikt met de versie van mysql die u nu "
-"installeert."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "Important note for NIS/YP users!"
-msgstr "Belangrijke opmerking voor gebruikers van NIS/YP!"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"To use mysql you must install an equivalent user and group to the following "
-"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
-"gid may be different)."
-msgstr ""
-"Om mysql te gebruiken dient u een gebruiker en groep aan te maken, "
-"gelijkwaardig aan onderstaand voorbeeld, en u dient ervoor te zorgen dat /"
-"var/lib/mysql de bijbehorende toegangsrechten heeft (uid en gid mogen anders "
-"zijn)."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-msgstr ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/group: mysql:x:101:"
-msgstr "/etc/group: mysql:x:101:"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
-msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid "Remove the databases used by all MySQL versions?"
-msgstr "Databases verwijderen die door alle MySQL versies worden gebruikt?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid ""
-"The script is about to remove the data directory /var/lib/mysql. If it is "
-"planned to just install a higher MySQL version or if a different mysql-"
-"server package is already using it, the data should be kept."
-msgstr ""
-"Het script staat op het punt de datamap /var/lib/mysql te verwijderen. Als "
-"het plan alleen maar is om een hogere MySQL versie te installeren, of als "
-"een ander mysql-serverpakket de datamap al gebruikt, dan zou de data moeten "
-"worden behouden."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid "Should MySQL start on boot?"
-msgstr "Moet MySQL starten als de computer start?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid ""
-"The MySQL can start automatically on boot time or only if you manually type "
-"'/etc/init.d/mysql start'."
-msgstr ""
-"MySQL kan automatisch starten bij het starten van de computer, of slechts "
-"wanneer u '/etc/init.d/mysql start' handmatig uitvoert."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "New password for MySQL \"root\" user:"
-msgstr "Nieuw wachtwoord voor de MySQL \"root\"-gebruiker:"
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"It is highly recommended that you set a password for the MySQL "
-"administrative \"root\" user."
-msgstr ""
-"Het wordt sterk aangeraden een wachtwoord in te stellen voor de "
-"administratieve MySQL \"root\"-gebruiker."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"If you do not provide a password no changes will be made to the account."
-msgstr ""
-"Indien u geen wachtwoord opgeeft zal het account niet worden gewijzigd."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid "Unable to set password for MySQL \"root\" user"
-msgstr "Kan het wachtwoord voor de MySQL \"root\"-gebruiker niet instellen"
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"It seems an error occurred while setting the password for the MySQL "
-"administrative user. This may have happened because the user already has a "
-"password, or because there was a problem communicating with the MySQL server."
-msgstr ""
-"Er lijkt een fout te zijn opgetreden bij het instellen van het wachtwoord "
-"van de MySQL administratieve gebruiker. Dat kan komen doordat de gebruiker "
-"al een wachtwoord heeft, of omdat er een probleem was bij het communiceren "
-"met de MySQL server."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"When installation finishes, you should verify that the account is properly "
-"protected with a password (see README.Debian for more information)."
-msgstr ""
-"Wanneer de installatie klaar is, dient u te verifiëren dat het account "
-"netjes beschermd is met een wachtwoord (zie README.Debian voor meer "
-"informatie)."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
-msgstr ""
-"Moet u MySQL-verbindingen accepteren van computers die Debian \"sarge\" "
-"of ouder draaien?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid ""
-"The way passwords were stored was not very secure. This has been improved "
-"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
-"Sarge will not be able to connect to account which are new or whose password "
-"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
-msgstr ""
-"De wijze waarop wachtwoorden werden bewaard was niet erg veilig. Dit is "
-"verbeterd, maar helaas zullen programma's van computers die Debian 3.1 Sarge "
-"draaien, geen verbinding meer kunnen maken met accounts die nieuw zijn, of "
-"waarvan het wachtwoord is gewijzigd. Zie /usr/share/doc/mysql-server-5.0/"
-"README.Debian."
diff --git a/debian/po/pt.po b/debian/po/pt.po
deleted file mode 100644
index cb330e1932b..00000000000
--- a/debian/po/pt.po
+++ /dev/null
@@ -1,198 +0,0 @@
-# Portuguese translation for mysql-dfsg-5.0's debconf messages
-# Copyright (C) 2006 Miguel Figueiredo <elmig@debianpt.org>
-# This file is distributed under the same license as the mysql-dfsg-5.0 package.
-# Miguel Figueiredo <elmig@debianpt.org>
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: mysql-dfsg-5.0\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2007-02-16 22:27+0100\n"
-"PO-Revision-Date: 2007-02-18 10:38+0000\n"
-"Last-Translator: Miguel Figueiredo <elmig@debianpt.org>\n"
-"Language-Team: Portuguese <traduz@debianpt.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid "Do you really want to downgrade?"
-msgstr "Deseja mesmo fazer downgrade?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid ""
-"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
-"mysql-server package with a higher version has been installed before. It can "
-"not be guaranteed that this version can use its data."
-msgstr ""
-"AVISO: o ficheiro /var/lib/mysql/debian-*.flag existe. Isto significa que "
-"antes foi instalado um pacote mysql-server com número de versão superior. "
-"Não pode ser garantido que esta versão utilize esses dados."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "Important note for NIS/YP users!"
-msgstr "Nota importante para utilizadores de NIS/YP!"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"To use mysql you must install an equivalent user and group to the following "
-"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
-"gid may be different)."
-msgstr ""
-"Para utilizar mysql e instalar um utilizador e grupo equivalentes para o "
-"seguinte e assegurar-se que /var/lib/mysql têm as permissões correctas (o "
-"uid/gid podem ser diferentes)."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-msgstr ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/group: mysql:x:101:"
-msgstr "/etc/group: mysql:x:101:"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
-msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid "Remove the databases used by all MySQL versions?"
-msgstr "Remover as bases de dados utilizadas por todas as versões de MySQL?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid ""
-"The script is about to remove the data directory /var/lib/mysql. If it is "
-"planned to just install a higher MySQL version or if a different mysql-"
-"server package is already using it, the data should be kept."
-msgstr ""
-"O script está prestes a remover o directório de dados /var/lib/mysql. Se o "
-"planeado é apenas instalar uma versão superior do MySQL ou se um pacote "
-"mysql-server diferente já os estão a utilizar, os dados devem ser mantidos."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid "Should MySQL start on boot?"
-msgstr "O MySQL deve iniciar no arranque?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid ""
-"The MySQL can start automatically on boot time or only if you manually type "
-"'/etc/init.d/mysql start'."
-msgstr ""
-"O MySQL pode iniciar automaticamente no arranque ou apenas se digitar '/etc/"
-"init.d/mysql start'."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "New password for MySQL \"root\" user:"
-msgstr "Nova password para o utilizador \"root\" do MySQL:"
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"It is highly recommended that you set a password for the MySQL "
-"administrative \"root\" user."
-msgstr ""
-"É fortemente recomendado que defina uma password para o utilizador "
-"administrativo \"root\" do MySQL."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"If you do not provide a password no changes will be made to the account."
-msgstr ""
-"Se não disponibilizar uma password não serão feitas alterações nesta conta."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid "Unable to set password for MySQL \"root\" user"
-msgstr ""
-"Não foi possível definir a password para o utilizador \"root\" do MySQL"
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"It seems an error occurred while setting the password for the MySQL "
-"administrative user. This may have happened because the user already has a "
-"password, or because there was a problem communicating with the MySQL server."
-msgstr ""
-"Parece que ocorreu um erro enquanto era definida a password para o "
-"utilizador administrativo do MySQL. Isto pode ter acontecido porque o "
-"utilizador já tem uma password, ou porque ocorreu um problema ao comunicar "
-"com o servidor MySQL."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"When installation finishes, you should verify that the account is properly "
-"protected with a password (see README.Debian for more information)."
-msgstr ""
-"Quando terminar a instalação, deve verificar se a conta está devidamente "
-"protegida com uma password (para mais informações veja README.Debian)."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
-msgstr "Suportar ligações MySQL de máquinas que corram Debian \"sarge\" ou mais antigos?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid ""
-"The way passwords were stored was not very secure. This has been improved "
-"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
-"Sarge will not be able to connect to account which are new or whose password "
-"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
-msgstr ""
-"O modo como as passwords eram guardadas não era muito seguro. Isto foi "
-"melhorado com o senão que clientes (e.g. PHP) e máquinas que corram Debian "
-"3.1 Sarge não irão conseguir ligar às contas que sejam novas ou cuja "
-"password foi alterada. Veja /usr/share/doc/mysql-server-5.0/README.Debian."
-
-#~ msgid "Cannot upgrade if ISAM tables are present!"
-#~ msgstr "Não é possível actualizar se estiverem presentes tabelas ISAM!"
-
-#~ msgid ""
-#~ "Recent versions of MySQL can no longer use the old ISAM table format and "
-#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by "
-#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". "
-#~ "The installation of mysql-server-5.0 will now abort. In case your old "
-#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert "
-#~ "those tables."
-#~ msgstr ""
-#~ "As versões recentes de MySQL já não podem utilizar o antigo formato de "
-#~ "tabelas ISAM e é por isso necessário converter as suas tabelas pra e.g. "
-#~ "MyISAM antes da actualização, utilizando \"mysql_convert_table_format\" "
-#~ "ou \"ALTER TABLE x ENGINE=MyISAM\". A instalação de mysql-server-5.0 irá "
-#~ "agora ser cancelada. Se o seu antigo mysql-server-4.1 for removido apenas "
-#~ "reinstale para converter essas tabelas."
diff --git a/debian/po/pt_BR.po b/debian/po/pt_BR.po
deleted file mode 100644
index 51557b006e6..00000000000
--- a/debian/po/pt_BR.po
+++ /dev/null
@@ -1,339 +0,0 @@
-# Brazilian Portuguese (pt_BR) debconf template translation for
-# Debian's mysql-dfsg source package.
-# Debian-BR Project <debian-l10n-portuguese@lists.debian.org>
-# André Luís Lopes, <andrelop@debian.org> , 2004
-# André Luís Lopes, <andrelop@debian.org> , 2006
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: mysql-dfsg-5.0\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2007-02-16 22:27+0100\n"
-"PO-Revision-Date: 2006-12-19 20:32-0200\n"
-"Last-Translator: André Luís Lopes <andrelop@debian.org>\n"
-"Language-Team: Debian-BR Project <debian-l10n-portuguese@lists.debian.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid "Do you really want to downgrade?"
-msgstr "Você realmente quer atualizar?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid ""
-"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
-"mysql-server package with a higher version has been installed before. It can "
-"not be guaranteed that this version can use its data."
-msgstr ""
-"AVISO: O arquivo /var/lib/mysql/debian-*.flag existe. Isso indica que um "
-"pacote mysql-server com uma versão maior foi instalado antes. Não há como "
-"garantir que esta versão poderá usar seus dados."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "Important note for NIS/YP users!"
-msgstr "Aviso importante para usuários NIS/YP!"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"To use mysql you must install an equivalent user and group to the following "
-"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
-"gid may be different)."
-msgstr ""
-"Para utilizar o MySQL, você deve instalar um usuário e um grupo equivalentes "
-"ao usuário e grupo a seguir para se certificar de que o diretório /var/lib/"
-"mysql possua as permissões correctas (o uid/gid podem ser diferentes)."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-msgstr ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/group: mysql:x:101:"
-msgstr "/etc/group: mysql:x:101:"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
-msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid "Remove the databases used by all MySQL versions?"
-msgstr "Remover as bases de dados utilizadas por todas as versões do MySQL?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid ""
-"The script is about to remove the data directory /var/lib/mysql. If it is "
-"planned to just install a higher MySQL version or if a different mysql-"
-"server package is already using it, the data should be kept."
-msgstr ""
-"O script está prestes a remover o diretório de dados /var/lib/mysql. Caso "
-"seja planejado somente instalar uma versão mais nova do MySQL ou caso um "
-"pacote mysql-server diferente já os esteja usando, os dados devem ser "
-"mantidos."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid "Should MySQL start on boot?"
-msgstr "O MySQL deve ser iniciado na inicialização da máquina?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid ""
-"The MySQL can start automatically on boot time or only if you manually type "
-"'/etc/init.d/mysql start'."
-msgstr ""
-"O MySQL pode ser iniciado automaticamente na inicialização da máquina ou "
-"apenas caso você use o comando '/etc/init.d/mysql start' manualmente."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "New password for MySQL \"root\" user:"
-msgstr "Nova senha para o usuário \"root\" do MySQL:"
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"It is highly recommended that you set a password for the MySQL "
-"administrative \"root\" user."
-msgstr ""
-"É altamente recomendado que você defina uma senha para o usuário "
-"administrativo \"root\" do MySQL."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"If you do not provide a password no changes will be made to the account."
-msgstr "Caso você não forneça uma senha, nenhuma mudança será feita na conta."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid "Unable to set password for MySQL \"root\" user"
-msgstr "Impossível definir senha para o usuário \"root\" do MySQL"
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"It seems an error occurred while setting the password for the MySQL "
-"administrative user. This may have happened because the user already has a "
-"password, or because there was a problem communicating with the MySQL server."
-msgstr ""
-"Parece que um erro cocrreu durante a definição da senha para o usuário "
-"administrativo do MySQL. Isso pode ter acontecido devido ao usuário já "
-"possuir uma senha definida ou devido a ocorrência de um problema de "
-"comunicação com o servidor MySQL."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"When installation finishes, you should verify that the account is properly "
-"protected with a password (see README.Debian for more information)."
-msgstr ""
-"Quando a instalação finalizar, você deverá verificar se a conta está "
-"apropriadamente protegida com uma senha (consulte o arquivo README.Debian "
-"para maiores informações)."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
-msgstr ""
-"Suportar conexões MySQL originadas de hosts executando o Debian \"sarge\" "
-"ou mais antigos ?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid ""
-"The way passwords were stored was not very secure. This has been improved "
-"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
-"Sarge will not be able to connect to account which are new or whose password "
-"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
-msgstr ""
-"A maneira com que as senhas eram armazenadas não era muito segura. Isso foi "
-"melhorado, mas com o incômodo de que clientes (por exemplo, o PHP) em hosts "
-"executando o Debian 3.1 (Sarge) não serão capazes de conectar em contas "
-"novas ou para as quais as senhas tenham sido modificadas. Consulte /usr/"
-"share/doc/mysql-server-5.0/README.Debian."
-
-#~ msgid "internal"
-#~ msgstr "interno"
-
-#~ msgid "Only internally used."
-#~ msgstr "Somente utilizado internamente."
-
-#, fuzzy
-#~ msgid "Update Hints"
-#~ msgstr "Dicas de atualização"
-
-#, fuzzy
-#~ msgid ""
-#~ "Rarely, e.g. on new major versions, the privilege system is improved. To "
-#~ "make use of it mysql_fix_privilege_tables must be executed manually. The "
-#~ "script is not supposed to give any user more rights that he had before,"
-#~ msgstr ""
-#~ "Raramente, por exemplo, em novas versões maiores, o sistema de "
-#~ "privilégios é melhorado. Para fazer uso disso, o script "
-#~ "mysql_fix_privilege_tables deve ser executado manualmente. O script não "
-#~ "atribuirá a nenhum usuário mais direitos do que os mesmos já possuíam "
-#~ "anteriormente."
-
-#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html"
-#~ msgstr "Por favor, leia http://www.mysql.com/doc/en/Upgrade.html"
-
-#, fuzzy
-#~ msgid "Install Hints"
-#~ msgstr "Dicas de instalação"
-
-#, fuzzy
-#~ msgid ""
-#~ "MySQL will only install if you have a non-numeric hostname that is "
-#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command "
-#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 "
-#~ "myhostname\"."
-#~ msgstr ""
-#~ "O MySQL será instalado somente caso você possua um nome de host NÃO "
-#~ "NUMÉRICO que possa ser resolvido através do arquivo /etc/hosts, ou seja, "
-#~ "caso o comando \"hostname\" retorne \"myhostname\", uma linha como "
-#~ "\"10.0.0.1 myhostname\" deverá existir no arquivo /etc/hosts."
-
-#~ msgid ""
-#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account "
-#~ "is used in the start/stop and cron scripts. Don't delete."
-#~ msgstr ""
-#~ "Um novo usuário MySQL de nome \"debian-sys-maint\" será criado. Essa "
-#~ "conta MySQL é utilizada pelos scripts de inicialização/parada e pelos "
-#~ "scripts cron. Não remova esse usuário."
-
-#, fuzzy
-#~ msgid ""
-#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /"
-#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in "
-#~ "there, never only the password!"
-#~ msgstr ""
-#~ "Por favor, lembre-se de definir uma SENHA para o usuário root do MySQL ! "
-#~ "Caso você utilize um arquivo /root/.my.cnf, sempre inclua as linhas \"user"
-#~ "\" e \"password\" nesse arquivo, nunca somente a senha ! Consulte o "
-#~ "arquivo /usr/share/doc/mysql-server/README.Debian para mais informações."
-
-#~ msgid "Remove all databases?"
-#~ msgstr "Remover todas as bases de dados ?"
-
-#~ msgid ""
-#~ "Should I remove all databases below /var/lib/mysql as you are purging the "
-#~ "mysql-server package?"
-#~ msgstr ""
-#~ "Todas as base de dados sob o diretório /var/lib/mysql devem ser removidas "
-#~ "quando você remover o pacote pacote mysql-server ?"
-
-#~ msgid ""
-#~ "Networking is disabled by default for security reasons. You can enable it "
-#~ "by commenting out the skip-networking option in /etc/mysql/my.cnf."
-#~ msgstr ""
-#~ "O suporte ao funcionamento em rede está desativado por padrão por "
-#~ "questões de segurança. Você poderá ativá-lo comentando a opção 'skip-"
-#~ "networking' no arquivo /etc/mysql/my.cnf."
-
-#~ msgid "security and update notice"
-#~ msgstr "aviso de segurança e actualização"
-
-#~ msgid ""
-#~ "Should I remove everything below /var/lib/mysql when you purge the mysql-"
-#~ "server package with the \"dpkg --purge mysql-server\" command (i.e. "
-#~ "remove everything including the configuration) somewhen? (default is not)"
-#~ msgstr ""
-#~ "Devo remover tudo abaixo de /var/lib/mysql quando fizer o purge do pacote "
-#~ "mysql-server com o comando \"dpkg --purge mysql-server\" (ou seja, "
-#~ "remover tudo incluíndo a configuração)? (o padrão é não remover)"
-
-#~ msgid "Make MySQL reachable via network?"
-#~ msgstr "Fazer com que o MySQL seja acessível via rede?"
-
-#~ msgid ""
-#~ "Should MySQL listen on a network reachable TCP port? This is not "
-#~ "necessary for use on a single computer and could be a security problem."
-#~ msgstr ""
-#~ "O MySQL deve aguardar ligações numa porta TCP acessível via rede? Isto "
-#~ "não é necessário para uso num único computador e pode ser um problema de "
-#~ "segurança."
-
-#~ msgid "Enable chroot mode?"
-#~ msgstr "Activar o modo chroot?"
-
-#~ msgid ""
-#~ "MySQL is able to jail itself into the /var/lib/mysql_jail directory so "
-#~ "that users cannot modify any files outside this directory. This improves "
-#~ "resistence against crackers, too, as they are not able to modify system "
-#~ "files."
-#~ msgstr ""
-#~ "O MySQL é capaz de se prender no diretório /var/lib/mysql_jail, assim os "
-#~ "utilizadores não poderão modificar ficheiros fora deste directório. Isto "
-#~ "aumenta também a resistência contra crackers, pois eles não poderão "
-#~ "modificar arquivos de sistema."
-
-#~ msgid "Please run mysql_fix_privilege_tables !"
-#~ msgstr "Por favor execute mysql_fix_privilege_tables !"
-
-#~ msgid ""
-#~ "I will ensure secure permissions of /var/lib/mysql by replacing GIDs "
-#~ "other than root and mysql with mysql."
-#~ msgstr ""
-#~ "Permissões seguras para o diretório /var/lib/mysql serão asseguradas "
-#~ "substituíndo GIDs diferentes de root e mysql por mysql."
-
-#~ msgid ""
-#~ "Instructions how to enable SSL support are in /usr/share/doc/mysql-server/"
-#~ msgstr ""
-#~ "Instruções sobre como activar o suporte de SSL estão disponíveis no "
-#~ "directório /usr/share/doc/mysql-server/."
-
-#, fuzzy
-#~ msgid "mysql_fix_privileges_tables should be executed"
-#~ msgstr "mysql_fix_privileges_tables será executado"
-
-#, fuzzy
-#~ msgid ""
-#~ "The latest MySQL versions have an enhanced, more fine grained, privilege "
-#~ "system. To make use of it, some new fields must be added to the tables "
-#~ "in the \"mysql\" database. This will not happen automatically."
-#~ msgstr ""
-#~ "As últimas versões do MySQL possuem um sistema de privilégios melhorado e "
-#~ "mais refinado. Para utilizá-lo, alguns novos campos devem ser adicionados "
-#~ "as tabelas na base de dados \"mysql\". Isto é feito pelo script "
-#~ "mysql_fix_privileges_tables durante esta actualização independente do "
-#~ "servidor estar a correr ou não !"
-
-#~ msgid ""
-#~ "This script is not supposed to give any user more rights that he had "
-#~ "before, if you encounter such a case, please contact me."
-#~ msgstr ""
-#~ "Este script não deverá fornecer mais direitos a um utilizador além dos "
-#~ "quais ele já possua anteriormente. SE encontrar um caso desses, por favor "
-#~ "entre em contacto com o mantainer deste pacote Debian."
diff --git a/debian/po/ro.po b/debian/po/ro.po
deleted file mode 100644
index f344ab5eca0..00000000000
--- a/debian/po/ro.po
+++ /dev/null
@@ -1,193 +0,0 @@
-# Romanian translation of mysql-dfsg.
-# Copyright (C) 2006 THE mysql-dfsg'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the mysql-dfsg package.
-#
-# Stan Ioan-Eugen <stan.ieugen@gmail.com>, 2006.
-msgid ""
-msgstr ""
-"Project-Id-Version: po-debconf://mysql-dfsg\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2007-02-16 22:27+0100\n"
-"PO-Revision-Date: 2006-12-20 21:27+0200\n"
-"Last-Translator: stan ioan-eugen <stan.ieugen@gmail.com>\n"
-"Language-Team: romanian <debian-l10n-romanian@lists.debian.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: KBabel 1.11.4\n"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid "Do you really want to downgrade?"
-msgstr "Sunteţi sigur că doriţi să instalaţi o versiune mai veche?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid ""
-"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
-"mysql-server package with a higher version has been installed before. It can "
-"not be guaranteed that this version can use its data."
-msgstr ""
-"AVERTISMENT: Fişierul /var/lib/mysql/debian-*.flag există. Acest lucru "
-"indică faptul că anterior a fost instalată o versiune nouă a pachetului "
-"mysql-server. Nu se poate garanta că versiunea instalată acum poate folosi "
-"datele versiunii instalate anterior."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "Important note for NIS/YP users!"
-msgstr "Notă importantă pentru utilizatorii NIS/YP!"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"To use mysql you must install an equivalent user and group to the following "
-"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
-"gid may be different)."
-msgstr ""
-"Pentru a folosi mysql trebuie să adăugaţi un utilizator şi grup echivalent "
-"şi să vă asiguraţi că /var/lib/mysql are permisiunile stabilite corect (uid/"
-"gid pot aveavalori diferite)."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-msgstr "/etc/passwd:\tmysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/group: mysql:x:101:"
-msgstr "/etc/group:\tmysql:x:101:"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
-msgstr "/var/lib/mysql:\tdrwxr-xr-x\tmysql\tmysql"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid "Remove the databases used by all MySQL versions?"
-msgstr "Doriţi să ştergeţi bazele de date folosite de toate versiune MySQL?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid ""
-"The script is about to remove the data directory /var/lib/mysql. If it is "
-"planned to just install a higher MySQL version or if a different mysql-"
-"server package is already using it, the data should be kept."
-msgstr ""
-"Scriptul urmează să şteargă directorul de date /var/lib/mysql. Dacă plănuiţi "
-"doar să instalaţi o versiune nouă MySQL sau datele sunt folosite de către un "
-"alt pachet mysql-server, atunci ar trebui păstraţi datele."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid "Should MySQL start on boot?"
-msgstr "Doriţi ca MySQL să pornească la initializarea sistemului?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid ""
-"The MySQL can start automatically on boot time or only if you manually type "
-"'/etc/init.d/mysql start'."
-msgstr ""
-"MySQL poate porni automat la iniţializarea sistemului sau doar dacă rulaţi "
-"comanda „/etc/init.d/mysql startâ€."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "New password for MySQL \"root\" user:"
-msgstr "Noua parolă pentru utilizatorul „root†al MySQL:"
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"It is highly recommended that you set a password for the MySQL "
-"administrative \"root\" user."
-msgstr "Este recomandat să stabiliţi o parolă pentru utilizatorul administrativ „root†al MySQL."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"If you do not provide a password no changes will be made to the account."
-msgstr "Dacă nu introduceţi nici o parolă, nici o schimbare nu va fi luată în considerare."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid "Unable to set password for MySQL \"root\" user"
-msgstr "Nu s-a putut stabili parola pentru utilizatorul „root†al MySQL"
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"It seems an error occurred while setting the password for the MySQL "
-"administrative user. This may have happened because the user already has a "
-"password, or because there was a problem communicating with the MySQL server."
-msgstr "Se pare că a intervenit o eroare în stabilirea parolei pentru utilizatorul administrativ "
-"al MySQL. Acest lucru se poate întâmpla dacă utilizatorul are deja o parolă, sau a existat o "
-"problemă în comunicarea cu serverul MySQL."
-
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"When installation finishes, you should verify that the account is properly "
-"protected with a password (see README.Debian for more information)."
-msgstr "După finalizarea instalării, ar trebui să verificaţi dacă contul este protejat"
-" cu o parolă (citiţi fişierul README.Debian pentru informaţii suplimentare)."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
-msgstr "Suportaţi conexiuni MySQL de la staţii ce rulează sistemul Debian „sarge†sau mai vechi?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid ""
-"The way passwords were stored was not very secure. This has been improved "
-"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
-"Sarge will not be able to connect to account which are new or whose password "
-"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
-msgstr "Modul în care erau păstrate parolele nu era foarte sigur. Acest lucru a fost îmbunătăţit"
-"cu dezajantajul că clienţii (de ex. PHP) de pe staţii ce rulează sistemul Debian 3.1 Sarge"
-"nu se vor putea conecta la conturi noi sau ale căror parole au fost schimbate. Citiţi "
-"/usr/share/doc/mysql-server-5.0/README.Debian."
-
-#~ msgid "Cannot upgrade if ISAM tables are present!"
-#~ msgstr "Nu se poate face actualizarea dacă sunt prezente tabele ISAM!"
-
-#~ msgid ""
-#~ "Recent versions of MySQL can no longer use the old ISAM table format and "
-#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by "
-#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". "
-#~ "The installation of mysql-server-5.0 will now abort. In case your old "
-#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert "
-#~ "those tables."
-#~ msgstr ""
-#~ "Versiunile recente MySQL nu mai pot folosi vechiul format de tabele ISAM "
-#~ "şieste necesar să convertiţi tabelele dumneavoastră de ex. la formatul "
-#~ "MyISAM înainte de a face actualizarea folosind comanda "
-#~ "„mysql_convert_table_format†sau „ALTER TABLE x ENGINE=MyISAMâ€. "
-#~ "Instalarea mysql-server-5.0 va eşua. În caz că ştergeţiversiunea "
-#~ "anterioară mysql-server-4.1 va trebui reinstalată pentru a converti "
-#~ "tabelele."
diff --git a/debian/po/ru.po b/debian/po/ru.po
deleted file mode 100644
index 1ab02e4437c..00000000000
--- a/debian/po/ru.po
+++ /dev/null
@@ -1,172 +0,0 @@
-# translation of mysql-dfsg-5.0_5.0.32-6_ru.po to Russian
-# Russian messages:
-# Translators, if you are not familiar with the PO format, gettext
-# documentation is worth reading, especially sections dedicated to
-# this format, e.g. by running:
-# info -n '(gettext)PO Files'
-# info -n '(gettext)Header Entry'#
-# Some information specific to po-debconf are available at
-# /usr/share/doc/po-debconf/README-trans
-# or http://www.debian.org/intl/l10n/po-debconf/README-trans#
-# Developers do not need to manually edit POT or PO files.
-# Ilgiz Kalmetev <translator@ilgiz.pp.ru>, 2003.
-# Yuriy Talakan' <yt@amur.elektra.ru>, 2005, 2006.
-# Yuriy Talakan' <yt@drsk.ru>, 2007.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: mysql-dfsg-5.0_5.0.32-6_ru\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2007-02-16 22:27+0100\n"
-"PO-Revision-Date: 2007-02-19 11:28+0900\n"
-"Last-Translator: Yuriy Talakan' <yt@drsk.ru>\n"
-"Language-Team: Russian <debian-l10n-russian@lists.debian.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: KBabel 1.9.1\n"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid "Do you really want to downgrade?"
-msgstr "Ð’Ñ‹ дейÑтвительно желаете понизить верÑию?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid ""
-"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
-"mysql-server package with a higher version has been installed before. It can "
-"not be guaranteed that this version can use its data."
-msgstr ""
-"Ð’ÐИМÐÐИЕ: Ðайден файл /var/lib/mysql/debian-*.flag. Это означает, что ранее "
-"был уÑтановлен пакет mysql-server более выÑокой верÑии. Ðевозможно "
-"гарантировать, что Ñ‚ÐµÐºÑƒÑ‰Ð°Ñ Ð²ÐµÑ€ÑÐ¸Ñ Ñможет иÑпользовать его данные."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "Important note for NIS/YP users!"
-msgstr "Важное замечание Ð´Ð»Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»ÐµÐ¹ NIS/YP!"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"To use mysql you must install an equivalent user and group to the following "
-"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
-"gid may be different)."
-msgstr ""
-"Чтобы иÑпользовать mysql, Ð’Ñ‹ должны уÑтановить Ñквивалентные Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ Ð¸ "
-"группу, как указано ниже и убедитьÑÑ, что /var/lib/mysql имеет правильные "
-"права (uid/gid могут отличатьÑÑ)."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-msgstr "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/group: mysql:x:101:"
-msgstr "/etc/group: mysql:x:101:"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
-msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid "Remove the databases used by all MySQL versions?"
-msgstr "Удалить базы данных, иÑпользуемые вÑеми верÑиÑми MySQL?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid ""
-"The script is about to remove the data directory /var/lib/mysql. If it is "
-"planned to just install a higher MySQL version or if a different mysql-"
-"server package is already using it, the data should be kept."
-msgstr "Сценарий ÑобираетÑÑ ÑƒÐ´Ð°Ð»Ð¸Ñ‚ÑŒ директорию данных /var/lib/mysql. ЕÑли планируетÑÑ ÑƒÑтановить новую верÑию MySQL или еÑÑ‚ÑŒ другие пакеты mysql-server, иÑпользующие Ñту директорию, то данные надо Ñохранить."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid "Should MySQL start on boot?"
-msgstr "ЗапуÑкать MySQL при загрузке ÑиÑтемы?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid ""
-"The MySQL can start automatically on boot time or only if you manually type "
-"'/etc/init.d/mysql start'."
-msgstr ""
-"MySQL может запуÑкатьÑÑ Ð¿Ñ€Ð¸ загрузке ÑиÑтемы, либо только еÑли вы вручную "
-"введете команду '/etc/init.d/mysql start'. "
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "New password for MySQL \"root\" user:"
-msgstr "Ðовый пароль Ð´Ð»Ñ MySQL Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ \"root\":"
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"It is highly recommended that you set a password for the MySQL "
-"administrative \"root\" user."
-msgstr "Крайне рекомендуетÑÑ ÑƒÑтановить пароль Ð´Ð»Ñ Ð°Ð´Ð¼Ð¸Ð½Ð¸Ñтративного MySQL Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ \"root\"."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "If you do not provide a password no changes will be made to the account."
-msgstr "ЕÑли вы не зададите пароль, то ÑƒÑ‡ÐµÑ‚Ð½Ð°Ñ Ð·Ð°Ð¿Ð¸ÑÑŒ не будет изменена."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid "Unable to set password for MySQL \"root\" user"
-msgstr "Ðевозможно задать пароль MySQL пользователю \"root\""
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"It seems an error occurred while setting the password for the MySQL "
-"administrative user. This may have happened because the user already has a "
-"password, or because there was a problem communicating with the MySQL server."
-msgstr "Ð’ процеÑÑе Ð·Ð°Ð´Ð°Ð½Ð¸Ñ Ð¿Ð°Ñ€Ð¾Ð»Ñ Ð°Ð´Ð¼Ð¸Ð½Ð¸Ñтративного MySQL Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ Ð¿Ñ€Ð¾Ð¸Ð·Ð¾ÑˆÐ»Ð° ошибка. Это могло произойти еÑли у Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ ÑƒÐ¶Ðµ был задан пароль, или из-за проблем ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ñ Ñервером MySQL."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"When installation finishes, you should verify that the account is properly "
-"protected with a password (see README.Debian for more information)."
-msgstr "Когда уÑтановка завершитÑÑ, вы должны убедитьÑÑ, что ÑƒÑ‡ÐµÑ‚Ð½Ð°Ñ Ð·Ð°Ð¿Ð¸ÑÑŒ защищена паролем (подробную информацию Ñм. в README.Debian)."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
-msgstr "Ðужна поддержка подключений к MySQL Ñ Ð¼Ð°ÑˆÐ¸Ð½, работающих под Debian \"sarge\" или Ñтарше?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid ""
-"The way passwords were stored was not very secure. This has been improved "
-"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
-"Sarge will not be able to connect to account which are new or whose password "
-"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
-msgstr "Метод Ñ…Ñ€Ð°Ð½ÐµÐ½Ð¸Ñ Ð¿Ð°Ñ€Ð¾Ð»Ñ Ð±Ñ‹Ð» не очень безопаÑен. Это было Ñделано из-за того, клиенты (например, PHP) Ñ Ð¼Ð°ÑˆÐ¸Ð½, работающих под Debian 3.1 Sarge не Ñмогут подключитьÑÑ Ðº учетной запиÑи еÑли она новаÑ, или пароль был изменен. См. /usr/share/doc/mysql-server-5.0/README.Debian."
-
diff --git a/debian/po/sv.po b/debian/po/sv.po
deleted file mode 100644
index 54ef9246236..00000000000
--- a/debian/po/sv.po
+++ /dev/null
@@ -1,225 +0,0 @@
-# Translators, if you are not familiar with the PO format, gettext
-# documentation is worth reading, especially sections dedicated to
-# this format, e.g. by running:
-# info -n '(gettext)PO Files'
-# info -n '(gettext)Header Entry'
-# Some information specific to po-debconf are available at
-# /usr/share/doc/po-debconf/README-trans
-# or http://www.debian.org/intl/l10n/po-debconf/README-trans
-# Developers do not need to manually edit POT or PO files.
-# , fuzzy
-#
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: mysql-dfsg-5.0 5.0.21-3\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2007-02-16 22:27+0100\n"
-"PO-Revision-Date: 2007-02-18 14:48+0100\n"
-"Last-Translator: Andreas Henriksson <andreas@fatal.se>\n"
-"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Poedit-Language: Swedish\n"
-"X-Poedit-Country: SWEDEN\n"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid "Do you really want to downgrade?"
-msgstr "Vill du verkligen nedgradera?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid "WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a mysql-server package with a higher version has been installed before. It can not be guaranteed that this version can use its data."
-msgstr "VARNING: Filen /var/lib/mysql/debian-*.flag existerar. Detta betyder att paketet mysql-server med högre versionsnummer har installerats tidigare. Det kan inte garanteras att denna version kan använda dess data."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "Important note for NIS/YP users!"
-msgstr "Viktig notering för NIS/YP-användare!"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "To use mysql you must install an equivalent user and group to the following and ensure yourself that /var/lib/mysql has the right permissions (the uid/gid may be different)."
-msgstr "För att använda MySQL måste du installera en motsvarande användare och grupp till följande och se till att /var/lib/mysql har korrekta rättigheter satta (uid/gid kan vara olika)."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-msgstr "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/group: mysql:x:101:"
-msgstr "/etc/group: mysql:x:101:"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
-msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid "Remove the databases used by all MySQL versions?"
-msgstr "Ta bort databaserna som används av alla MySQL-versioner?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid "The script is about to remove the data directory /var/lib/mysql. If it is planned to just install a higher MySQL version or if a different mysql-server package is already using it, the data should be kept."
-msgstr "Scriptet kommer strax ta bort data-katalogen /var/lib/mysql. Om det planerade var att bara installera en högre MySQL-version eller om ett annan mysql-server paket redan använde det, skall datan sparas."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid "Should MySQL start on boot?"
-msgstr "Ska MySQL startas när systemet startar upp?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid "The MySQL can start automatically on boot time or only if you manually type '/etc/init.d/mysql start'."
-msgstr "MySQL kan startas när systemet startas upp eller endast om du manuellt skriver '/etc/init.d/mysql start'."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "New password for MySQL \"root\" user:"
-msgstr "Nytt lösenord för MySQLs \"root\"-användare:"
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "It is highly recommended that you set a password for the MySQL administrative \"root\" user."
-msgstr "Det är starkt rekommenderat att du sätter ett lösenord för MySQLs administrativa \"root\"-användare."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "If you do not provide a password no changes will be made to the account."
-msgstr "Om du inte anger ett lösenord kommer inga ändringar att göras för kontot."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid "Unable to set password for MySQL \"root\" user"
-msgstr "Lyckades inte sätta lösenord för MySQLs \"root\"-användare"
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid "It seems an error occurred while setting the password for the MySQL administrative user. This may have happened because the user already has a password, or because there was a problem communicating with the MySQL server."
-msgstr "Det verkar som ett fel uppstod när det skulle sättas ett lösenord för MySQLs administrativa användare. Detta kan ha skett för att användaren redan har ett lösenord satt, eller på grund av problem med att kommunicera med MySQL-servern."
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid "When installation finishes, you should verify that the account is properly protected with a password (see README.Debian for more information)."
-msgstr "När installationen är klar, bör du kontrollera så att kontot är riktigt skyddat av ett lösenord (läs README.Debian för mer information)."
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
-msgstr "Behöver du MySQL-anslutningar från system som kör Debian \"Sarge\" eller äldre?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid "The way passwords were stored was not very secure. This has been improved with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 Sarge will not be able to connect to account which are new or whose password have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
-msgstr "Sättet som lösenorden lagrades på var inte särskilt säkert. Detta har förbättrats på bekostnad av att klienter (t.ex. PHP) från system som kör Debian 3.1 Sarge inte kan ansluta till konton som är nya eller vars lösenord har ändrats. Se /usr/share/doc/mysql-server-5.0/README.Debian."
-
-#~ msgid "Cannot upgrade if ISAM tables are present!"
-#~ msgstr "Kan inte uppgradera om ISAM-tabeller finns!"
-#~ msgid ""
-#~ "Recent versions of MySQL can no longer use the old ISAM table format and "
-#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by "
-#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". "
-#~ "The installation of mysql-server-5.0 will now abort. In case your old "
-#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert "
-#~ "those tables."
-#~ msgstr ""
-#~ "Senaste versionerna av MySQL kan inte längre använda gamla ISAM-"
-#~ "tabellformatet och det är nödvändigt att konvertera dina tabeller till "
-#~ "exempelvis MyISAM före uppgradering med \"mysql_convert_table_format\" "
-#~ "eller \"ALTER TABLE x ENGINE=MyISAM\". Installationen av mysql-server-5.0 "
-#~ "kommer nu att avbrytas. Om ditt gamla mysql-server-4.1-paket tas bort är "
-#~ "det bara att installera om det för att konvertera de tabellerna."
-#~ msgid "Update Hints"
-#~ msgstr "Uppdateringstips"
-#~ msgid ""
-#~ "You have to run \"mysql_upgrade\" after the upgrade, else tables can be "
-#~ "corrupted! This script also enhances the privilege tables but is not "
-#~ "supposed to give any user more rights that he had before,"
-#~ msgstr ""
-#~ "Du måste köra \"mysql_upgrade\" efter uppgraderingen, annars kan "
-#~ "tabellerna vara skadade! Detta skript utökar även privilegietabellerna "
-#~ "men är inte tänkte att ge någon användare mer befogenhet än vad han hade "
-#~ "tidigare,"
-#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html"
-#~ msgstr "Läs även http://www.mysql.com/doc/en/Upgrade.html"
-#~ msgid "Install Hints"
-#~ msgstr "Installationstips"
-#~ msgid ""
-#~ "On upgrades from MySQL 3.23, as shipped with Debian Woody, symlinks in "
-#~ "place of /var/lib/mysql or /var/log/mysql gets accidently removed and "
-#~ "have manually be restored."
-#~ msgstr ""
-#~ "Vid uppgraderingar från MySQL 3.23 som skickades med Debian Woody har "
-#~ "symboliska länkar i /var/lib/mysql eller /var/log/mysql av misstag tagits "
-#~ "bort och måste manuellt återskapas."
-#~ msgid ""
-#~ "MySQL will only install if you have a non-numeric hostname that is "
-#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command "
-#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 "
-#~ "myhostname\"."
-#~ msgstr ""
-#~ "MySQL kan endast installeras om du har ett icke-numeriskt värdnamn som "
-#~ "kan slås upp via filen /etc/hosts. Exempelvis om kommandot \"hostname\" "
-#~ "returnerar \"mittnamn\" så bör det finnas en rad som liknar \"10.0.0.1 "
-#~ "mittnamn\"."
-#~ msgid ""
-#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account "
-#~ "is used in the start/stop and cron scripts. Don't delete."
-#~ msgstr ""
-#~ "En ny MySQL-användare kallad \"debian-sys-maint\" kommer att skapas. "
-#~ "Detta MySQL-konto används för start/stopp och cron-skript. Ta inte bort "
-#~ "det."
-#~ msgid ""
-#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /"
-#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in "
-#~ "there, never only the password!"
-#~ msgstr ""
-#~ "Tänk på att sätta ett LÖSENORD för MySQL:s root-användare! Om du "
-#~ "använder /root/.my.cnf, skriv då alltid en \"user\"-rad och en \"password"
-#~ "\"-rad i den, aldrig med endast lösenordet!"
-#~ msgid ""
-#~ "See /usr/share/doc/mysql-server-5.0/README.Debian for more information."
-#~ msgstr ""
-#~ "Se /usr/share/doc/mysql-server-5.0/README.Debian för mer information."
-#~ msgid ""
-#~ "Should I remove the complete /var/lib/mysql directory tree which is used "
-#~ "by all MySQL versions, not necessarily only the one you are about to "
-#~ "purge?"
-#~ msgstr ""
-#~ "Ska jag ta bort hela katalogträdet i /var/lib/mysql som används av alla "
-#~ "MySQL-versioner och inte bara för den som du nu kommer att rensa ut?"
-#~ msgid ""
-#~ "Rarely, e.g. on new major versions, the privilege system is improved. To "
-#~ "make use of it mysql_fix_privilege_tables must be executed manually. The "
-#~ "script is not supposed to give any user more rights that he had before,"
-#~ msgstr ""
-#~ "Sällan, exempelvis i nya större versioner, har behörighetssystemet "
-#~ "förbättrats. För att använda det måste skriptet "
-#~ "mysql_fix_privilege_tables köras manuellt. Skriptet är inte tänkt att ge "
-#~ "någon användare högre behörighet än han hade tidigare."
-
diff --git a/debian/po/templates.pot b/debian/po/templates.pot
deleted file mode 100644
index e4ec4e95ca5..00000000000
--- a/debian/po/templates.pot
+++ /dev/null
@@ -1,155 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2007-02-16 22:27+0100\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid "Do you really want to downgrade?"
-msgstr ""
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid ""
-"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
-"mysql-server package with a higher version has been installed before. It can "
-"not be guaranteed that this version can use its data."
-msgstr ""
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "Important note for NIS/YP users!"
-msgstr ""
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"To use mysql you must install an equivalent user and group to the following "
-"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
-"gid may be different)."
-msgstr ""
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-msgstr ""
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/group: mysql:x:101:"
-msgstr ""
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
-msgstr ""
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid "Remove the databases used by all MySQL versions?"
-msgstr ""
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid ""
-"The script is about to remove the data directory /var/lib/mysql. If it is "
-"planned to just install a higher MySQL version or if a different mysql-"
-"server package is already using it, the data should be kept."
-msgstr ""
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid "Should MySQL start on boot?"
-msgstr ""
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid ""
-"The MySQL can start automatically on boot time or only if you manually type "
-"'/etc/init.d/mysql start'."
-msgstr ""
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "New password for MySQL \"root\" user:"
-msgstr ""
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"It is highly recommended that you set a password for the MySQL "
-"administrative \"root\" user."
-msgstr ""
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"If you do not provide a password no changes will be made to the account."
-msgstr ""
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid "Unable to set password for MySQL \"root\" user"
-msgstr ""
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"It seems an error occurred while setting the password for the MySQL "
-"administrative user. This may have happened because the user already has a "
-"password, or because there was a problem communicating with the MySQL server."
-msgstr ""
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"When installation finishes, you should verify that the account is properly "
-"protected with a password (see README.Debian for more information)."
-msgstr ""
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
-msgstr ""
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid ""
-"The way passwords were stored was not very secure. This has been improved "
-"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
-"Sarge will not be able to connect to account which are new or whose password "
-"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
-msgstr ""
diff --git a/debian/po/tr.po b/debian/po/tr.po
deleted file mode 100644
index 20b4df45b6e..00000000000
--- a/debian/po/tr.po
+++ /dev/null
@@ -1,290 +0,0 @@
-# Turkish translation of mysql-server.
-# This file is distributed under the same license as the mysql-server package.
-# Gürkan Aslan <gurkan@iaslan.com>, 2004
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: mysql-dfsg-4.1\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2007-02-16 22:27+0100\n"
-"PO-Revision-Date: 2004-06-05 08:53+0300\n"
-"Last-Translator: Gürkan Aslan <gurkan@iaslan.com>\n"
-"Language-Team: Turkish <debian-l10n-turkish@lists.debian.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=1; plural=0;\n"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid "Do you really want to downgrade?"
-msgstr ""
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:1001
-msgid ""
-"WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates that a "
-"mysql-server package with a higher version has been installed before. It can "
-"not be guaranteed that this version can use its data."
-msgstr ""
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "Important note for NIS/YP users!"
-msgstr "NIS/YP kullanıcıları için önemli not!"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"To use mysql you must install an equivalent user and group to the following "
-"and ensure yourself that /var/lib/mysql has the right permissions (the uid/"
-"gid may be different)."
-msgstr ""
-"Mysql'i kullanmak için aşağıdakiyle eşdeğer bir kullanıcı ve grup "
-"tanımlamalı, ve /var/lib/mysql izinlerinin uygun şekilde ayarlandığından "
-"emin olmalısınız (uid/gid farklı olabilir)."
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-msgstr ""
-"/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/etc/group: mysql:x:101:"
-msgstr "/etc/group: mysql:x:101:"
-
-#. Type: note
-#. Description
-#: ../mysql-server-5.0.templates:2001
-msgid "/var/lib/mysql: drwxr-xr-x mysql mysql"
-msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid "Remove the databases used by all MySQL versions?"
-msgstr ""
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:3001
-msgid ""
-"The script is about to remove the data directory /var/lib/mysql. If it is "
-"planned to just install a higher MySQL version or if a different mysql-"
-"server package is already using it, the data should be kept."
-msgstr ""
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-msgid "Should MySQL start on boot?"
-msgstr "MySQL açılış sırasında başlatılsın mı?"
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:4001
-#, fuzzy
-msgid ""
-"The MySQL can start automatically on boot time or only if you manually type "
-"'/etc/init.d/mysql start'."
-msgstr ""
-"MySQL açılış sırasında veya '/etc/init.d/mysql start' komutunu vermeniz "
-"halinde elle başlatılabilir. Eğer açılışta otomatik olarak başlatılmasını "
-"istiyorsanız burada 'evet'i seçin."
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid "New password for MySQL \"root\" user:"
-msgstr ""
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"It is highly recommended that you set a password for the MySQL "
-"administrative \"root\" user."
-msgstr ""
-
-#. Type: password
-#. Description
-#: ../mysql-server-5.0.templates:5001
-msgid ""
-"If you do not provide a password no changes will be made to the account."
-msgstr ""
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid "Unable to set password for MySQL \"root\" user"
-msgstr ""
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"It seems an error occurred while setting the password for the MySQL "
-"administrative user. This may have happened because the user already has a "
-"password, or because there was a problem communicating with the MySQL server."
-msgstr ""
-
-#. Type: error
-#. Description
-#: ../mysql-server-5.0.templates:6001
-msgid ""
-"When installation finishes, you should verify that the account is properly "
-"protected with a password (see README.Debian for more information)."
-msgstr ""
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid "Support MySQL connections from hosts running Debian \"sarge\" or older?"
-msgstr ""
-
-#. Type: boolean
-#. Description
-#: ../mysql-server-5.0.templates:7001
-msgid ""
-"The way passwords were stored was not very secure. This has been improved "
-"with the drawback that clients (e.g. PHP) from hosts running Debian 3.1 "
-"Sarge will not be able to connect to account which are new or whose password "
-"have been changed. See /usr/share/doc/mysql-server-5.0/README.Debian."
-msgstr ""
-
-#, fuzzy
-#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html"
-#~ msgstr "Lütfen http://www.mysql.com/doc/en/Upgrade.html belgesini okuyun"
-
-#, fuzzy
-#~ msgid ""
-#~ "MySQL will only install if you have a non-numeric hostname that is "
-#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command "
-#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 "
-#~ "myhostname\"."
-#~ msgstr ""
-#~ "MySQL sadece /etc/hosts dosyası yoluyla çözülebilir NUMERİK OLMAYAN bir "
-#~ "makine adına sahipseniz kurulacaktır. Örneğin, eğer \"hostname\" komutu "
-#~ "\"makinem\" ismini döndürüyorsa, bu dosya içinde \"10.0.0.1 makinem\" "
-#~ "gibi bir satır olmalıdır."
-
-#, fuzzy
-#~ msgid ""
-#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account "
-#~ "is used in the start/stop and cron scripts. Don't delete."
-#~ msgstr ""
-#~ "Yeni mysql kullanıcısı \"debian-sys-maint\" yaratılacak. Bu hesap, "
-#~ "başlangıç betiklerinde ve cron içinde kullanılıyor. Bu hesabı silmeyin."
-
-#, fuzzy
-#~ msgid ""
-#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /"
-#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in "
-#~ "there, never only the password!"
-#~ msgstr ""
-#~ "Lütfen MySQL root kullanıcısı için bir PAROLA girmeyi unutmayın! Eğer /"
-#~ "root/.my.cnf kullanıyorsanız, \"user\" ve \"password\" satırlarını her "
-#~ "zaman buraya ekleyin, sadece parolayı değil! Daha fazla bilgi için /usr/"
-#~ "share/doc/mysql-server/README.Debian dosyasını okuyun."
-
-#, fuzzy
-#~ msgid ""
-#~ "Should I remove all databases below /var/lib/mysql as you are purging the "
-#~ "mysql-server package?"
-#~ msgstr ""
-#~ "mysql-server paketi kaldırıldıktan sonra bütün veritabanları silinsin mi?"
-
-#~ msgid ""
-#~ "Networking is disabled by default for security reasons. You can enable it "
-#~ "by commenting out the skip-networking option in /etc/mysql/my.cnf."
-#~ msgstr ""
-#~ "Ağ, öntanımlı olarak güvenlik gerekçeleriyle devre dışı bırakıldı. Bu "
-#~ "özelliği /etc/mysql/my.cnf dosyası içindeki \"skip-networking\" "
-#~ "seçeneğini kaldırarak etkinleştirebilirsiniz."
-
-#~ msgid "security and update notice"
-#~ msgstr "güvenlik ve güncelleme duyurusu"
-
-#~ msgid ""
-#~ "Should I remove everything below /var/lib/mysql when you purge the mysql-"
-#~ "server package with the \"dpkg --purge mysql-server\" command (i.e. "
-#~ "remove everything including the configuration) somewhen? (default is not)"
-#~ msgstr ""
-#~ "mysql-server paketini temizlemek için \"dpkg --purge mysql-server\" "
-#~ "komutunu kullandığınızda (yani yapılandırma dahil herşeyi silmek) /var/"
-#~ "lib/mysql altındaki herşeyi sileyim mi? (öntanımlı cevap hayır'dır)."
-
-#~ msgid "Please run mysql_fix_privilege_tables !"
-#~ msgstr "Lütfen mysql_fix_privilege_tables komutunu çalıştırın!"
-
-#~ msgid ""
-#~ "I will ensure secure permissions of /var/lib/mysql by replacing GIDs "
-#~ "other than root and mysql with mysql."
-#~ msgstr ""
-#~ "/var/lib/mysql'in izinlerinin güvenli olmasını sağlamak amacıyla, buna "
-#~ "ait GID'leri root ve mysql'den farklı olacak şekilde değiştireceğim."
-
-#~ msgid ""
-#~ "Instructions how to enable SSL support are in /usr/share/doc/mysql-server/"
-#~ msgstr ""
-#~ "SSL desteğini nasıl etkinleştirebileceğinize ilişkin talimatlar /usr/"
-#~ "share/doc/mysql-server/ içinde."
-
-#~ msgid "mysql_fix_privileges_tables will be executed"
-#~ msgstr "mysql_fix_privileges_tables çalıştırılacak"
-
-#~ msgid ""
-#~ "The latest MySQL versions have an enhanced, more fine grained, privilege "
-#~ "system. To make use of it, some new fields must be added to the tables "
-#~ "in the \"mysql\" database. This is done by the "
-#~ "mysql_fix_privilege_tables script during this upgrade regardless of if "
-#~ "the server is currently running or not!"
-#~ msgstr ""
-#~ "En son MySQL sürümleri zenginleştirilmiş, daha ayrıntılandırılmış bir "
-#~ "ayrıcalık (privilege) sistemine sahiptir. Yeni sistemi kullanmak için, "
-#~ "\"mysql\" veritabanındaki tablolara bazı yeni alanlar eklenmelidir. Bu "
-#~ "işlem, sunucunun çalışıp çalışmamasına bağlı olmaksızın "
-#~ "mysql_fix_privilege_tables betiği tarafından bu yükseltme sırasında "
-#~ "yapılır."
-
-#~ msgid ""
-#~ "This script is not supposed to give any user more rights that he had "
-#~ "before, if you encounter such a case, please contact me."
-#~ msgstr ""
-#~ "Bu betiğin hiç bir kullanıcıya öncekinden daha fazla hak kazandırmadığı "
-#~ "varsayılıyor. Eğer bunun aksinde bir durumla karşılaşırsanız, lütfen "
-#~ "benimle bağlantıya geçin."
-
-#~ msgid "Make MySQL reachable via network?"
-#~ msgstr "MySQL network üzerinden ulaşılabilir olsun mu?"
-
-#~ msgid ""
-#~ "Should MySQL listen on a network reachable TCP port? This is not "
-#~ "necessary for use on a single computer and could be a security problem."
-#~ msgstr ""
-#~ "MySQL ağ üzerinde ulaşılabilen bir TCP portunu dinlesin mi? Tek olan bir "
-#~ "bilgisayar için bu ayar gerekli değildir ve bir güvenlik sorunu "
-#~ "oluÅŸturabilir."
-
-#~ msgid "Enable chroot mode?"
-#~ msgstr "chroot kipi etkinleÅŸtirilsin mi?"
-
-#~ msgid ""
-#~ "MySQL is able to jail itself into the /var/lib/mysql_jail directory so "
-#~ "that users cannot modify any files outside this directory. This improves "
-#~ "resistence against crackers, too, as they are not able to modify system "
-#~ "files."
-#~ msgstr ""
-#~ "MySQL kendini /var/lib/mysql_jail dizinine hapsederek kullanıcıların bu "
-#~ "dizin dışındaki hiç bir dosyayı değiştirmemesini sağlayabilir. Bu "
-#~ "düzenleme, sistem dosyalarını değiştirmelerini engelleyeceğinden, "
-#~ "cracker'lara karşı dayanıklılığı arttırır."
diff --git a/debian/rules b/debian/rules
deleted file mode 100755
index 5bc73f5ebad..00000000000
--- a/debian/rules
+++ /dev/null
@@ -1,405 +0,0 @@
-#!/usr/bin/make -f
-
-export SHELL = /bin/bash
-
-export DH_VERBOSE=1
-
-include debian/defs.mk
-
-changelog_values := $(shell dpkg-parsechangelog \
- | awk '/^(Version|Source|Distribution):/ {print $$2}')
-PKGSOURCE := $(word 1, $(changelog_values))
-PKGVERSION := $(word 2, $(changelog_values))
-PKGDISTRO := $(word 3, $(changelog_values))
-PKGFLAVOR := $(shell echo $(PKGSOURCE) | perl -nle 's/mysql-(.*?)-\d+.*/$$1/ && print ')
-
-ifeq ("x$(MYSQL_FLAVOR)","x")
- export MYSQL_FLAVOR=$(PKGFLAVOR)
-endif
-
-ifneq ("x$(MYSQL_FLAVOR)","x")
- MYSQL_BRANDED_BASE_VERSION:=$(MYSQL_FLAVOR)-$(MYSQL_BASE_VERSION)
- MYSQL_BRANDED_PREVIOUS_BASE_VERSION:=$(MYSQL_FLAVOR)-$(MYSQL_PREVIOUS_BASE_VERSION)
-else
- ifeq ( "$(MYSQL_BRANDED_BASE_VERSION)","@MYSQL_BRANDED_BASE_VERSION@" )
- MYSQL_BRANDED_BASE_VERSION:=$(MYSQL_BASE_VERSION)
- MYSQL_BRANDED_PREVIOUS_BASE_VERSION:=$(MYSQL_PREVIOUS_BASE_VERSION)
- else
- MYSQL_BRANDED_BASE_VERSION:=$(MYSQL_BRANDED_BASE_VERSION)
- MYSQL_BRANDED_PREVIOUS_BASE_VERSION:=$(MYSQL_BRANDED_PREVIOUS_BASE_VERSION)
- endif
-endif
-
-PACKAGE=mysql-$(MYSQL_BRANDED_BASE_VERSION)
-
-PWD=$(shell pwd)
-TMP=$(PWD)/debian/tmp/
-
-
-ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH)
-
-DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-
-MAKE_J = $(shell if grep -q processor.*3 /proc/cpuinfo; then echo "-j 4"; else echo ""; fi )
-
-ifeq ($(findstring $(ARCH),i386 sparc),$(ARCH))
- USE_ASSEMBLER=--enable-assembler
-endif
-
-ifeq ($(findstring $(ARCH), arm),$(ARCH))
- FOMIT_FRAME_POINTER=
-else
- FOMIT_FRAME_POINTER=-fomit-frame-pointer
-endif
-
-# trying to raise stability on i386. See #116631
-# don't use it on ia64
-ifeq ($(findstring $(ARCH),i386),$(ARCH))
- FNO_EXCEPTIONS=-fno-exceptions
-endif
-
-# This causes seg11 crashes if LDAP is used for groups in /etc/nsswitch.conf
-# so it is disabled by default although, according to MySQL, it brings >10%
-# performance gain if enabled. See #299382.
-ifeq ($(STATIC_MYSQLD), 1)
- USE_STATIC_MYSQLD=--with-mysqld-ldflags=-all-static
-endif
-
-ifneq ("$(MYSQL_BUILD_TEST)","yes")
- MYSQL_BUILD_TEST=no
-endif
-
-control-file:
- @echo "## This file is autogenerated you want to edit control.in instead" > debian/control.tmp
- sed -e "s/@MYSQL_BASE_VERSION@/$(MYSQL_BASE_VERSION)/g" \
- -e "s/@MYSQL_BRANDED_BASE_VERSION@/$(MYSQL_BRANDED_BASE_VERSION)/g" \
- -e "s/@VERSIONSTRING@/$(VERSIONSTRING)/g" \
- -e "s/@MYSQL_PREVIOUS_BASE_VERSION@/$(MYSQL_PREVIOUS_BASE_VERSION)/g" \
- -e "s/@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@/$(MYSQL_BRANDED_PREVIOUS_BASE_VERSION)/g" \
- -e "s/@MYSQL_SOURCE_BASE_VERSION@/$(MYSQL_SOURCE_BASE_VERSION)/g" \
- -e "s/@SHARED_LIB_MAJOR_VERSION@/$(SHARED_LIB_MAJOR_VERSION)/g" \
- -e "s/@NDB_SHARED_LIB_MAJOR_VERSION@/$(NDB_SHARED_LIB_MAJOR_VERSION)/g" \
- debian/control.in >> debian/control.tmp
- [ -e debian/control ] \
- && cmp -s debian/control debian/control.tmp \
- && rm -f debian/control.tmp && exit 0; \
- mv debian/control.tmp debian/control
-
-
-missing:
- ./BUILD/autorun.sh
-
-configure: configure-stamp
-configure-stamp:
- @echo "RULES.configure-stamp"
- dh_testdir
-
-ifneq ($(ARCH_OS),hurd)
- @if [ ! -d /proc/self ]; then echo "/proc IS NEEDED" 1>&2; exit 1; fi
-endif
-
- @cp debian/control debian/control.sav
- ( \
- CC="$(MYSQL_BUILD_CC)" \
- CXX="$(MYSQL_BUILD_CXX)" \
- BUILD_OPTS="${MYSQL_BUILD_OPTS:-''}" \
- CFLAGS="${MYSQL_BUILD_CFLAGS:-'-DBIG_JOINS=1 -O2'}" \
- CXXFLAGS="${MYSQL_BUILD_CXXFLAGS:-'-DBIG_JOINS=1 -felide-constructors -fno-rtti -O2'}" \
- ./configure \
- --build=${DEB_BUILD_GNU_TYPE} \
- --host=${DEB_HOST_GNU_TYPE} \
- \
- --prefix=/usr \
- --exec-prefix=/usr \
- --libexecdir=/usr/sbin \
- --datadir=/usr/share \
- --localstatedir=/var/lib/mysql \
- --includedir=/usr/include \
- --infodir=/usr/share/info \
- --mandir=/usr/share/man \
- \
- --with-comment="MySQL Server (custom build)" \
- --with-server-suffix="-custom" \
- \
- --enable-shared \
- --enable-thread-safe-client \
- $(USE_ASSEMBLER) \
- --enable-local-infile \
- \
- --with-big-tables \
- --with-unix-socket-path=/var/run/mysqld/mysqld.sock \
- --with-mysqld-user=mysql \
- $(USE_STATIC_MYSQLD) \
- --without-bench \
- --with-zlib-dir=bundled \
- --with-yassl \
- --with-readline \
- --with-extra-charsets=all \
- --with-innodb \
- --with-blackhole-storage-engine \
- --with-example-storage-engine \
- \
- --with-isam \
- --with-archive-storage-engine \
- --with-csv-storage-engine \
- --with-federated-storage-engine \
- --without-embedded-server \
- --with-ndbcluster \
- --with-ndb-shm \
- --without-ndb-sci \
- --without-ndb-test \
- --with-ndb-docs \
- $(MYSQL_BUILD_OPTS) \
- )
-
- @mv debian/control.sav debian/control
-
- touch configure-stamp
-
-
-build: build-stamp
-build-stamp: configure
- dh_testdir
-
- $(MAKE) $(MAKE_J)
-
- if [ -f sql/.libs/mysqld ] ; then \
- nm --numeric-sort sql/.libs/mysqld > sql/mysqld.sym ; \
- else \
- nm --numeric-sort sql/mysqld > sql/mysqld.sym ; \
- fi
-
-
- if [ "${MYSQL_BUILD_TEST}" != "no" ] ; then \
- ( cd mysql-test ;\
- MTR_BUILD_THREAD=auto ; \
- export MTR_BUILD_THREAD ; \
- perl ./mysql-test-run.pl --force --report-features ; \
- perl ./mysql-test-run.pl --force --ps-protocol ; \
- true ) \
- fi
-
-
- touch build-stamp
-
-stamp-control:
- # We have to prepare the various control files
-
- echo "in stamp-control - BASE_VER==$(MYSQL_BASE_VERSION)"
- # We have some naming inconsistencies here...
- for f in debian/*.in debian/po/POTFILES.in.in ; do \
- f2=`echo $$f | sed "s,BASE,$(MYSQL_BRANDED_BASE_VERSION),g;\
- s,PREV,$(MYSQL_BRANDED_PREVIOUS_BASE_VERSION),g;\
- s,NLIB,$(NDB_SHARED_LIB_MAJOR_VERSION),g;\
- s,SLIB,$(SHARED_LIB_MAJOR_VERSION),g;s,\.in$$,,"`; \
- if [ $$f2 != debian/control -a $$f2 != debian/Makefile ]; then \
- sed -e "s/@MYSQL_BASE_VERSION@/$(MYSQL_BASE_VERSION)/g" \
- -e "s/@MYSQL_BRANDED_BASE_VERSION@/$(MYSQL_BRANDED_BASE_VERSION)/g" \
- -e "s/@VERSIONSTRING@/$(VERSIONSTRING)/g" \
- -e "s/@PRIORITY@/$(PRIORITY)/g" \
- -e "s/@MYSQL_PREVIOUS_BASE_VERSION@/$(MYSQL_PREVIOUS_BASE_VERSION)/g" \
- -e "s/@MYSQL_BRANDED_PREVIOUS_BASE_VERSION@/$(MYSQL_BRANDED_PREVIOUS_BASE_VERSION)/g" \
- -e "s/@MYSQL_SOURCE_BASE_VERSION@/$(MYSQL_SOURCE_BASE_VERSION)/g" \
- -e "s/@SHARED_LIB_MAJOR_VERSION@/$(SHARED_LIB_MAJOR_VERSION)/g" \
- -e "s/@NDB_SHARED_LIB_MAJOR_VERSION@/$(NDB_SHARED_LIB_MAJOR_VERSION)/g" \
- -e "s,@SCRIPTDIR@,/$(scriptdir),g" \
- -e "s,@INFO@,$(findstring info, $(doc_dependencies)),g" \
- <$$f >$$f2; \
- fi; \
- done
- echo "MYSQL_BUILD_OPTS=$(MYSQL_BUILD_OPTS)" >> debian/defs.mk
- echo "MYSQL_BUILD_CXXFLAGS=$(MYSQL_BUILD_CXXFLAGS)" >> debian/defs.mk
- echo "MYSQL_BUILD_CFLAGS=$(MYSQL_BUILD_CFLAGS)" >> debian/defs.mk
- echo "MYSQL_BUILD_CC=$(MYSQL_BUILD_CC)" >> debian/defs.mk
- echo "MYSQL_BUILD_CXX=$(MYSQL_BUILD_CXX)" >> debian/defs.mk
-
-
-# depending on two files we expect to be in the root
-# to protect from accidentally deleting a whole bunch of
-# files somewhere else.
-clean: configure.in Makefile.am control-file
-
- rm -f debian/mysql-server-$(MYSQL_BRANDED_BASE_VERSION).mysql.init
-
- # We depend on this later, and delete the results in the mean time
- $(MAKE) -f debian/rules stamp-control
- dh_testdir
- dh_testroot
- rm -f configure-stamp
- rm -f build-stamp
-
- cp debian/defs.mk debian/defs.mk.sav
- cp debian/control debian/control.sav
- -make distclean
- mv debian/defs.mk.sav debian/defs.mk
- mv debian/control.sav debian/control
-
- debconf-updatepo
-
- for f in debian/*.in; do \
- f2=`echo $$f | sed "s,BASE,$(MYSQL_BRANDED_BASE_VERSION),g;\
- s,PREV,$(MYSQL_BRANDED_PREVIOUS_BASE_VERSION),g;\
- s,NLIB,$(NDB_SHARED_LIB_MAJOR_VERSION),g;\
- s,SLIB,$(SHARED_LIB_MAJOR_VERSION),g;s,\.in$$,,"`; \
- if [ $$f2 != debian/control -a $$f2 != debian/Makefile -a $$f2 != debian/defs.mk ]; then \
- rm -f $$f2; \
- fi; \
- done
- rm -f po/POTFILES.in
-
- dh_clean -v
-
-
-
-install:
-install: build stamp-control
- @echo "RULES.install"
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_installdirs
-
- # Sort of hackish way to make sure we have a init script
- # for dh_installinit
- cp support-files/mysql.server debian/mysql-server-$(MYSQL_BRANDED_BASE_VERSION).mysql.init
-
- mkdir -p $(TMP)/usr/lib/mysql/mysqld.sym
- cp sql/mysqld.sym $(TMP)/usr/lib/mysql/mysqld.sym
-
- # TODO: need real man pages!
- #for f in mysql mysqldump mysqlaccess mysqladmin mysqlshow myisam_ftdump myisamlog myisampack mysql_explain_log mysqld_multi mysqld_safe mysql_fix_privilege_tables mysql_upgrade mysql_tzinfo_to_sql mysql_zap perror replace safe_mysqld ; do touch $(TMP)/usr/share/man/man1/$$f.1 ; done
- #for f in mysqld mysqlmanager ; do touch $(TMP)/usr/share/man/man8/$$f.8 ; done
- # make install (trailing slash needed for innobase)
- $(MAKE) install DESTDIR=$(TMP)/
-
- # After installing, remove rpath to make lintian happy.
- set +e; \
- find ./debian/tmp/ -type f -print0 \
- | xargs -0 --no-run-if-empty chrpath -k 2>/dev/null \
- | fgrep RPATH= \
- | cut -d: -f 1 \
- | xargs --no-run-if-empty chrpath -d; \
- set -e
-
- # libmysqlclient: move shared libraries (but not the rest like libheap.a & co)
- mv $(TMP)/usr/lib/mysql/libmysqlclient* $(TMP)/usr/lib
- mv $(TMP)/usr/lib/mysql/libndbclient* $(TMP)/usr/lib
- perl -pi -e 's#/usr/lib/mysql#/usr/lib#' $(TMP)/usr/lib/libmysqlclient.la
- perl -pi -e 's#/usr/lib/mysql#/usr/lib#' $(TMP)/usr/lib/libmysqlclient_r.la
- perl -pi -e 's#/usr/lib/mysql#/usr/lib#' $(TMP)/usr/lib/libndbclient.la
-
- # Check if our beloved versioned symbols are really there
- if [ "`objdump -T $(TMP)/usr/lib/libmysqlclient.so.$(SHARED_LIB_MAJOR_VERSION).0.0 | grep -c libmysqlclient_$(SHARED_LIB_MAJOR_VERSION)`" -lt 500 ]; then \
- echo "ERROR: versioned symbols are absent"; \
- exit 1; \
- fi
- if [ "`objdump -T $(TMP)/usr/lib/libndbclient.so.$(NDB_SHARED_LIB_MAJOR_VERSION).0.0 | grep -c libndbclient_$(NDB_SHARED_LIB_MAJOR_VERSION)`" -lt 500 ]; then \
- echo "ERROR: versioned symbols are absent from libndbclient"; \
- exit 1; \
- fi
-
- # libmysqlclient-dev: forgotten header file since 3.23.25?
- cp include/my_config.h $(TMP)/usr/include/mysql/
- cp include/my_dir.h $(TMP)/usr/include/mysql/
-
- # mysql-common: We now provide our own config file.
- install -d $(TMP)/etc/mysql
- install -m 0644 debian/additions/my.cnf $(TMP)/etc/mysql/my.cnf
-
- pod2man scripts/mysqlhotcopy $(TMP)/usr/share/man/man1/mysqlhotcopy.1
-
- # mysql-server
- install -m 0755 scripts/mysqld_safe $(TMP)/usr/bin/mysqld_safe
- mkdir -p $(TMP)/usr/share/doc/mysql-server-$(MYSQL_BRANDED_BASE_VERSION)/examples
- mv $(TMP)/usr/share/mysql/*cnf $(TMP)/usr/share/doc/mysql-server-$(MYSQL_BRANDED_BASE_VERSION)/examples/
- rm -vf $(TMP)/usr/share/mysql/mi_test_all* \
- $(TMP)/usr/share/mysql/mysql-log-rotate \
- $(TMP)/usr/share/mysql/mysql.server \
- $(TMP)/usr/share/mysql/binary-configure
-
- # we can't install *.pl into /usr/bin - so we have to rename it.
- sed "s#filename => 'ndb_size.tmpl#filename => '/usr/share/mysql/ndb_size.tmpl#" < $(TMP)/usr/bin/ndb_size.pl > $(TMP)/usr/bin/ndb_size
- cp -a mysql-test $(TMP)/usr/share/mysql/
- cp -a sql-bench $(TMP)/usr/share/mysql/
- # lintian overrides
- mkdir -p $(TMP)/usr/share/lintian/overrides/
- cp debian/mysql-server-$(MYSQL_BRANDED_BASE_VERSION).lintian-overrides $(TMP)/usr/share/lintian/overrides/mysql-server-$(MYSQL_BRANDED_BASE_VERSION)
- cp debian/mysql-client-$(MYSQL_BRANDED_BASE_VERSION).lintian-overrides $(TMP)/usr/share/lintian/overrides/mysql-client-$(MYSQL_BRANDED_BASE_VERSION)
-
- # For 4.1 -> 5.0 transition
- d=$(TMP)/usr/share/mysql-common/internal-use-only/; \
- mkdir -p $$d; \
- cp debian/mysql-server-$(MYSQL_BRANDED_BASE_VERSION).mysql.init $$d/_etc_init.d_mysql; \
- cp debian/mysql-server-$(MYSQL_BRANDED_BASE_VERSION).mysql-server.logrotate $$d/_etc_logrotate.d_mysql-server; \
-
- dh_movefiles
-
-# Build architecture-independent files here.
-binary-indep: build install
- @echo "RULES.binary-indep"
- dh_testdir -i
- dh_testroot -i
- dh_installdebconf -i
- dh_installdocs -i
- dh_installexamples -i
- dh_installmenu -i
- dh_installlogrotate -i
- dh_installinit -i
- dh_installcron -i
- dh_installman -i
- dh_installinfo -i
- dh_installlogcheck -i
- dh_installchangelogs -i
- dh_link -i
- dh_compress -i
- dh_fixperms -i
- dh_installdeb -i
- dh_perl -i
- dh_gencontrol -i
- dh_md5sums -i
- dh_builddeb -i
-
-# Build architecture-dependent files here.
-binary-arch: build install
- @echo "RULES.binary-arch"
- dh_testdir
- dh_testroot
-
- dh_installdebconf -a
- dh_installdocs -a
- dh_installexamples -a
- dh_installmenu -a
- dh_installlogrotate -a --name mysql-server
- # Start mysql in runlevel 19 before 20 where apache, proftpd etc gets
- # started which might depend on a running database server.
- dh_installinit -a --name=mysql-storage -- defaults 19 21
- dh_installinit -a --name=mysql -- defaults 19 21
- dh_installinit -a --name=mysql-management -- defaults 20
- dh_installcron -a --name mysql-server
- dh_installman -a
- dh_installinfo -a
- dh_installlogcheck -a
- dh_installchangelogs -a
- dh_strip -a
- dh_link -a # .so muss nach .so.1.2.3 installier werden!
- dh_compress -a
- dh_fixperms -a
- dh_makeshlibs -a
- dh_makeshlibs -plibmysqlclient$(SHARED_LIB_MAJOR_VERSION) -V"libmysqlclient$(SHARED_LIB_MAJOR_VERSION) (>= $(PKGVERSION))"
- dh_makeshlibs -plibndbclient$(NDB_SHARED_LIB_MAJOR_VERSION) -V"libndbclient2 (>= $(PKGVERSION))"
- dh_installdeb -a
- dh_perl -a
- dh_shlibdeps -a -l debian/libmysqlclient$(SHARED_LIB_MAJOR_VERSION)/usr/lib -L libmysqlclient$(SHARED_LIB_MAJOR_VERSION)
- dh_shlibdeps -a -l debian/libndbclient$(NDB_SHARED_LIB_MAJOR_VERSION)/usr/lib -L libndbclient$(NDB_SHARED_LIB_MAJOR_VERSION)
- dh_gencontrol -a
- dh_md5sums -a
- dh_builddeb -a
-
-source diff:
- @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
-
-binary: binary-indep binary-arch
-.PHONY: clean stamp-control control-file configure build binary binary-indep binary-arch install
-
-# vim: ts=8
diff --git a/debian/source.lintian-overrides.in b/debian/source.lintian-overrides.in
deleted file mode 100644
index 22a9164cf66..00000000000
--- a/debian/source.lintian-overrides.in
+++ /dev/null
@@ -1,6 +0,0 @@
-maintainer-script-lacks-debhelper-token debian/mysql-server-@MYSQL_BRANDED_BASE_VERSION@.postinst
-maintainer-script-lacks-debhelper-token debian/mysql-server-@MYSQL_BRANDED_BASE_VERSION@.postrm
-outdated-autotools-helper-file bdb/dist/config.sub 2002-07-03
-outdated-autotools-helper-file bdb/dist/config.guess 2002-07-23
-bad-distribution-in-changes-file sarge
-bad-distribution-in-changes-file etch
diff --git a/debian/watch b/debian/watch
deleted file mode 100644
index 35a12186d19..00000000000
--- a/debian/watch
+++ /dev/null
@@ -1,3 +0,0 @@
-version=3
-opts="uversionmangle=s/-(rc|beta)/$1/" \
- ftp://ftp.mysql.com/pub/mysql/src/mysql-([\d\.]*(?:-beta|-rc)?).tar.gz debian
diff --git a/extra/comp_err.c b/extra/comp_err.c
index 7cc4a0aa43f..79f591e45fb 100644
--- a/extra/comp_err.c
+++ b/extra/comp_err.c
@@ -167,6 +167,7 @@ int main(int argc, char *argv[])
DBUG_ENTER("main");
charsets_dir= DEFAULT_CHARSET_DIR;
+ my_umask_dir= 0777;
if (get_options(&argc, &argv))
DBUG_RETURN(1);
if (!(row_count= parse_input_file(TXTFILE, &error_head, &lang_head)))
diff --git a/heap/hp_delete.c b/heap/hp_delete.c
index 637e5f1a497..e5c8dfcef01 100644
--- a/heap/hp_delete.c
+++ b/heap/hp_delete.c
@@ -72,10 +72,7 @@ int hp_rb_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo,
int res;
if (flag)
- {
info->last_pos= NULL; /* For heap_rnext/heap_rprev */
- info->lastkey_len= 0;
- }
custom_arg.keyseg= keyinfo->seg;
custom_arg.key_length= hp_rb_make_key(keyinfo, info->recbuf, record, recpos);
diff --git a/heap/hp_hash.c b/heap/hp_hash.c
index d8eee9c794c..251be1a3fe2 100644
--- a/heap/hp_hash.c
+++ b/heap/hp_hash.c
@@ -808,6 +808,12 @@ uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old,
if (!(*key++= (char) 1 - *old++))
{
k_len-= seg->length;
+ /*
+ Take into account length (2 bytes) of varchar key parts
+ stored before the data.
+ */
+ if (seg->flag & (HA_VAR_LENGTH_PART | HA_BLOB_PART))
+ k_len-= 2;
continue;
}
}
diff --git a/heap/hp_rfirst.c b/heap/hp_rfirst.c
index d1842949421..6acfe8e0ed6 100644
--- a/heap/hp_rfirst.c
+++ b/heap/hp_rfirst.c
@@ -35,6 +35,17 @@ int heap_rfirst(HP_INFO *info, byte *record, int inx)
sizeof(byte*));
info->current_ptr = pos;
memcpy(record, pos, (size_t)share->reclength);
+ /*
+ If we're performing index_first on a table that was taken from
+ table cache, info->lastkey_len is initialized to previous query.
+ Thus we set info->lastkey_len to proper value for subsequent
+ heap_rnext() calls.
+ This is needed for DELETE queries only, otherwise this variable is
+ not used.
+ Note that the same workaround may be needed for heap_rlast(), but
+ for now heap_rlast() is never used for DELETE queries.
+ */
+ info->lastkey_len= 0;
info->update = HA_STATE_AKTIV;
}
else
diff --git a/heap/hp_rnext.c b/heap/hp_rnext.c
index 3b436fe87aa..4ecbe779107 100644
--- a/heap/hp_rnext.c
+++ b/heap/hp_rnext.c
@@ -33,11 +33,40 @@ int heap_rnext(HP_INFO *info, byte *record)
heap_rb_param custom_arg;
if (info->last_pos)
+ {
+ /*
+ We enter this branch for non-DELETE queries after heap_rkey()
+ or heap_rfirst(). As last key position (info->last_pos) is available,
+ we only need to climb the tree using tree_search_next().
+ */
pos = tree_search_next(&keyinfo->rb_tree, &info->last_pos,
offsetof(TREE_ELEMENT, left),
offsetof(TREE_ELEMENT, right));
+ }
+ else if (!info->lastkey_len)
+ {
+ /*
+ We enter this branch only for DELETE queries after heap_rfirst(). E.g.
+ DELETE FROM t1 WHERE a<10. As last key position is not available
+ (last key is removed by heap_delete()), we must restart search as it
+ is done in heap_rfirst().
+
+ It should be safe to handle this situation without this branch. That is
+ branch below should find smallest element in a tree as lastkey_len is
+ zero. tree_search_edge() is a kind of optimisation here as it should be
+ faster than tree_search_key().
+ */
+ pos= tree_search_edge(&keyinfo->rb_tree, info->parents,
+ &info->last_pos, offsetof(TREE_ELEMENT, left));
+ }
else
{
+ /*
+ We enter this branch only for DELETE queries after heap_rkey(). E.g.
+ DELETE FROM t1 WHERE a=10. As last key position is not available
+ (last key is removed by heap_delete()), we must restart search as it
+ is done in heap_rkey().
+ */
custom_arg.keyseg = keyinfo->seg;
custom_arg.key_length = info->lastkey_len;
custom_arg.search_flag = SEARCH_SAME | SEARCH_FIND;
diff --git a/include/config-win.h b/include/config-win.h
index a45ee5e4eb3..923cf0592af 100644
--- a/include/config-win.h
+++ b/include/config-win.h
@@ -19,6 +19,9 @@
/* We have to do this define before including windows.h to get the AWE API
functions */
#define _WIN32_WINNT 0x0500
+#else
+/* Get NT 4.0 functions */
+#define _WIN32_WINNT 0x0400
#endif
#if defined(_MSC_VER) && _MSC_VER >= 1400
@@ -33,6 +36,7 @@ functions */
#include <io.h>
#include <malloc.h>
+#define BIG_TABLES 1
#define HAVE_SMEM 1
#if defined(_WIN64) || defined(WIN64)
diff --git a/include/keycache.h b/include/keycache.h
index 54c099fc474..424b4086cb4 100644
--- a/include/keycache.h
+++ b/include/keycache.h
@@ -46,7 +46,7 @@ typedef struct st_key_cache
my_bool key_cache_inited;
my_bool resize_in_flush; /* true during flush of resize operation */
my_bool can_be_used; /* usage of cache for read/write is allowed */
- ulong key_cache_mem_size; /* specified size of the cache memory */
+ size_t key_cache_mem_size; /* specified size of the cache memory */
uint key_cache_block_size; /* size of the page buffer of a cache block */
ulong min_warm_blocks; /* min number of warm blocks; */
ulong age_threshold; /* age threshold for hot blocks */
@@ -101,11 +101,11 @@ typedef struct st_key_cache
extern KEY_CACHE dflt_key_cache_var, *dflt_key_cache;
extern int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
- ulong use_mem, uint division_limit,
- uint age_threshold);
+ size_t use_mem, uint division_limit,
+ uint age_threshold);
extern int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
- ulong use_mem, uint division_limit,
- uint age_threshold);
+ size_t use_mem, uint division_limit,
+ uint age_threshold);
extern void change_key_cache_param(KEY_CACHE *keycache, uint division_limit,
uint age_threshold);
extern byte *key_cache_read(KEY_CACHE *keycache,
diff --git a/include/my_base.h b/include/my_base.h
index ef5ac364fed..9240b01a9f1 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -224,7 +224,7 @@ enum ha_base_keytype {
#define HA_SPATIAL 1024 /* For spatial search */
#define HA_NULL_ARE_EQUAL 2048 /* NULL in key are cmp as equal */
#define HA_GENERATED_KEY 8192 /* Automaticly generated key */
-
+#define HA_KEY_HAS_PART_KEY_SEG 65536 /* Key contains partial segments */
/* Automatic bits in key-flag */
#define HA_SPACE_PACK_USED 4 /* Test for if SPACE_PACK used */
diff --git a/include/my_global.h b/include/my_global.h
index 81dde581237..dd3bc39413d 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -100,6 +100,11 @@
#define NETWARE_SET_SCREEN_MODE(A)
#endif
+/* Workaround for _LARGE_FILES and _LARGE_FILE_API incompatibility on AIX */
+#if defined(_AIX) && defined(_LARGE_FILE_API)
+#undef _LARGE_FILE_API
+#endif
+
/*
The macros below are used to allow build of Universal/fat binaries of
MySQL and MySQL applications under darwin.
@@ -780,9 +785,6 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define DBL_MAX 1.79769313486231470e+308
#define FLT_MAX ((float)3.40282346638528860e+38)
#endif
-#ifndef SSIZE_MAX
-#define SSIZE_MAX ((~((size_t) 0)) / 2)
-#endif
#ifndef HAVE_FINITE
#define finite(x) (1.0 / fabs(x) > 0.0)
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 1cedbbc4fd0..13b7cf93d6f 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -116,6 +116,7 @@ struct timespec {
void win_pthread_init(void);
int win_pthread_setspecific(void *A,void *B,uint length);
+int win_pthread_mutex_trylock(pthread_mutex_t *mutex);
int pthread_create(pthread_t *,pthread_attr_t *,pthread_handler,void *);
int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr);
int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex);
@@ -176,7 +177,7 @@ extern int pthread_mutex_destroy (pthread_mutex_t *);
#else
#define pthread_mutex_init(A,B) (InitializeCriticalSection(A),0)
#define pthread_mutex_lock(A) (EnterCriticalSection(A),0)
-#define pthread_mutex_trylock(A) (WaitForSingleObject((A), 0) == WAIT_TIMEOUT)
+#define pthread_mutex_trylock(A) win_pthread_mutex_trylock((A))
#define pthread_mutex_unlock(A) LeaveCriticalSection(A)
#define pthread_mutex_destroy(A) DeleteCriticalSection(A)
#define my_pthread_setprio(A,B) SetThreadPriority(GetCurrentThread(), (B))
@@ -574,7 +575,7 @@ typedef struct st_safe_mutex_info_t
int safe_mutex_init(safe_mutex_t *mp, const pthread_mutexattr_t *attr,
const char *file, uint line);
-int safe_mutex_lock(safe_mutex_t *mp,const char *file, uint line);
+int safe_mutex_lock(safe_mutex_t *mp, my_bool try_lock, const char *file, uint line);
int safe_mutex_unlock(safe_mutex_t *mp,const char *file, uint line);
int safe_mutex_destroy(safe_mutex_t *mp,const char *file, uint line);
int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp,const char *file,
@@ -597,12 +598,12 @@ void safe_mutex_end(FILE *file);
#undef pthread_cond_timedwait
#undef pthread_mutex_trylock
#define pthread_mutex_init(A,B) safe_mutex_init((A),(B),__FILE__,__LINE__)
-#define pthread_mutex_lock(A) safe_mutex_lock((A),__FILE__,__LINE__)
+#define pthread_mutex_lock(A) safe_mutex_lock((A), FALSE, __FILE__, __LINE__)
#define pthread_mutex_unlock(A) safe_mutex_unlock((A),__FILE__,__LINE__)
#define pthread_mutex_destroy(A) safe_mutex_destroy((A),__FILE__,__LINE__)
#define pthread_cond_wait(A,B) safe_cond_wait((A),(B),__FILE__,__LINE__)
#define pthread_cond_timedwait(A,B,C) safe_cond_timedwait((A),(B),(C),__FILE__,__LINE__)
-#define pthread_mutex_trylock(A) pthread_mutex_lock(A)
+#define pthread_mutex_trylock(A) safe_mutex_lock((A), TRUE, __FILE__, __LINE__)
#define pthread_mutex_t safe_mutex_t
#define safe_mutex_assert_owner(mp) \
DBUG_ASSERT((mp)->count > 0 && \
diff --git a/include/my_sys.h b/include/my_sys.h
index 5bfd43d41ef..75347713a55 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -147,14 +147,14 @@ extern ulonglong sf_malloc_mem_limit;
#define TERMINATE(A) {}
#define QUICK_SAFEMALLOC
#define NORMAL_SAFEMALLOC
-extern gptr my_malloc(uint Size,myf MyFlags);
+extern gptr my_malloc(size_t Size, myf MyFlags);
#define my_malloc_ci(SZ,FLAG) my_malloc( SZ, FLAG )
extern gptr my_realloc(gptr oldpoint,uint Size,myf MyFlags);
extern void my_no_flags_free(gptr ptr);
-extern gptr my_memdup(const byte *from,uint length,myf MyFlags);
+extern gptr my_memdup(const byte *from, size_t length, myf MyFlags);
extern char *my_strdup(const char *from,myf MyFlags);
-extern char *my_strdup_with_length(const char *from, uint length,
- myf MyFlags);
+extern char *my_strdup_with_length(const char *from, size_t length,
+ myf MyFlags);
/* we do use FG (as a no-op) in below so that a typo on FG is caught */
#define my_free(PTR,FG) ((void)FG,my_no_flags_free(PTR))
#define CALLER_INFO_PROTO /* nothing */
@@ -166,7 +166,7 @@ extern char *my_strdup_with_length(const char *from, uint length,
#ifdef HAVE_LARGE_PAGES
extern uint my_get_large_page_size(void);
-extern gptr my_large_malloc(uint size, myf my_flags);
+extern gptr my_large_malloc(size_t size, myf my_flags);
extern void my_large_free(gptr ptr, myf my_flags);
#else
#define my_get_large_page_size() (0)
@@ -591,18 +591,18 @@ extern uint my_fwrite(FILE *stream,const byte *Buffer,uint Count,
myf MyFlags);
extern my_off_t my_fseek(FILE *stream,my_off_t pos,int whence,myf MyFlags);
extern my_off_t my_ftell(FILE *stream,myf MyFlags);
-extern gptr _mymalloc(uint uSize,const char *sFile,
- uint uLine, myf MyFlag);
-extern gptr _myrealloc(gptr pPtr,uint uSize,const char *sFile,
- uint uLine, myf MyFlag);
+extern gptr _mymalloc(size_t uSize, const char *sFile,
+ uint uLine, myf MyFlag);
+extern gptr _myrealloc(gptr pPtr, size_t uSize, const char *sFile,
+ uint uLine, myf MyFlag);
extern gptr my_multi_malloc _VARARGS((myf MyFlags, ...));
-extern void _myfree(gptr pPtr,const char *sFile,uint uLine, myf MyFlag);
+extern void _myfree(gptr pPtr, const char *sFile, uint uLine, myf MyFlag);
extern int _sanity(const char *sFile,unsigned int uLine);
-extern gptr _my_memdup(const byte *from,uint length,
- const char *sFile, uint uLine,myf MyFlag);
+extern gptr _my_memdup(const byte *from, size_t length,
+ const char *sFile, uint uLine, myf MyFlag);
extern my_string _my_strdup(const char *from, const char *sFile, uint uLine,
myf MyFlag);
-extern char *_my_strdup_with_length(const char *from, uint length,
+extern char *_my_strdup_with_length(const char *from, size_t length,
const char *sFile, uint uLine,
myf MyFlag);
@@ -692,6 +692,8 @@ extern WF_PACK *wf_comp(my_string str);
extern int wf_test(struct wild_file_pack *wf_pack,const char *name);
extern void wf_end(struct wild_file_pack *buffer);
extern size_s strip_sp(my_string str);
+extern my_bool array_append_string_unique(const char *str,
+ const char **array, size_t size);
extern void get_date(my_string to,int timeflag,time_t use_time);
extern void soundex(CHARSET_INFO *, my_string out_pntr, my_string in_pntr,pbool remove_garbage);
extern int init_record_cache(RECORD_CACHE *info,uint cachesize,File file,
@@ -710,8 +712,10 @@ extern sig_handler my_set_alarm_variable(int signo);
extern void my_string_ptr_sort(void *base,uint items,size_s size);
extern void radixsort_for_str_ptr(uchar* base[], uint number_of_elements,
size_s size_of_element,uchar *buffer[]);
-extern qsort_t qsort2(void *base_ptr, size_t total_elems, size_t size,
- qsort2_cmp cmp, void *cmp_argument);
+extern qsort_t my_qsort(void *base_ptr, size_t total_elems, size_t size,
+ qsort_cmp cmp);
+extern qsort_t my_qsort2(void *base_ptr, size_t total_elems, size_t size,
+ qsort2_cmp cmp, void *cmp_argument);
extern qsort2_cmp get_ptr_compare(uint);
void my_store_ptr(byte *buff, uint pack_length, my_off_t pos);
my_off_t my_get_ptr(byte *ptr, uint pack_length);
@@ -880,6 +884,8 @@ 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 CHARSET_INFO *get_compatible_charset_with_ctype(CHARSET_INFO
+ *original_cs);
extern void free_charsets(void);
extern char *get_charsets_dir(char *buf);
extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2);
diff --git a/include/mysql.h b/include/mysql.h
index b3e0dc45496..f2303abb241 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -550,16 +550,6 @@ unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql,
char *to,const char *from,
unsigned long length);
void STDCALL mysql_debug(const char *debug);
-char * STDCALL mysql_odbc_escape_string(MYSQL *mysql,
- char *to,
- unsigned long to_length,
- const char *from,
- unsigned long from_length,
- void *param,
- char *
- (*extend_buffer)
- (void *, char *to,
- unsigned long *length));
void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name);
unsigned int STDCALL mysql_thread_safe(void);
my_bool STDCALL mysql_embedded(void);
diff --git a/include/mysql_h.ic b/include/mysql_h.ic
index 5a9daee6f9f..1d4f3ce2758 100644
--- a/include/mysql_h.ic
+++ b/include/mysql_h.ic
@@ -32,65 +32,65 @@ enum mysql_option;
enum mysql_protocol_type;
enum mysql_rpl_type;
enum mysql_status;
-# 134 "mysql.h"
+# 138 "mysql.h"
typedef struct st_mysql_rows MYSQL_ROWS;
-# 24 "my_list.h"
+# 23 "my_list.h"
typedef struct st_list LIST;
-# 35 "my_alloc.h"
+# 34 "my_alloc.h"
typedef struct st_mem_root MEM_ROOT;
-# 251 "mysql.h"
+# 255 "mysql.h"
typedef struct st_mysql MYSQL;
-# 653 "mysql.h"
+# 647 "mysql.h"
typedef struct st_mysql_bind MYSQL_BIND;
-# 93 "mysql.h"
+# 97 "mysql.h"
typedef struct st_mysql_field MYSQL_FIELD;
-# 117 "mysql.h"
+# 121 "mysql.h"
typedef unsigned int MYSQL_FIELD_OFFSET;
-# 340 "mysql.h"
+# 344 "mysql.h"
typedef struct st_mysql_manager MYSQL_MANAGER;
-# 354 "mysql.h"
+# 358 "mysql.h"
typedef struct st_mysql_parameters MYSQL_PARAMETERS;
-# 309 "mysql.h"
+# 313 "mysql.h"
typedef struct st_mysql_res MYSQL_RES;
-# 116 "mysql.h"
+# 120 "mysql.h"
typedef char * * MYSQL_ROW;
-# 140 "mysql.h"
+# 144 "mysql.h"
typedef MYSQL_ROWS * MYSQL_ROW_OFFSET;
-# 681 "mysql.h"
+# 675 "mysql.h"
typedef struct st_mysql_stmt MYSQL_STMT;
-# 236 "mysql.h"
+# 240 "mysql.h"
typedef struct character_set MY_CHARSET_INFO;
-# 180 "mysql_com.h"
+# 179 "mysql_com.h"
typedef struct st_net NET;
-# 23 "typelib.h"
+# 22 "typelib.h"
typedef struct st_typelib TYPELIB;
-# 170 "mysql_com.h"
+# 169 "mysql_com.h"
typedef struct st_vio Vio;
-# 57 "mysql.h"
+# 60 "mysql.h"
typedef char * gptr;
-# 29 "my_list.h"
+# 28 "my_list.h"
typedef int (* list_walk_action)(void *, void *);
-# 48 "mysql.h"
+# 51 "mysql.h"
typedef char my_bool;
-# 63 "mysql.h"
+# 66 "mysql.h"
typedef int my_socket;
-# 125 "mysql.h"
+# 129 "mysql.h"
typedef unsigned long long int my_ulonglong;
-# 144 "mysql.h"
+# 148 "mysql.h"
typedef struct embedded_query_result EMBEDDED_QUERY_RESULT;
-# 145 "mysql.h"
+# 149 "mysql.h"
typedef struct st_mysql_data MYSQL_DATA;
-# 750 "mysql.h"
+# 744 "mysql.h"
typedef struct st_mysql_methods MYSQL_METHODS;
-# 48 "mysql_time.h"
+# 47 "mysql_time.h"
typedef struct st_mysql_time MYSQL_TIME;
-# 371 "mysql_com.h"
+# 375 "mysql_com.h"
typedef struct st_udf_args UDF_ARGS;
-# 384 "mysql_com.h"
+# 388 "mysql_com.h"
typedef struct st_udf_init UDF_INIT;
-# 27 "my_alloc.h"
+# 26 "my_alloc.h"
typedef struct st_used_mem USED_MEM;
-# 236 "mysql.h"
+# 240 "mysql.h"
struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(void *)))) character_set
{
unsigned int number;
@@ -102,7 +102,7 @@ struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(vo
unsigned int mbminlen;
unsigned int mbmaxlen;
};
-# 357 "mysql_com.h"
+# 361 "mysql_com.h"
struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof__(double)))) rand_struct
{
unsigned long int seed1;
@@ -110,14 +110,14 @@ struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof
unsigned long int max_value;
double max_value_dbl;
};
-# 24 "my_list.h"
+# 23 "my_list.h"
struct __attribute__((aligned(__alignof__(void *)))) st_list
{
struct st_list * prev;
struct st_list * next;
void * data;
};
-# 35 "my_alloc.h"
+# 34 "my_alloc.h"
struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned int)))) st_mem_root
{
USED_MEM * free;
@@ -129,7 +129,7 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned
unsigned int first_block_usage;
void (* error_handler)(void);
};
-# 251 "mysql.h"
+# 255 "mysql.h"
struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long long int)))) st_mysql
{
NET net;
@@ -173,7 +173,7 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned
void * thd;
my_bool * unbuffered_fetch_owner;
};
-# 653 "mysql.h"
+# 647 "mysql.h"
struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long int)))) st_mysql_bind
{
unsigned long int * length;
@@ -195,7 +195,7 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned
void (* fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *, unsigned char * * row);
void (* skip_result)(struct st_mysql_bind *, MYSQL_FIELD *, unsigned char * * row);
};
-# 145 "mysql.h"
+# 149 "mysql.h"
struct __attribute__((aligned(__alignof__(unsigned long long int)), aligned(__alignof__(void *)))) st_mysql_data
{
my_ulonglong rows;
@@ -204,7 +204,7 @@ struct __attribute__((aligned(__alignof__(unsigned long long int)), aligned(__al
MEM_ROOT alloc;
struct embedded_query_result * embedded_info;
};
-# 93 "mysql.h"
+# 97 "mysql.h"
struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long int)))) st_mysql_field
{
char * name;
@@ -228,7 +228,7 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned
unsigned int charsetnr;
enum enum_field_types type;
};
-# 340 "mysql.h"
+# 344 "mysql.h"
struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long int)))) st_mysql_manager
{
NET net;
@@ -246,7 +246,7 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned
int net_buf_size;
char last_error[256];
};
-# 750 "mysql.h"
+# 744 "mysql.h"
struct __attribute__((aligned(__alignof__(void *)))) st_mysql_methods
{
my_bool (* read_query_result)(MYSQL * mysql);
@@ -266,7 +266,7 @@ struct __attribute__((aligned(__alignof__(void *)))) st_mysql_methods
int (* read_change_user_result)(MYSQL * mysql, char * buff, char const * passwd);
int (* read_rows_from_cursor)(MYSQL_STMT * stmt);
};
-# 167 "mysql.h"
+# 171 "mysql.h"
struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof__(void *)))) st_mysql_options
{
unsigned int connect_timeout;
@@ -309,13 +309,13 @@ struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof
int (* local_infile_error)(void *, char *, unsigned int);
void * local_infile_userdata;
};
-# 354 "mysql.h"
+# 358 "mysql.h"
struct __attribute__((aligned(__alignof__(void *)))) st_mysql_parameters
{
unsigned long int * p_max_allowed_packet;
unsigned long int * p_net_buffer_length;
};
-# 309 "mysql.h"
+# 313 "mysql.h"
struct __attribute__((aligned(__alignof__(unsigned long long int)), aligned(__alignof__(void *)))) st_mysql_res
{
my_ulonglong row_count;
@@ -333,14 +333,14 @@ struct __attribute__((aligned(__alignof__(unsigned long long int)), aligned(__al
my_bool unbuffered_fetch_cancelled;
struct st_mysql_methods const * methods;
};
-# 134 "mysql.h"
+# 138 "mysql.h"
struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long int)))) st_mysql_rows
{
struct st_mysql_rows * next;
MYSQL_ROW data;
unsigned long int length;
};
-# 681 "mysql.h"
+# 675 "mysql.h"
struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long long int)))) st_mysql_stmt
{
MEM_ROOT mem_root;
@@ -370,7 +370,7 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned
my_bool unbuffered_fetch_cancelled;
my_bool update_max_length;
};
-# 48 "mysql_time.h"
+# 47 "mysql_time.h"
struct __attribute__((aligned(__alignof__(unsigned long int)))) st_mysql_time
{
unsigned int year;
@@ -383,7 +383,7 @@ struct __attribute__((aligned(__alignof__(unsigned long int)))) st_mysql_time
my_bool neg;
enum enum_mysql_timestamp_type time_type;
};
-# 180 "mysql_com.h"
+# 179 "mysql_com.h"
struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long int)))) st_net
{
Vio * vio;
@@ -419,7 +419,7 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned
my_bool report_error;
my_bool return_errno;
};
-# 23 "typelib.h"
+# 22 "typelib.h"
struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(void *)))) st_typelib
{
unsigned int count;
@@ -427,7 +427,7 @@ struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(vo
char const * * type_names;
unsigned int * type_lengths;
};
-# 371 "mysql_com.h"
+# 375 "mysql_com.h"
struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(void *)))) st_udf_args
{
unsigned int arg_count;
@@ -438,7 +438,7 @@ struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(vo
char * * attributes;
unsigned long int * attribute_lengths;
};
-# 384 "mysql_com.h"
+# 388 "mysql_com.h"
struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof__(void *)))) st_udf_init
{
my_bool maybe_null;
@@ -447,14 +447,14 @@ struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof
char * ptr;
my_bool const_item;
};
-# 27 "my_alloc.h"
+# 26 "my_alloc.h"
struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned int)))) st_used_mem
{
struct st_used_mem * next;
unsigned int left;
unsigned int size;
};
-# 368 "mysql_com.h"
+# 372 "mysql_com.h"
enum Item_result
{
STRING_RESULT = 0,
@@ -463,7 +463,7 @@ enum Item_result
ROW_RESULT = 3,
DECIMAL_RESULT = 4,
};
-# 314 "mysql_com.h"
+# 313 "mysql_com.h"
enum enum_cursor_type
{
CURSOR_TYPE_NO_CURSOR = 0,
@@ -471,7 +471,7 @@ enum enum_cursor_type
CURSOR_TYPE_FOR_UPDATE = 2,
CURSOR_TYPE_SCROLLABLE = 4,
};
-# 227 "mysql_com.h"
+# 226 "mysql_com.h"
enum enum_field_types
{
MYSQL_TYPE_DECIMAL = 0,
@@ -502,13 +502,13 @@ enum enum_field_types
MYSQL_TYPE_STRING = 254,
MYSQL_TYPE_GEOMETRY = 255,
};
-# 324 "mysql_com.h"
+# 323 "mysql_com.h"
enum enum_mysql_set_option
{
MYSQL_OPTION_MULTI_STATEMENTS_ON = 0,
MYSQL_OPTION_MULTI_STATEMENTS_OFF = 1,
};
-# 583 "mysql.h"
+# 577 "mysql.h"
enum enum_mysql_stmt_state
{
MYSQL_STMT_INIT_DONE = 1,
@@ -516,7 +516,7 @@ enum enum_mysql_stmt_state
MYSQL_STMT_EXECUTE_DONE = 3,
MYSQL_STMT_FETCH_DONE = 4,
};
-# 29 "mysql_time.h"
+# 28 "mysql_time.h"
enum enum_mysql_timestamp_type
{
MYSQL_TIMESTAMP_NONE = -(2),
@@ -525,7 +525,7 @@ enum enum_mysql_timestamp_type
MYSQL_TIMESTAMP_DATETIME = 1,
MYSQL_TIMESTAMP_TIME = 2,
};
-# 52 "mysql_com.h"
+# 51 "mysql_com.h"
enum enum_server_command
{
COM_SLEEP = 0,
@@ -559,14 +559,14 @@ enum enum_server_command
COM_STMT_FETCH = 28,
COM_END = 29,
};
-# 727 "mysql.h"
+# 721 "mysql.h"
enum enum_stmt_attr_type
{
STMT_ATTR_UPDATE_MAX_LENGTH = 0,
STMT_ATTR_CURSOR_TYPE = 1,
STMT_ATTR_PREFETCH_ROWS = 2,
};
-# 289 "mysql_com.h"
+# 288 "mysql_com.h"
enum mysql_enum_shutdown_level
{
SHUTDOWN_DEFAULT = 0,
@@ -578,7 +578,7 @@ enum mysql_enum_shutdown_level
KILL_QUERY = 254,
KILL_CONNECTION = 255,
};
-# 154 "mysql.h"
+# 158 "mysql.h"
enum mysql_option
{
MYSQL_OPT_CONNECT_TIMEOUT = 0,
@@ -604,7 +604,7 @@ enum mysql_option
MYSQL_OPT_RECONNECT = 20,
MYSQL_OPT_SSL_VERIFY_SERVER_CERT = 21,
};
-# 221 "mysql.h"
+# 225 "mysql.h"
enum mysql_protocol_type
{
MYSQL_PROTOCOL_DEFAULT = 0,
@@ -613,357 +613,355 @@ enum mysql_protocol_type
MYSQL_PROTOCOL_PIPE = 3,
MYSQL_PROTOCOL_MEMORY = 4,
};
-# 231 "mysql.h"
+# 235 "mysql.h"
enum mysql_rpl_type
{
MYSQL_RPL_MASTER = 0,
MYSQL_RPL_SLAVE = 1,
MYSQL_RPL_ADMIN = 2,
};
-# 216 "mysql.h"
+# 220 "mysql.h"
enum mysql_status
{
MYSQL_STATUS_READY = 0,
MYSQL_STATUS_GET_RESULT = 1,
MYSQL_STATUS_USE_RESULT = 2,
};
-# 423 "mysql_com.h"
+# 427 "mysql_com.h"
extern my_bool check_scramble(char const * reply, char const * message, unsigned char const * hash_stage2);
-# 416 "mysql_com.h"
+# 420 "mysql_com.h"
extern my_bool check_scramble_323(char const *, char const * message, unsigned long int * salt);
-# 33 "typelib.h"
+# 32 "typelib.h"
extern TYPELIB * copy_typelib(MEM_ROOT * root, TYPELIB * from);
-# 411 "mysql_com.h"
+# 415 "mysql_com.h"
extern void create_random_string(char * to, unsigned int, struct rand_struct * rand_st);
-# 30 "typelib.h"
+# 29 "typelib.h"
extern int find_type(char * x, TYPELIB * typelib, unsigned int);
-# 425 "mysql_com.h"
+# 429 "mysql_com.h"
extern void get_salt_from_password(unsigned char * res, char const * password);
-# 418 "mysql_com.h"
+# 422 "mysql_com.h"
extern void get_salt_from_password_323(unsigned long int * res, char const * password);
-# 431 "mysql_com.h"
+# 435 "mysql_com.h"
extern char * get_tty_password(char * opt_message);
-# 32 "typelib.h"
+# 31 "typelib.h"
extern char const * get_type(TYPELIB * typelib, unsigned int);
-# 413 "mysql_com.h"
+# 417 "mysql_com.h"
extern void hash_password(unsigned long int * to, char const * password, unsigned int);
-# 31 "my_list.h"
+# 30 "my_list.h"
extern LIST * list_add(LIST * root, LIST * element);
-# 33 "my_list.h"
-extern LIST * list_cons(void * data, LIST * root);
# 32 "my_list.h"
+extern LIST * list_cons(void * data, LIST * root);
+# 31 "my_list.h"
extern LIST * list_delete(LIST * root, LIST * element);
-# 35 "my_list.h"
+# 34 "my_list.h"
extern void list_free(LIST * root, unsigned int);
-# 36 "my_list.h"
+# 35 "my_list.h"
extern unsigned int list_length(LIST *);
-# 34 "my_list.h"
+# 33 "my_list.h"
extern LIST * list_reverse(LIST * root);
-# 37 "my_list.h"
+# 36 "my_list.h"
extern int list_walk(LIST *, list_walk_action, gptr);
-# 440 "mysql_com.h"
+# 444 "mysql_com.h"
extern int load_defaults(char const * conf_file, char const * * groups, int * argc, char * * * argv);
-# 426 "mysql_com.h"
+# 430 "mysql_com.h"
extern void make_password_from_salt(char * to, unsigned char const * hash_stage2);
-# 419 "mysql_com.h"
+# 423 "mysql_com.h"
extern void make_password_from_salt_323(char * to, unsigned long int const * salt);
-# 421 "mysql_com.h"
+# 425 "mysql_com.h"
extern void make_scrambled_password(char * to, char const * password);
-# 414 "mysql_com.h"
+# 418 "mysql_com.h"
extern void make_scrambled_password_323(char * to, char const * password);
-# 31 "typelib.h"
+# 30 "typelib.h"
extern void make_type(char * to, unsigned int, TYPELIB * typelib);
-# 437 "mysql_com.h"
+# 441 "mysql_com.h"
extern int modify_defaults_file(char const * file_location, char const * option, char const * option_value, char const * section_name, int);
-# 354 "mysql_com.h"
+# 358 "mysql_com.h"
extern int my_connect(my_socket, struct sockaddr const * name, unsigned int, unsigned int);
-# 436 "mysql_com.h"
+# 440 "mysql_com.h"
extern my_bool my_init(void);
-# 336 "mysql_com.h"
+# 335 "mysql_com.h"
extern my_bool my_net_init(NET * net, Vio * vio);
-# 337 "mysql_com.h"
+# 336 "mysql_com.h"
extern void my_net_local_init(NET * net);
-# 347 "mysql_com.h"
+# 346 "mysql_com.h"
extern unsigned long int my_net_read(NET * net);
-# 342 "mysql_com.h"
+# 341 "mysql_com.h"
extern my_bool my_net_write(NET * net, char const * packet, unsigned long int);
-# 410 "mysql_com.h"
+# 414 "mysql_com.h"
extern double my_rnd(struct rand_struct *);
-# 443 "mysql_com.h"
+# 447 "mysql_com.h"
extern void my_thread_end(void);
-# 442 "mysql_com.h"
+# 446 "mysql_com.h"
extern my_bool my_thread_init(void);
-# 559 "mysql.h"
+# 553 "mysql.h"
extern void myodbc_remove_escape(MYSQL * mysql, char * name);
-# 501 "mysql.h"
+# 505 "mysql.h"
extern int mysql_add_slave(MYSQL * mysql, char const * host, unsigned int, char const * user, char const * passwd);
-# 410 "mysql.h"
+# 414 "mysql.h"
extern my_ulonglong mysql_affected_rows(MYSQL * mysql);
-# 823 "mysql.h"
+# 817 "mysql.h"
extern my_bool mysql_autocommit(MYSQL * mysql, my_bool);
-# 426 "mysql.h"
+# 430 "mysql.h"
extern my_bool mysql_change_user(MYSQL * mysql, char const * user, char const * passwd, char const * db);
-# 418 "mysql.h"
+# 422 "mysql.h"
extern char const * mysql_character_set_name(MYSQL * mysql);
-# 826 "mysql.h"
+# 820 "mysql.h"
extern void mysql_close(MYSQL * sock);
-# 821 "mysql.h"
+# 815 "mysql.h"
extern my_bool mysql_commit(MYSQL * mysql);
-# 530 "mysql.h"
+# 534 "mysql.h"
extern void mysql_data_seek(MYSQL_RES * result, my_ulonglong);
-# 548 "mysql.h"
+# 552 "mysql.h"
extern void mysql_debug(char const * debug);
-# 487 "mysql.h"
+# 491 "mysql.h"
extern void mysql_disable_reads_from_master(MYSQL * mysql);
-# 481 "mysql.h"
+# 485 "mysql.h"
extern void mysql_disable_rpl_parse(MYSQL * mysql);
-# 509 "mysql.h"
+# 513 "mysql.h"
extern int mysql_dump_debug_info(MYSQL * mysql);
-# 561 "mysql.h"
+# 555 "mysql.h"
extern my_bool mysql_embedded(void);
-# 486 "mysql.h"
+# 490 "mysql.h"
extern void mysql_enable_reads_from_master(MYSQL * mysql);
-# 480 "mysql.h"
+# 484 "mysql.h"
extern void mysql_enable_rpl_parse(MYSQL * mysql);
-# 402 "mysql.h"
+# 406 "mysql.h"
extern my_bool mysql_eof(MYSQL_RES * res);
-# 412 "mysql.h"
+# 416 "mysql.h"
extern unsigned int mysql_errno(MYSQL * mysql);
-# 432 "mysql_com.h"
+# 436 "mysql_com.h"
extern char const * mysql_errno_to_sqlstate(unsigned int);
-# 413 "mysql.h"
+# 417 "mysql.h"
extern char const * mysql_error(MYSQL * mysql);
-# 541 "mysql.h"
+# 545 "mysql.h"
extern unsigned long int mysql_escape_string(char * to, char const * from, unsigned long int);
-# 538 "mysql.h"
+# 542 "mysql.h"
extern MYSQL_FIELD * mysql_fetch_field(MYSQL_RES * result);
-# 403 "mysql.h"
+# 407 "mysql.h"
extern MYSQL_FIELD * mysql_fetch_field_direct(MYSQL_RES * res, unsigned int);
-# 405 "mysql.h"
+# 409 "mysql.h"
extern MYSQL_FIELD * mysql_fetch_fields(MYSQL_RES * res);
-# 537 "mysql.h"
+# 541 "mysql.h"
extern unsigned long int * mysql_fetch_lengths(MYSQL_RES * result);
-# 536 "mysql.h"
+# 540 "mysql.h"
extern MYSQL_ROW mysql_fetch_row(MYSQL_RES * result);
-# 409 "mysql.h"
+# 413 "mysql.h"
extern unsigned int mysql_field_count(MYSQL * mysql);
-# 534 "mysql.h"
+# 538 "mysql.h"
extern MYSQL_FIELD_OFFSET mysql_field_seek(MYSQL_RES * result, MYSQL_FIELD_OFFSET);
-# 407 "mysql.h"
+# 411 "mysql.h"
extern MYSQL_FIELD_OFFSET mysql_field_tell(MYSQL_RES * res);
-# 529 "mysql.h"
+# 533 "mysql.h"
extern void mysql_free_result(MYSQL_RES * result);
-# 454 "mysql.h"
+# 458 "mysql.h"
extern void mysql_get_character_set_info(MYSQL * mysql, MY_CHARSET_INFO * charset);
-# 519 "mysql.h"
+# 523 "mysql.h"
extern char const * mysql_get_client_info(void);
-# 520 "mysql.h"
+# 524 "mysql.h"
extern unsigned long int mysql_get_client_version(void);
-# 521 "mysql.h"
+# 525 "mysql.h"
extern char const * mysql_get_host_info(MYSQL * mysql);
-# 384 "mysql.h"
+# 388 "mysql.h"
extern MYSQL_PARAMETERS * mysql_get_parameters(void);
-# 523 "mysql.h"
+# 527 "mysql.h"
extern unsigned int mysql_get_proto_info(MYSQL * mysql);
-# 518 "mysql.h"
-extern char const * mysql_get_server_info(MYSQL * mysql);
# 522 "mysql.h"
+extern char const * mysql_get_server_info(MYSQL * mysql);
+# 526 "mysql.h"
extern unsigned long int mysql_get_server_version(MYSQL * mysql);
-# 425 "mysql.h"
+# 429 "mysql.h"
extern char const * mysql_get_ssl_cipher(MYSQL * mysql);
-# 543 "mysql.h"
+# 547 "mysql.h"
extern unsigned long int mysql_hex_string(char * to, char const * from, unsigned long int);
-# 416 "mysql.h"
+# 420 "mysql.h"
extern char const * mysql_info(MYSQL * mysql);
-# 421 "mysql.h"
+# 425 "mysql.h"
extern MYSQL * mysql_init(MYSQL * mysql);
-# 411 "mysql.h"
+# 415 "mysql.h"
extern my_ulonglong mysql_insert_id(MYSQL * mysql);
-# 512 "mysql.h"
+# 516 "mysql.h"
extern int mysql_kill(MYSQL * mysql, unsigned long int);
-# 524 "mysql.h"
+# 528 "mysql.h"
extern MYSQL_RES * mysql_list_dbs(MYSQL * mysql, char const * wild);
-# 539 "mysql.h"
+# 543 "mysql.h"
extern MYSQL_RES * mysql_list_fields(MYSQL * mysql, char const * table, char const * wild);
-# 526 "mysql.h"
+# 530 "mysql.h"
extern MYSQL_RES * mysql_list_processes(MYSQL * mysql);
-# 525 "mysql.h"
+# 529 "mysql.h"
extern MYSQL_RES * mysql_list_tables(MYSQL * mysql, char const * wild);
-# 568 "mysql.h"
+# 562 "mysql.h"
extern void mysql_manager_close(MYSQL_MANAGER * con);
-# 569 "mysql.h"
-extern int mysql_manager_command(MYSQL_MANAGER * con, char const * cmd, int);
# 563 "mysql.h"
+extern int mysql_manager_command(MYSQL_MANAGER * con, char const * cmd, int);
+# 557 "mysql.h"
extern MYSQL_MANAGER * mysql_manager_connect(MYSQL_MANAGER * con, char const * host, char const * user, char const * passwd, unsigned int);
-# 571 "mysql.h"
+# 565 "mysql.h"
extern int mysql_manager_fetch_line(MYSQL_MANAGER * con, char * res_buf, int);
-# 562 "mysql.h"
+# 556 "mysql.h"
extern MYSQL_MANAGER * mysql_manager_init(MYSQL_MANAGER * con);
-# 445 "mysql.h"
+# 449 "mysql.h"
extern my_bool mysql_master_query(MYSQL * mysql, char const * q, unsigned long int);
-# 447 "mysql.h"
+# 451 "mysql.h"
extern my_bool mysql_master_send_query(MYSQL * mysql, char const * q, unsigned long int);
-# 824 "mysql.h"
+# 818 "mysql.h"
extern my_bool mysql_more_results(MYSQL * mysql);
-# 825 "mysql.h"
+# 819 "mysql.h"
extern int mysql_next_result(MYSQL * mysql);
-# 401 "mysql.h"
+# 405 "mysql.h"
extern unsigned int mysql_num_fields(MYSQL_RES * res);
-# 400 "mysql.h"
+# 404 "mysql.h"
extern my_ulonglong mysql_num_rows(MYSQL_RES * res);
-# 549 "mysql.h"
-extern char * mysql_odbc_escape_string(MYSQL * mysql, char * to, unsigned long int, char const * from, unsigned long int, void * param, char * (* extend_buffer)(void *, char * to, unsigned long int * length));
-# 527 "mysql.h"
+# 531 "mysql.h"
extern int mysql_options(MYSQL * mysql, enum mysql_option, char const * arg);
-# 516 "mysql.h"
+# 520 "mysql.h"
extern int mysql_ping(MYSQL * mysql);
-# 75 "mysql.h"
+# 78 "mysql.h"
extern unsigned int mysql_port;
-# 436 "mysql.h"
+# 440 "mysql.h"
extern int mysql_query(MYSQL * mysql, char const * q);
-# 574 "mysql.h"
+# 568 "mysql.h"
extern my_bool mysql_read_query_result(MYSQL * mysql);
-# 489 "mysql.h"
+# 493 "mysql.h"
extern my_bool mysql_reads_from_master_enabled(MYSQL * mysql);
-# 428 "mysql.h"
+# 432 "mysql.h"
extern MYSQL * mysql_real_connect(MYSQL * mysql, char const * host, char const * user, char const * passwd, char const * db, unsigned int, char const * unix_socket, unsigned long int);
-# 545 "mysql.h"
+# 549 "mysql.h"
extern unsigned long int mysql_real_escape_string(MYSQL * mysql, char * to, char const * from, unsigned long int);
-# 439 "mysql.h"
+# 443 "mysql.h"
extern int mysql_real_query(MYSQL * mysql, char const * q, unsigned long int);
-# 510 "mysql.h"
+# 514 "mysql.h"
extern int mysql_refresh(MYSQL * mysql, unsigned int);
-# 822 "mysql.h"
+# 816 "mysql.h"
extern my_bool mysql_rollback(MYSQL * mysql);
-# 532 "mysql.h"
+# 536 "mysql.h"
extern MYSQL_ROW_OFFSET mysql_row_seek(MYSQL_RES * result, MYSQL_ROW_OFFSET);
-# 406 "mysql.h"
+# 410 "mysql.h"
extern MYSQL_ROW_OFFSET mysql_row_tell(MYSQL_RES * res);
-# 483 "mysql.h"
+# 487 "mysql.h"
extern int mysql_rpl_parse_enabled(MYSQL * mysql);
-# 494 "mysql.h"
+# 498 "mysql.h"
extern my_bool mysql_rpl_probe(MYSQL * mysql);
-# 491 "mysql.h"
+# 495 "mysql.h"
extern enum mysql_rpl_type mysql_rpl_query_type(char const * q, int);
-# 435 "mysql.h"
+# 439 "mysql.h"
extern int mysql_select_db(MYSQL * mysql, char const * db);
-# 437 "mysql.h"
+# 441 "mysql.h"
extern int mysql_send_query(MYSQL * mysql, char const * q, unsigned long int);
-# 371 "mysql.h"
+# 375 "mysql.h"
extern void mysql_server_end(void);
-# 370 "mysql.h"
+# 374 "mysql.h"
extern int mysql_server_init(int, char * * argv, char * * groups);
-# 419 "mysql.h"
+# 423 "mysql.h"
extern int mysql_set_character_set(MYSQL * mysql, char const * csname);
-# 472 "mysql.h"
+# 476 "mysql.h"
extern void mysql_set_local_infile_default(MYSQL * mysql);
-# 461 "mysql.h"
+# 465 "mysql.h"
extern void mysql_set_local_infile_handler(MYSQL * mysql, int (* local_infile_init)(void * *, char const *, void *), int (* local_infile_read)(void *, char *, unsigned int), void (* local_infile_end)(void), int (* local_infile_error)(void *, char *, unsigned int), void *);
-# 497 "mysql.h"
+# 501 "mysql.h"
extern int mysql_set_master(MYSQL * mysql, char const * host, unsigned int, char const * user, char const * passwd);
-# 513 "mysql.h"
+# 517 "mysql.h"
extern int mysql_set_server_option(MYSQL * mysql, enum enum_mysql_set_option);
-# 506 "mysql.h"
+# 510 "mysql.h"
extern int mysql_shutdown(MYSQL * mysql, enum mysql_enum_shutdown_level);
-# 450 "mysql.h"
+# 454 "mysql.h"
extern my_bool mysql_slave_query(MYSQL * mysql, char const * q, unsigned long int);
-# 452 "mysql.h"
+# 456 "mysql.h"
extern my_bool mysql_slave_send_query(MYSQL * mysql, char const * q, unsigned long int);
-# 414 "mysql.h"
+# 418 "mysql.h"
extern char const * mysql_sqlstate(MYSQL * mysql);
-# 422 "mysql.h"
+# 426 "mysql.h"
extern my_bool mysql_ssl_set(MYSQL * mysql, char const * key, char const * cert, char const * ca, char const * capath, char const * cipher);
-# 517 "mysql.h"
+# 521 "mysql.h"
extern char const * mysql_stat(MYSQL * mysql);
-# 817 "mysql.h"
+# 811 "mysql.h"
extern my_ulonglong mysql_stmt_affected_rows(MYSQL_STMT * stmt);
-# 795 "mysql.h"
+# 789 "mysql.h"
extern my_bool mysql_stmt_attr_get(MYSQL_STMT * stmt, enum enum_stmt_attr_type, void * attr);
-# 792 "mysql.h"
+# 786 "mysql.h"
extern my_bool mysql_stmt_attr_set(MYSQL_STMT * stmt, enum enum_stmt_attr_type, void const * attr);
-# 798 "mysql.h"
+# 792 "mysql.h"
extern my_bool mysql_stmt_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
-# 799 "mysql.h"
+# 793 "mysql.h"
extern my_bool mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
-# 800 "mysql.h"
+# 794 "mysql.h"
extern my_bool mysql_stmt_close(MYSQL_STMT * stmt);
-# 815 "mysql.h"
-extern void mysql_stmt_data_seek(MYSQL_STMT * stmt, my_ulonglong);
# 809 "mysql.h"
+extern void mysql_stmt_data_seek(MYSQL_STMT * stmt, my_ulonglong);
+# 803 "mysql.h"
extern unsigned int mysql_stmt_errno(MYSQL_STMT * stmt);
-# 810 "mysql.h"
+# 804 "mysql.h"
extern char const * mysql_stmt_error(MYSQL_STMT * stmt);
-# 785 "mysql.h"
+# 779 "mysql.h"
extern int mysql_stmt_execute(MYSQL_STMT * stmt);
-# 786 "mysql.h"
+# 780 "mysql.h"
extern int mysql_stmt_fetch(MYSQL_STMT * stmt);
-# 787 "mysql.h"
-extern int mysql_stmt_fetch_column(MYSQL_STMT * stmt, MYSQL_BIND * bind, unsigned int, unsigned long int);
-# 819 "mysql.h"
+# 781 "mysql.h"
+extern int mysql_stmt_fetch_column(MYSQL_STMT * stmt, MYSQL_BIND * bind_arg, unsigned int, unsigned long int);
+# 813 "mysql.h"
extern unsigned int mysql_stmt_field_count(MYSQL_STMT * stmt);
-# 802 "mysql.h"
+# 796 "mysql.h"
extern my_bool mysql_stmt_free_result(MYSQL_STMT * stmt);
-# 782 "mysql.h"
+# 776 "mysql.h"
extern MYSQL_STMT * mysql_stmt_init(MYSQL * mysql);
-# 818 "mysql.h"
+# 812 "mysql.h"
extern my_ulonglong mysql_stmt_insert_id(MYSQL_STMT * stmt);
-# 816 "mysql.h"
+# 810 "mysql.h"
extern my_ulonglong mysql_stmt_num_rows(MYSQL_STMT * stmt);
-# 791 "mysql.h"
+# 785 "mysql.h"
extern unsigned long int mysql_stmt_param_count(MYSQL_STMT * stmt);
-# 808 "mysql.h"
+# 802 "mysql.h"
extern MYSQL_RES * mysql_stmt_param_metadata(MYSQL_STMT * stmt);
-# 783 "mysql.h"
+# 777 "mysql.h"
extern int mysql_stmt_prepare(MYSQL_STMT * stmt, char const * query, unsigned long int);
-# 801 "mysql.h"
+# 795 "mysql.h"
extern my_bool mysql_stmt_reset(MYSQL_STMT * stmt);
-# 807 "mysql.h"
+# 801 "mysql.h"
extern MYSQL_RES * mysql_stmt_result_metadata(MYSQL_STMT * stmt);
-# 812 "mysql.h"
+# 806 "mysql.h"
extern MYSQL_ROW_OFFSET mysql_stmt_row_seek(MYSQL_STMT * stmt, MYSQL_ROW_OFFSET);
-# 814 "mysql.h"
+# 808 "mysql.h"
extern MYSQL_ROW_OFFSET mysql_stmt_row_tell(MYSQL_STMT * stmt);
-# 803 "mysql.h"
+# 797 "mysql.h"
extern my_bool mysql_stmt_send_long_data(MYSQL_STMT * stmt, unsigned int, char const * data, unsigned long int);
-# 811 "mysql.h"
+# 805 "mysql.h"
extern char const * mysql_stmt_sqlstate(MYSQL_STMT * stmt);
-# 790 "mysql.h"
+# 784 "mysql.h"
extern int mysql_stmt_store_result(MYSQL_STMT * stmt);
-# 441 "mysql.h"
+# 445 "mysql.h"
extern MYSQL_RES * mysql_store_result(MYSQL * mysql);
-# 393 "mysql.h"
+# 397 "mysql.h"
extern void mysql_thread_end(void);
-# 417 "mysql.h"
+# 421 "mysql.h"
extern unsigned long int mysql_thread_id(MYSQL * mysql);
-# 392 "mysql.h"
+# 396 "mysql.h"
extern my_bool mysql_thread_init(void);
-# 560 "mysql.h"
+# 554 "mysql.h"
extern unsigned int mysql_thread_safe(void);
-# 76 "mysql.h"
+# 79 "mysql.h"
extern char * mysql_unix_port;
-# 442 "mysql.h"
+# 446 "mysql.h"
extern MYSQL_RES * mysql_use_result(MYSQL * mysql);
-# 415 "mysql.h"
+# 419 "mysql.h"
extern unsigned int mysql_warning_count(MYSQL * mysql);
-# 339 "mysql_com.h"
-extern void net_clear(NET * net);
# 338 "mysql_com.h"
+extern void net_clear(NET * net);
+# 337 "mysql_com.h"
extern void net_end(NET * net);
-# 341 "mysql_com.h"
+# 340 "mysql_com.h"
extern my_bool net_flush(NET * net);
-# 346 "mysql_com.h"
+# 345 "mysql_com.h"
extern int net_real_write(NET * net, char const * packet, unsigned long int);
-# 340 "mysql_com.h"
+# 339 "mysql_com.h"
extern my_bool net_realloc(NET * net, unsigned long int);
-# 343 "mysql_com.h"
+# 342 "mysql_com.h"
extern my_bool net_write_command(NET * net, unsigned char, char const * header, unsigned long int, char const * packet, unsigned long int);
-# 427 "mysql_com.h"
+# 431 "mysql_com.h"
extern char * octet2hex(char * to, char const * str, unsigned int);
-# 408 "mysql_com.h"
+# 412 "mysql_com.h"
extern void randominit(struct rand_struct *, unsigned long int, unsigned long int);
-# 422 "mysql_com.h"
+# 426 "mysql_com.h"
extern void scramble(char * to, char const * message, char const * password);
-# 415 "mysql_com.h"
+# 419 "mysql_com.h"
extern void scramble_323(char * to, char const * message, char const * password);
-# 35 "typelib.h"
+# 34 "typelib.h"
extern TYPELIB sql_protocol_typelib;
diff --git a/include/mysql_version.h.in b/include/mysql_version.h.in
index dac7ca661d1..04a43f2c968 100644
--- a/include/mysql_version.h.in
+++ b/include/mysql_version.h.in
@@ -15,6 +15,7 @@
#define FRM_VER @DOT_FRM_VERSION@
#define MYSQL_VERSION_ID @MYSQL_VERSION_ID@
#define MYSQL_PORT @MYSQL_TCP_PORT@
+#define MYSQL_PORT_DEFAULT @MYSQL_TCP_PORT_DEFAULT@
#define MYSQL_UNIX_ADDR "@MYSQL_UNIX_ADDR@"
#define MYSQL_CONFIG_NAME "my"
#define MYSQL_COMPILATION_COMMENT "@COMPILATION_COMMENT@"
diff --git a/innobase/include/db0err.h b/innobase/include/db0err.h
index de5ac44e73f..247c5de67db 100644
--- a/innobase/include/db0err.h
+++ b/innobase/include/db0err.h
@@ -57,6 +57,18 @@ Created 5/24/1996 Heikki Tuuri
buffer pool (for big transactions,
InnoDB stores the lock structs in the
buffer pool) */
+#define DB_FOREIGN_DUPLICATE_KEY 46 /* foreign key constraints
+ activated by the operation would
+ lead to a duplicate key in some
+ table */
+#define DB_TOO_MANY_CONCURRENT_TRXS 47 /* when InnoDB runs out of the
+ preconfigured undo slots, this can
+ only happen when there are too many
+ concurrent transactions */
+#define DB_UNSUPPORTED 48 /* when InnoDB sees any artefact or
+ a feature that it can't recoginize or
+ work with e.g., FT indexes created by
+ a later version of the engine. */
/* The following are partial failure codes */
#define DB_FAIL 1000
diff --git a/innobase/include/os0sync.h b/innobase/include/os0sync.h
index d27b1676f1b..ef013bd1f2a 100644
--- a/innobase/include/os0sync.h
+++ b/innobase/include/os0sync.h
@@ -112,9 +112,13 @@ os_event_set(
os_event_t event); /* in: event to set */
/**************************************************************
Resets an event semaphore to the nonsignaled state. Waiting threads will
-stop to wait for the event. */
+stop to wait for the event.
+The return value should be passed to os_even_wait_low() if it is desired
+that this thread should not wait in case of an intervening call to
+os_event_set() between this os_event_reset() and the
+os_event_wait_low() call. See comments for os_event_wait_low(). */
-void
+ib_longlong
os_event_reset(
/*===========*/
os_event_t event); /* in: event to reset */
@@ -125,16 +129,38 @@ void
os_event_free(
/*==========*/
os_event_t event); /* in: event to free */
+
/**************************************************************
Waits for an event object until it is in the signaled state. If
srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS this also exits the
waiting thread when the event becomes signaled (or immediately if the
-event is already in the signaled state). */
+event is already in the signaled state).
+
+Typically, if the event has been signalled after the os_event_reset()
+we'll return immediately because event->is_set == TRUE.
+There are, however, situations (e.g.: sync_array code) where we may
+lose this information. For example:
+
+thread A calls os_event_reset()
+thread B calls os_event_set() [event->is_set == TRUE]
+thread C calls os_event_reset() [event->is_set == FALSE]
+thread A calls os_event_wait() [infinite wait!]
+thread C calls os_event_wait() [infinite wait!]
+
+Where such a scenario is possible, to avoid infinite wait, the
+value returned by os_event_reset() should be passed in as
+reset_sig_count. */
+
+#define os_event_wait(event) os_event_wait_low((event), 0)
void
-os_event_wait(
-/*==========*/
- os_event_t event); /* in: event to wait */
+os_event_wait_low(
+/*==============*/
+ os_event_t event, /* in: event to wait */
+ ib_longlong reset_sig_count);/* in: zero or the value
+ returned by previous call of
+ os_event_reset(). */
+
/**************************************************************
Waits for an event object until it is in the signaled state or
a timeout is exceeded. In Unix the timeout is always infinite. */
diff --git a/innobase/include/page0cur.h b/innobase/include/page0cur.h
index b03302b0e77..3a76c5e02ba 100644
--- a/innobase/include/page0cur.h
+++ b/innobase/include/page0cur.h
@@ -22,6 +22,7 @@ Created 10/4/1994 Heikki Tuuri
/* Page cursor search modes; the values must be in this order! */
+#define PAGE_CUR_UNSUPP 0
#define PAGE_CUR_G 1
#define PAGE_CUR_GE 2
#define PAGE_CUR_L 3
diff --git a/innobase/include/sync0rw.h b/innobase/include/sync0rw.h
index 4cd26ba1921..55eaf94bae4 100644
--- a/innobase/include/sync0rw.h
+++ b/innobase/include/sync0rw.h
@@ -418,6 +418,17 @@ field. Then no new readers are allowed in. */
struct rw_lock_struct {
os_event_t event; /* Used by sync0arr.c for thread queueing */
+
+#ifdef __WIN__
+ os_event_t wait_ex_event; /* This windows specific event is
+ used by the thread which has set the
+ lock state to RW_LOCK_WAIT_EX. The
+ rw_lock design guarantees that this
+ thread will be the next one to proceed
+ once the current the event gets
+ signalled. See LEMMA 2 in sync0sync.c */
+#endif
+
ulint reader_count; /* Number of readers who have locked this
lock in the shared mode */
ulint writer; /* This field is set to RW_LOCK_EX if there
diff --git a/innobase/include/sync0rw.ic b/innobase/include/sync0rw.ic
index 31a1ea6562a..5b65b57082f 100644
--- a/innobase/include/sync0rw.ic
+++ b/innobase/include/sync0rw.ic
@@ -382,6 +382,9 @@ rw_lock_s_unlock_func(
mutex_exit(mutex);
if (UNIV_UNLIKELY(sg)) {
+#ifdef __WIN__
+ os_event_set(lock->wait_ex_event);
+#endif
os_event_set(lock->event);
sync_array_object_signalled(sync_primary_wait_array);
}
@@ -463,6 +466,9 @@ rw_lock_x_unlock_func(
mutex_exit(&(lock->mutex));
if (UNIV_UNLIKELY(sg)) {
+#ifdef __WIN__
+ os_event_set(lock->wait_ex_event);
+#endif
os_event_set(lock->event);
sync_array_object_signalled(sync_primary_wait_array);
}
diff --git a/innobase/include/sync0sync.ic b/innobase/include/sync0sync.ic
index e5c6f56d8ba..ae807bbce4a 100644
--- a/innobase/include/sync0sync.ic
+++ b/innobase/include/sync0sync.ic
@@ -207,7 +207,7 @@ mutex_exit(
perform the read first, which could leave a waiting
thread hanging indefinitely.
- Our current solution call every 10 seconds
+ Our current solution call every second
sync_arr_wake_threads_if_sema_free()
to wake up possible hanging threads if
they are missed in mutex_signal_object. */
diff --git a/innobase/os/os0sync.c b/innobase/os/os0sync.c
index a3204a7b3e8..59195b03acf 100644
--- a/innobase/os/os0sync.c
+++ b/innobase/os/os0sync.c
@@ -151,7 +151,14 @@ os_event_create(
ut_a(0 == pthread_cond_init(&(event->cond_var), NULL));
#endif
event->is_set = FALSE;
- event->signal_count = 0;
+
+ /* We return this value in os_event_reset(), which can then be
+ be used to pass to the os_event_wait_low(). The value of zero
+ is reserved in os_event_wait_low() for the case when the
+ caller does not want to pass any signal_count value. To
+ distinguish between the two cases we initialize signal_count
+ to 1 here. */
+ event->signal_count = 1;
#endif /* __WIN__ */
/* The os_sync_mutex can be NULL because during startup an event
@@ -244,13 +251,20 @@ os_event_set(
/**************************************************************
Resets an event semaphore to the nonsignaled state. Waiting threads will
-stop to wait for the event. */
+stop to wait for the event.
+The return value should be passed to os_even_wait_low() if it is desired
+that this thread should not wait in case of an intervening call to
+os_event_set() between this os_event_reset() and the
+os_event_wait_low() call. See comments for os_event_wait_low(). */
-void
+ib_longlong
os_event_reset(
/*===========*/
+ /* out: current signal_count. */
os_event_t event) /* in: event to reset */
{
+ ib_longlong ret = 0;
+
#ifdef __WIN__
ut_a(event);
@@ -265,9 +279,11 @@ os_event_reset(
} else {
event->is_set = FALSE;
}
+ ret = event->signal_count;
os_fast_mutex_unlock(&(event->os_mutex));
#endif
+ return(ret);
}
/**************************************************************
@@ -335,18 +351,38 @@ os_event_free(
Waits for an event object until it is in the signaled state. If
srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS this also exits the
waiting thread when the event becomes signaled (or immediately if the
-event is already in the signaled state). */
+event is already in the signaled state).
+
+Typically, if the event has been signalled after the os_event_reset()
+we'll return immediately because event->is_set == TRUE.
+There are, however, situations (e.g.: sync_array code) where we may
+lose this information. For example:
+
+thread A calls os_event_reset()
+thread B calls os_event_set() [event->is_set == TRUE]
+thread C calls os_event_reset() [event->is_set == FALSE]
+thread A calls os_event_wait() [infinite wait!]
+thread C calls os_event_wait() [infinite wait!]
+
+Where such a scenario is possible, to avoid infinite wait, the
+value returned by os_event_reset() should be passed in as
+reset_sig_count. */
void
-os_event_wait(
-/*==========*/
- os_event_t event) /* in: event to wait */
+os_event_wait_low(
+/*==============*/
+ os_event_t event, /* in: event to wait */
+ ib_longlong reset_sig_count)/* in: zero or the value
+ returned by previous call of
+ os_event_reset(). */
{
#ifdef __WIN__
DWORD err;
ut_a(event);
+ UT_NOT_USED(reset_sig_count);
+
/* Specify an infinite time limit for waiting */
err = WaitForSingleObject(event->handle, INFINITE);
@@ -360,7 +396,11 @@ os_event_wait(
os_fast_mutex_lock(&(event->os_mutex));
- old_signal_count = event->signal_count;
+ if (reset_sig_count) {
+ old_signal_count = reset_sig_count;
+ } else {
+ old_signal_count = event->signal_count;
+ }
for (;;) {
if (event->is_set == TRUE
diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
index 31cd202e4d2..1227824ef80 100644
--- a/innobase/srv/srv0srv.c
+++ b/innobase/srv/srv0srv.c
@@ -1881,12 +1881,6 @@ loop:
os_thread_sleep(1000000);
- /* In case mutex_exit is not a memory barrier, it is
- theoretically possible some threads are left waiting though
- the semaphore is already released. Wake up those threads: */
-
- sync_arr_wake_threads_if_sema_free();
-
current_time = time(NULL);
time_elapsed = difftime(current_time, last_monitor_time);
@@ -2083,9 +2077,15 @@ loop:
srv_refresh_innodb_monitor_stats();
}
+ /* In case mutex_exit is not a memory barrier, it is
+ theoretically possible some threads are left waiting though
+ the semaphore is already released. Wake up those threads: */
+
+ sync_arr_wake_threads_if_sema_free();
+
if (sync_array_print_long_waits()) {
fatal_cnt++;
- if (fatal_cnt > 5) {
+ if (fatal_cnt > 10) {
fprintf(stderr,
"InnoDB: Error: semaphore wait has lasted > %lu seconds\n"
@@ -2103,7 +2103,7 @@ loop:
fflush(stderr);
- os_thread_sleep(2000000);
+ os_thread_sleep(1000000);
if (srv_shutdown_state < SRV_SHUTDOWN_CLEANUP) {
diff --git a/innobase/sync/sync0arr.c b/innobase/sync/sync0arr.c
index 64f9310bad3..504a877bcc2 100644
--- a/innobase/sync/sync0arr.c
+++ b/innobase/sync/sync0arr.c
@@ -40,7 +40,15 @@ because we can do with a very small number of OS events,
say 200. In NT 3.51, allocating events seems to be a quadratic
algorithm, because 10 000 events are created fast, but
100 000 events takes a couple of minutes to create.
-*/
+
+As of 5.0.30 the above mentioned design is changed. Since now
+OS can handle millions of wait events efficiently, we no longer
+have this concept of each cell of wait array having one event.
+Instead, now the event that a thread wants to wait on is embedded
+in the wait object (mutex or rw_lock). We still keep the global
+wait array for the sake of diagnostics and also to avoid infinite
+wait The error_monitor thread scans the global wait array to signal
+any waiting threads who have missed the signal. */
/* A cell where an individual thread may wait suspended
until a resource is released. The suspending is implemented
@@ -62,6 +70,14 @@ struct sync_cell_struct {
ibool waiting; /* TRUE if the thread has already
called sync_array_event_wait
on this cell */
+ ib_longlong signal_count; /* We capture the signal_count
+ of the wait_object when we
+ reset the event. This value is
+ then passed on to os_event_wait
+ and we wait only if the event
+ has not been signalled in the
+ period between the reset and
+ wait call. */
time_t reservation_time;/* time when the thread reserved
the wait cell */
};
@@ -216,6 +232,7 @@ sync_array_create(
cell = sync_array_get_nth_cell(arr, i);
cell->wait_object = NULL;
cell->waiting = FALSE;
+ cell->signal_count = 0;
}
return(arr);
@@ -282,16 +299,23 @@ sync_array_validate(
/***********************************************************************
Puts the cell event in reset state. */
static
-void
+ib_longlong
sync_cell_event_reset(
/*==================*/
+ /* out: value of signal_count
+ at the time of reset. */
ulint type, /* in: lock type mutex/rw_lock */
void* object) /* in: the rw_lock/mutex object */
{
if (type == SYNC_MUTEX) {
- os_event_reset(((mutex_t *) object)->event);
+ return(os_event_reset(((mutex_t *) object)->event));
+#ifdef __WIN__
+ } else if (type == RW_LOCK_WAIT_EX) {
+ return(os_event_reset(
+ ((rw_lock_t *) object)->wait_ex_event));
+#endif
} else {
- os_event_reset(((rw_lock_t *) object)->event);
+ return(os_event_reset(((rw_lock_t *) object)->event));
}
}
@@ -345,8 +369,11 @@ sync_array_reserve_cell(
sync_array_exit(arr);
- /* Make sure the event is reset */
- sync_cell_event_reset(type, object);
+ /* Make sure the event is reset and also store
+ the value of signal_count at which the event
+ was reset. */
+ cell->signal_count = sync_cell_event_reset(type,
+ object);
cell->reservation_time = time(NULL);
@@ -388,7 +415,14 @@ sync_array_wait_event(
if (cell->request_type == SYNC_MUTEX) {
event = ((mutex_t*) cell->wait_object)->event;
- } else {
+#ifdef __WIN__
+ /* On windows if the thread about to wait is the one which
+ has set the state of the rw_lock to RW_LOCK_WAIT_EX, then
+ it waits on a special event i.e.: wait_ex_event. */
+ } else if (cell->request_type == RW_LOCK_WAIT_EX) {
+ event = ((rw_lock_t*) cell->wait_object)->wait_ex_event;
+#endif
+ } else {
event = ((rw_lock_t*) cell->wait_object)->event;
}
@@ -413,7 +447,7 @@ sync_array_wait_event(
#endif
sync_array_exit(arr);
- os_event_wait(event);
+ os_event_wait_low(event, cell->signal_count);
sync_array_free_cell(arr, index);
}
@@ -457,7 +491,11 @@ sync_array_cell_print(
#endif /* UNIV_SYNC_DEBUG */
(ulong) mutex->waiters);
- } else if (type == RW_LOCK_EX || type == RW_LOCK_SHARED) {
+ } else if (type == RW_LOCK_EX
+#ifdef __WIN__
+ || type == RW_LOCK_WAIT_EX
+#endif
+ || type == RW_LOCK_SHARED) {
fputs(type == RW_LOCK_EX ? "X-lock on" : "S-lock on", file);
@@ -638,7 +676,8 @@ sync_array_detect_deadlock(
return(FALSE); /* No deadlock */
- } else if (cell->request_type == RW_LOCK_EX) {
+ } else if (cell->request_type == RW_LOCK_EX
+ || cell->request_type == RW_LOCK_WAIT_EX) {
lock = cell->wait_object;
@@ -734,7 +773,8 @@ sync_arr_cell_can_wake_up(
return(TRUE);
}
- } else if (cell->request_type == RW_LOCK_EX) {
+ } else if (cell->request_type == RW_LOCK_EX
+ || cell->request_type == RW_LOCK_WAIT_EX) {
lock = cell->wait_object;
@@ -783,6 +823,7 @@ sync_array_free_cell(
cell->waiting = FALSE;
cell->wait_object = NULL;
+ cell->signal_count = 0;
ut_a(arr->n_reserved > 0);
arr->n_reserved--;
@@ -839,6 +880,14 @@ sync_arr_wake_threads_if_sema_free(void)
mutex = cell->wait_object;
os_event_set(mutex->event);
+#ifdef __WIN__
+ } else if (cell->request_type
+ == RW_LOCK_WAIT_EX) {
+ rw_lock_t* lock;
+
+ lock = cell->wait_object;
+ os_event_set(lock->wait_ex_event);
+#endif
} else {
rw_lock_t* lock;
diff --git a/innobase/sync/sync0rw.c b/innobase/sync/sync0rw.c
index 629331d6049..337fd3d77fd 100644
--- a/innobase/sync/sync0rw.c
+++ b/innobase/sync/sync0rw.c
@@ -132,6 +132,10 @@ rw_lock_create_func(
lock->last_x_line = 0;
lock->event = os_event_create(NULL);
+#ifdef __WIN__
+ lock->wait_ex_event = os_event_create(NULL);
+#endif
+
mutex_enter(&rw_lock_list_mutex);
if (UT_LIST_GET_LEN(rw_lock_list) > 0) {
@@ -168,6 +172,10 @@ rw_lock_free(
mutex_enter(&rw_lock_list_mutex);
os_event_free(lock->event);
+#ifdef __WIN__
+ os_event_free(lock->wait_ex_event);
+#endif
+
if (UT_LIST_GET_PREV(list, lock)) {
ut_a(UT_LIST_GET_PREV(list, lock)->magic_n == RW_LOCK_MAGIC_N);
}
@@ -521,7 +529,15 @@ lock_loop:
rw_x_system_call_count++;
sync_array_reserve_cell(sync_primary_wait_array,
- lock, RW_LOCK_EX,
+ lock,
+#ifdef __WIN__
+ /* On windows RW_LOCK_WAIT_EX signifies
+ that this thread should wait on the
+ special wait_ex_event. */
+ (state == RW_LOCK_WAIT_EX)
+ ? RW_LOCK_WAIT_EX :
+#endif
+ RW_LOCK_EX,
file_name, line,
&index);
diff --git a/innobase/sync/sync0sync.c b/innobase/sync/sync0sync.c
index 25b7a5588d9..c98e38d5f27 100644
--- a/innobase/sync/sync0sync.c
+++ b/innobase/sync/sync0sync.c
@@ -95,17 +95,47 @@ have happened that the thread which was holding the mutex has just released
it and did not see the waiters byte set to 1, a case which would lead the
other thread to an infinite wait.
-LEMMA 1: After a thread resets the event of the cell it reserves for waiting
-========
-for a mutex, some thread will eventually call sync_array_signal_object with
-the mutex as an argument. Thus no infinite wait is possible.
+LEMMA 1: After a thread resets the event of a mutex (or rw_lock), some
+=======
+thread will eventually call os_event_set() on that particular event.
+Thus no infinite wait is possible in this case.
Proof: After making the reservation the thread sets the waiters field in the
mutex to 1. Then it checks that the mutex is still reserved by some thread,
or it reserves the mutex for itself. In any case, some thread (which may be
also some earlier thread, not necessarily the one currently holding the mutex)
will set the waiters field to 0 in mutex_exit, and then call
-sync_array_signal_object with the mutex as an argument.
+os_event_set() with the mutex as an argument.
+Q.E.D.
+
+LEMMA 2: If an os_event_set() call is made after some thread has called
+=======
+the os_event_reset() and before it starts wait on that event, the call
+will not be lost to the second thread. This is true even if there is an
+intervening call to os_event_reset() by another thread.
+Thus no infinite wait is possible in this case.
+
+Proof (non-windows platforms): os_event_reset() returns a monotonically
+increasing value of signal_count. This value is increased at every
+call of os_event_set() If thread A has called os_event_reset() followed
+by thread B calling os_event_set() and then some other thread C calling
+os_event_reset(), the is_set flag of the event will be set to FALSE;
+but now if thread A calls os_event_wait_low() with the signal_count
+value returned from the earlier call of os_event_reset(), it will
+return immediately without waiting.
+Q.E.D.
+
+Proof (windows): If there is a writer thread which is forced to wait for
+the lock, it may be able to set the state of rw_lock to RW_LOCK_WAIT_EX
+The design of rw_lock ensures that there is one and only one thread
+that is able to change the state to RW_LOCK_WAIT_EX and this thread is
+guaranteed to acquire the lock after it is released by the current
+holders and before any other waiter gets the lock.
+On windows this thread waits on a separate event i.e.: wait_ex_event.
+Since only one thread can wait on this event there is no chance
+of this event getting reset before the writer starts wait on it.
+Therefore, this thread is guaranteed to catch the os_set_event()
+signalled unconditionally at the release of the lock.
Q.E.D. */
ulint sync_dummy = 0;
diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt
index 59e70d68a6d..6efdd4afb90 100755
--- a/libmysql/CMakeLists.txt
+++ b/libmysql/CMakeLists.txt
@@ -74,7 +74,7 @@ SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c
../mysys/hash.c ../mysys/my_sleep.c ../mysys/default_modify.c
get_password.c ../strings/int2str.c ../strings/is_prefix.c
libmysql.c ../mysys/list.c ../strings/llstr.c
- ../strings/longlong2str.c manager.c ../mysys/mf_cache.c
+ ../strings/longlong2str.c manager.c ../mysys/mf_arr_appstr.c ../mysys/mf_cache.c
../mysys/mf_dirname.c ../mysys/mf_fn_ext.c ../mysys/mf_format.c
../mysys/mf_iocache.c ../mysys/mf_iocache2.c ../mysys/mf_loadpath.c
../mysys/mf_pack.c ../mysys/mf_path.c ../mysys/mf_tempfile.c ../mysys/mf_unixpath.c
@@ -96,7 +96,7 @@ SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c
../strings/strmov.c ../strings/strnlen.c ../strings/strnmov.c ../strings/strtod.c
../strings/strtoll.c ../strings/strtoull.c ../strings/strxmov.c ../strings/strxnmov.c
../mysys/thr_mutex.c ../mysys/typelib.c ../vio/vio.c ../vio/viosocket.c
- ../vio/viossl.c ../vio/viosslfactories.c ../strings/xml.c
+ ../vio/viossl.c ../vio/viosslfactories.c ../strings/xml.c ../mysys/mf_qsort.c
${LIB_SOURCES})
# Need to set USE_TLS for building the DLL, since __declspec(thread)
diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared
index dc6d658fcdf..ad0ac53cfba 100644
--- a/libmysql/Makefile.shared
+++ b/libmysql/Makefile.shared
@@ -59,7 +59,7 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \
mf_pack.lo my_messnc.lo mf_dirname.lo mf_fn_ext.lo\
mf_wcomp.lo typelib.lo safemalloc.lo my_alloc.lo \
mf_format.lo mf_path.lo mf_unixpath.lo my_fopen.lo \
- my_symlink.lo my_fstream.lo \
+ my_symlink.lo my_fstream.lo mf_arr_appstr.lo \
mf_loadpath.lo my_pthread.lo my_thr_init.lo \
thr_mutex.lo mulalloc.lo string.lo \
default.lo default_modify.lo \
@@ -73,7 +73,7 @@ sqlobjects = net.lo
sql_cmn_objects = pack.lo client.lo my_time.lo
# Not needed in the minimum library
-mysysobjects2 = my_lib.lo
+mysysobjects2 = my_lib.lo mf_qsort.lo
mysysobjects = $(mysysobjects1) $(mysysobjects2)
target_libadd = $(mysysobjects) $(mystringsobjects) $(dbugobjects) \
$(sql_cmn_objects) $(vio_objects) $(sqlobjects)
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 1c82a5152b4..4afc3ec5925 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -133,10 +133,23 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
{
struct servent *serv_ptr;
char *env;
- if ((serv_ptr = getservbyname("mysql", "tcp")))
- mysql_port = (uint) ntohs((ushort) serv_ptr->s_port);
- if ((env = getenv("MYSQL_TCP_PORT")))
- mysql_port =(uint) atoi(env);
+
+ /*
+ if builder specifically requested a default port, use that
+ (even if it coincides with our factory default).
+ only if they didn't do we check /etc/services (and, failing
+ on that, fall back to the factory default of 3306).
+ either default can be overridden by the environment variable
+ MYSQL_TCP_PORT, which in turn can be overridden with command
+ line options.
+ */
+
+#if MYSQL_PORT_DEFAULT == 0
+ if ((serv_ptr = getservbyname("mysql", "tcp")))
+ mysql_port = (uint) ntohs((ushort) serv_ptr->s_port);
+#endif
+ if ((env = getenv("MYSQL_TCP_PORT")))
+ mysql_port =(uint) atoi(env);
}
#endif
}
@@ -693,7 +706,8 @@ int cli_read_change_user_result(MYSQL *mysql, char *buff, const char *passwd)
my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
const char *passwd, const char *db)
{
- char buff[512],*end=buff;
+ char buff[USERNAME_LENGTH+SCRAMBLED_PASSWORD_CHAR_LENGTH+NAME_LEN+2];
+ char *end= buff;
int rc;
DBUG_ENTER("mysql_change_user");
@@ -703,7 +717,7 @@ my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
passwd="";
/* Store user into the buffer */
- end=strmov(end,user)+1;
+ end= strmake(end, user, USERNAME_LENGTH) + 1;
/* write scrambled password according to server capabilities */
if (passwd[0])
@@ -723,7 +737,7 @@ my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
else
*end++= '\0'; /* empty password */
/* Add database if needed */
- end= strmov(end, db ? db : "") + 1;
+ end= strmake(end, db ? db : "", NAME_LEN) + 1;
/* Write authentication package */
simple_command(mysql,COM_CHANGE_USER, buff,(ulong) (end-buff),1);
@@ -1603,78 +1617,6 @@ mysql_real_escape_string(MYSQL *mysql, char *to,const char *from,
return escape_string_for_mysql(mysql->charset, to, 0, from, length);
}
-
-char * STDCALL
-mysql_odbc_escape_string(MYSQL *mysql,
- char *to, ulong to_length,
- const char *from, ulong from_length,
- void *param,
- char * (*extend_buffer)
- (void *, char *, ulong *))
-{
- char *to_end=to+to_length-5;
- const char *end;
-#ifdef USE_MB
- my_bool use_mb_flag=use_mb(mysql->charset);
-#endif
-
- for (end=from+from_length; from != end ; from++)
- {
- if (to >= to_end)
- {
- to_length = (ulong) (end-from)+512; /* We want this much more */
- if (!(to=(*extend_buffer)(param, to, &to_length)))
- return to;
- to_end=to+to_length-5;
- }
-#ifdef USE_MB
- {
- int l;
- if (use_mb_flag && (l = my_ismbchar(mysql->charset, from, end)))
- {
- while (l--)
- *to++ = *from++;
- from--;
- continue;
- }
- }
-#endif
- switch (*from) {
- case 0: /* Must be escaped for 'mysql' */
- *to++= '\\';
- *to++= '0';
- break;
- case '\n': /* Must be escaped for logs */
- *to++= '\\';
- *to++= 'n';
- break;
- case '\r':
- *to++= '\\';
- *to++= 'r';
- break;
- case '\\':
- *to++= '\\';
- *to++= '\\';
- break;
- case '\'':
- *to++= '\\';
- *to++= '\'';
- break;
- case '"': /* Better safe than sorry */
- *to++= '\\';
- *to++= '"';
- break;
- case '\032': /* This gives problems on Win32 */
- *to++= '\\';
- *to++= 'Z';
- break;
- default:
- *to++= *from;
- }
- }
- return to;
-}
-
void STDCALL
myodbc_remove_escape(MYSQL *mysql,char *name)
{
@@ -3863,7 +3805,19 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
sprintf(buff, "%.*f", (int) field->decimals, value);
end= strend(buff);
}
- fetch_string_with_conversion(param, buff, (uint) (end - buff));
+
+ {
+ size_t length= end - buff;
+ if (field->flags & ZEROFILL_FLAG && length < field->length &&
+ field->length < MAX_DOUBLE_STRING_REP_LENGTH - 1)
+ {
+ bmove_upp((char*) buff + field->length, buff + length, length);
+ bfill((char*) buff, field->length - length, '0');
+ length= field->length;
+ }
+ fetch_string_with_conversion(param, buff, length);
+ }
+
break;
}
}
@@ -4355,6 +4309,7 @@ static my_bool setup_one_fetch_function(MYSQL_BIND *param, MYSQL_FIELD *field)
case MYSQL_TYPE_STRING:
case MYSQL_TYPE_DECIMAL:
case MYSQL_TYPE_NEWDECIMAL:
+ case MYSQL_TYPE_NEWDATE:
DBUG_ASSERT(param->buffer_length != 0);
param->fetch_result= fetch_result_str;
break;
@@ -4427,6 +4382,7 @@ static my_bool setup_one_fetch_function(MYSQL_BIND *param, MYSQL_FIELD *field)
case MYSQL_TYPE_VAR_STRING:
case MYSQL_TYPE_STRING:
case MYSQL_TYPE_BIT:
+ case MYSQL_TYPE_NEWDATE:
param->skip_result= skip_result_string;
break;
default:
@@ -4682,7 +4638,7 @@ int cli_read_binary_rows(MYSQL_STMT *stmt)
NET *net;
DBUG_ENTER("cli_read_binary_rows");
-
+
if (!mysql)
{
set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate);
diff --git a/libmysql/libmysql.def b/libmysql/libmysql.def
index 8c6b71d9553..81f86dc8726 100644
--- a/libmysql/libmysql.def
+++ b/libmysql/libmysql.def
@@ -78,7 +78,6 @@ EXPORTS
mysql_next_result
mysql_num_fields
mysql_num_rows
- mysql_odbc_escape_string
mysql_options
mysql_stmt_param_count
mysql_stmt_param_metadata
diff --git a/libmysqld/libmysqld.def b/libmysqld/libmysqld.def
index 8829112fefd..8aed164a30e 100644
--- a/libmysqld/libmysqld.def
+++ b/libmysqld/libmysqld.def
@@ -71,7 +71,6 @@ EXPORTS
mysql_next_result
mysql_num_fields
mysql_num_rows
- mysql_odbc_escape_string
mysql_options
mysql_ping
mysql_query
diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c
index 9f442148069..57de75ee4be 100644
--- a/myisam/ft_boolean_search.c
+++ b/myisam/ft_boolean_search.c
@@ -430,8 +430,8 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
ftb->list=(FTB_WORD **)alloc_root(&ftb->mem_root,
sizeof(FTB_WORD *)*ftb->queue.elements);
memcpy(ftb->list, ftb->queue.root+1, sizeof(FTB_WORD *)*ftb->queue.elements);
- qsort2(ftb->list, ftb->queue.elements, sizeof(FTB_WORD *),
- (qsort2_cmp)FTB_WORD_cmp_list, ftb->charset);
+ my_qsort2(ftb->list, ftb->queue.elements, sizeof(FTB_WORD *),
+ (qsort2_cmp)FTB_WORD_cmp_list, ftb->charset);
if (ftb->queue.elements<2) ftb->with_scan &= ~FTB_FLAG_TRUNC;
ftb->state=READY;
return ftb;
diff --git a/myisam/ft_nlq_search.c b/myisam/ft_nlq_search.c
index f63735b7e68..41d145c070f 100644
--- a/myisam/ft_nlq_search.c
+++ b/myisam/ft_nlq_search.c
@@ -281,7 +281,8 @@ FT_INFO *ft_init_nlq_search(MI_INFO *info, uint keynr, byte *query,
&dptr, left_root_right);
if (flags & FT_SORTED)
- qsort2(dlist->doc, dlist->ndocs, sizeof(FT_DOC), (qsort2_cmp)&FT_DOC_cmp, 0);
+ my_qsort2(dlist->doc, dlist->ndocs, sizeof(FT_DOC), (qsort2_cmp)&FT_DOC_cmp,
+ 0);
err:
delete_tree(&aio.dtree);
diff --git a/myisam/ft_parser.c b/myisam/ft_parser.c
index 6d68542e4e2..1d3a19dd8c6 100644
--- a/myisam/ft_parser.c
+++ b/myisam/ft_parser.c
@@ -188,7 +188,7 @@ byte ft_simple_get_word(CHARSET_INFO *cs, byte **start, const byte *end,
do
{
- for (;; doc+= mbl)
+ for (;; doc+= (mbl ? mbl : 1))
{
if (doc >= end) DBUG_RETURN(0);
if (true_word_char(cs, *doc)) break;
diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index ed0a84e737d..420bc974752 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -940,7 +940,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
ha_rows records,del_blocks;
my_off_t used,empty,pos,splits,start_recpos,
del_length,link_used,start_block;
- byte *record,*to;
+ byte *record= 0, *to;
char llbuff[22],llbuff2[22],llbuff3[22];
ha_checksum intern_record_checksum;
ha_checksum key_checksum[MI_MAX_POSSIBLE_KEY];
@@ -957,7 +957,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
puts("- check record links");
}
- if (!(record= (byte*) my_malloc(info->s->base.pack_reclength,MYF(0))))
+ if (!mi_alloc_rec_buff(info, -1, &record))
{
mi_check_print_error(param,"Not enough memory for record");
DBUG_RETURN(-1);
@@ -1364,17 +1364,150 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
printf("Lost space: %12s Linkdata: %10s\n",
llstr(empty,llbuff),llstr(link_used,llbuff2));
}
- my_free((gptr) record,MYF(0));
+ my_free(mi_get_rec_buff_ptr(info, record), MYF(0));
DBUG_RETURN (error);
err:
mi_check_print_error(param,"got error: %d when reading datafile at record: %s",my_errno, llstr(records,llbuff));
err2:
- my_free((gptr) record,MYF(0));
+ my_free(mi_get_rec_buff_ptr(info, record), MYF(0));
param->testflag|=T_RETRY_WITHOUT_QUICK;
DBUG_RETURN(1);
} /* chk_data_link */
+/**
+ @brief Drop all indexes
+
+ @param[in] param check parameters
+ @param[in] info MI_INFO handle
+ @param[in] force if to force drop all indexes
+
+ @return status
+ @retval 0 OK
+ @retval != 0 Error
+
+ @note
+ Once allocated, index blocks remain part of the key file forever.
+ When indexes are disabled, no block is freed. When enabling indexes,
+ no block is freed either. The new indexes are create from new
+ blocks. (Bug #4692)
+
+ Before recreating formerly disabled indexes, the unused blocks
+ must be freed. There are two options to do this:
+ - Follow the tree of disabled indexes, add all blocks to the
+ deleted blocks chain. Would require a lot of random I/O.
+ - Drop all blocks by clearing all index root pointers and all
+ delete chain pointers and resetting key_file_length to the end
+ of the index file header. This requires to recreate all indexes,
+ even those that may still be intact.
+ The second method is probably faster in most cases.
+
+ When disabling indexes, MySQL disables either all indexes or all
+ non-unique indexes. When MySQL [re-]enables disabled indexes
+ (T_CREATE_MISSING_KEYS), then we either have "lost" blocks in the
+ index file, or there are no non-unique indexes. In the latter case,
+ mi_repair*() would not be called as there would be no disabled
+ indexes.
+
+ If there would be more unique indexes than disabled (non-unique)
+ indexes, we could do the first method. But this is not implemented
+ yet. By now we drop and recreate all indexes when repair is called.
+
+ However, there is an exception. Sometimes MySQL disables non-unique
+ indexes when the table is empty (e.g. when copying a table in
+ mysql_alter_table()). When enabling the non-unique indexes, they
+ are still empty. So there is no index block that can be lost. This
+ optimization is implemented in this function.
+
+ Note that in normal repair (T_CREATE_MISSING_KEYS not set) we
+ recreate all enabled indexes unconditonally. We do not change the
+ key_map. Otherwise we invert the key map temporarily (outside of
+ this function) and recreate the then "seemingly" enabled indexes.
+ When we cannot use the optimization, and drop all indexes, we
+ pretend that all indexes were disabled. By the inversion, we will
+ then recrate all indexes.
+*/
+
+static int mi_drop_all_indexes(MI_CHECK *param, MI_INFO *info, my_bool force)
+{
+ MYISAM_SHARE *share= info->s;
+ MI_STATE_INFO *state= &share->state;
+ uint i;
+ int error;
+ DBUG_ENTER("mi_drop_all_indexes");
+
+ /*
+ If any of the disabled indexes has a key block assigned, we must
+ drop and recreate all indexes to avoid losing index blocks.
+
+ If we want to recreate disabled indexes only _and_ all of these
+ indexes are empty, we don't need to recreate the existing indexes.
+ */
+ if (!force && (param->testflag & T_CREATE_MISSING_KEYS))
+ {
+ DBUG_PRINT("repair", ("creating missing indexes"));
+ for (i= 0; i < share->base.keys; i++)
+ {
+ DBUG_PRINT("repair", ("index #: %u key_root: 0x%lx active: %d",
+ i, (long) state->key_root[i],
+ mi_is_key_active(state->key_map, i)));
+ if ((state->key_root[i] != HA_OFFSET_ERROR) &&
+ !mi_is_key_active(state->key_map, i))
+ {
+ /*
+ This index has at least one key block and it is disabled.
+ We would lose its block(s) if would just recreate it.
+ So we need to drop and recreate all indexes.
+ */
+ DBUG_PRINT("repair", ("nonempty and disabled: recreate all"));
+ break;
+ }
+ }
+ if (i >= share->base.keys)
+ {
+ /*
+ All of the disabled indexes are empty. We can just recreate them.
+ Flush dirty blocks of this index file from key cache and remove
+ all blocks of this index file from key cache.
+ */
+ DBUG_PRINT("repair", ("all disabled are empty: create missing"));
+ error= flush_key_blocks(share->key_cache, share->kfile,
+ FLUSH_FORCE_WRITE);
+ goto end;
+ }
+ /*
+ We do now drop all indexes and declare them disabled. With the
+ T_CREATE_MISSING_KEYS flag, mi_repair*() will recreate all
+ disabled indexes and enable them.
+ */
+ mi_clear_all_keys_active(state->key_map);
+ DBUG_PRINT("repair", ("declared all indexes disabled"));
+ }
+
+ /* Remove all key blocks of this index file from key cache. */
+ if ((error= flush_key_blocks(share->key_cache, share->kfile,
+ FLUSH_IGNORE_CHANGED)))
+ goto end; /* purecov: inspected */
+
+ /* Clear index root block pointers. */
+ for (i= 0; i < share->base.keys; i++)
+ state->key_root[i]= HA_OFFSET_ERROR;
+
+ /* Clear the delete chains. */
+ for (i= 0; i < state->header.max_block_size; i++)
+ state->key_del[i]= HA_OFFSET_ERROR;
+
+ /* Reset index file length to end of index file header. */
+ info->state->key_file_length= share->base.keystart;
+
+ DBUG_PRINT("repair", ("dropped all indexes"));
+ /* error= 0; set by last (error= flush_key_bocks()). */
+
+ end:
+ DBUG_RETURN(error);
+}
+
+
/* Recover old table by reading each record and writing all keys */
/* Save new datafile-name in temp_filename */
@@ -1382,7 +1515,6 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
my_string name, int rep_quick)
{
int error,got_error;
- uint i;
ha_rows start_records,new_header_length;
my_off_t del;
File new_file;
@@ -1428,8 +1560,7 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
MYF(MY_WME | MY_WAIT_IF_FULL)))
goto err;
info->opt_flag|=WRITE_CACHE_USED;
- if (!(sort_param.record=(byte*) my_malloc((uint) share->base.pack_reclength,
- MYF(0))) ||
+ if (!mi_alloc_rec_buff(info, -1, &sort_param.record) ||
!mi_alloc_rec_buff(info, -1, &sort_param.rec_buff))
{
mi_check_print_error(param, "Not enough memory for extra record");
@@ -1486,25 +1617,10 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
info->update= (short) (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
- /*
- Clear all keys. Note that all key blocks allocated until now remain
- "dead" parts of the key file. (Bug #4692)
- */
- for (i=0 ; i < info->s->base.keys ; i++)
- share->state.key_root[i]= HA_OFFSET_ERROR;
-
- /* Drop the delete chain. */
- for (i=0 ; i < share->state.header.max_block_size ; i++)
- share->state.key_del[i]= HA_OFFSET_ERROR;
-
- /*
- If requested, activate (enable) all keys in key_map. In this case,
- all indexes will be (re-)built.
- */
+ /* This function always recreates all enabled indexes. */
if (param->testflag & T_CREATE_MISSING_KEYS)
mi_set_all_keys_active(share->state.key_map, share->base.keys);
-
- info->state->key_file_length=share->base.keystart;
+ mi_drop_all_indexes(param, info, TRUE);
lock_memory(param); /* Everything is alloced */
@@ -1636,7 +1752,8 @@ err:
}
my_free(mi_get_rec_buff_ptr(info, sort_param.rec_buff),
MYF(MY_ALLOW_ZERO_PTR));
- my_free(sort_param.record,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(mi_get_rec_buff_ptr(info, sort_param.record),
+ MYF(MY_ALLOW_ZERO_PTR));
my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR));
VOID(end_io_cache(&param->read_cache));
info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
@@ -2105,8 +2222,9 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
ulong *rec_per_key_part;
char llbuff[22];
SORT_INFO sort_info;
- ulonglong key_map=share->state.key_map;
+ ulonglong key_map;
DBUG_ENTER("mi_repair_by_sort");
+ LINT_INIT(key_map);
start_records=info->state->records;
got_error=1;
@@ -2142,8 +2260,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
info->opt_flag|=WRITE_CACHE_USED;
info->rec_cache.file=info->dfile; /* for sort_delete_record */
- if (!(sort_param.record=(byte*) my_malloc((uint) share->base.pack_reclength,
- MYF(0))) ||
+ if (!mi_alloc_rec_buff(info, -1, &sort_param.record) ||
!mi_alloc_rec_buff(info, -1, &sort_param.rec_buff))
{
mi_check_print_error(param, "Not enough memory for extra record");
@@ -2179,25 +2296,14 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
}
info->update= (short) (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
- if (!(param->testflag & T_CREATE_MISSING_KEYS))
- {
- /*
- Flush key cache for this file if we are calling this outside
- myisamchk
- */
- flush_key_blocks(share->key_cache,share->kfile, FLUSH_IGNORE_CHANGED);
- /* Clear the pointers to the given rows */
- for (i=0 ; i < share->base.keys ; i++)
- share->state.key_root[i]= HA_OFFSET_ERROR;
- for (i=0 ; i < share->state.header.max_block_size ; i++)
- share->state.key_del[i]= HA_OFFSET_ERROR;
- info->state->key_file_length=share->base.keystart;
- }
- else
+
+ /* Optionally drop indexes and optionally modify the key_map. */
+ mi_drop_all_indexes(param, info, FALSE);
+ key_map= share->state.key_map;
+ if (param->testflag & T_CREATE_MISSING_KEYS)
{
- if (flush_key_blocks(share->key_cache,share->kfile, FLUSH_FORCE_WRITE))
- goto err;
- key_map= ~key_map; /* Create the missing keys */
+ /* Invert the copied key_map to recreate all disabled indexes. */
+ key_map= ~key_map;
}
sort_info.info=info;
@@ -2240,6 +2346,10 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
sort_param.read_cache=param->read_cache;
sort_param.keyinfo=share->keyinfo+sort_param.key;
sort_param.seg=sort_param.keyinfo->seg;
+ /*
+ Skip this index if it is marked disabled in the copied
+ (and possibly inverted) key_map.
+ */
if (! mi_is_key_active(key_map, sort_param.key))
{
/* Remember old statistics for key */
@@ -2247,6 +2357,8 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
(char*) (share->state.rec_per_key_part +
(uint) (rec_per_key_part - param->rec_per_key_part)),
sort_param.keyinfo->keysegs*sizeof(*rec_per_key_part));
+ DBUG_PRINT("repair", ("skipping seemingly disabled index #: %u",
+ sort_param.key));
continue;
}
@@ -2302,8 +2414,11 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
if (param->testflag & T_STATISTICS)
update_key_parts(sort_param.keyinfo, rec_per_key_part, sort_param.unique,
param->stats_method == MI_STATS_METHOD_IGNORE_NULLS?
- sort_param.notnull: NULL,(ulonglong) info->state->records);
+ sort_param.notnull: NULL,
+ (ulonglong) info->state->records);
+ /* Enable this index in the permanent (not the copied) key_map. */
mi_set_key_active(share->state.key_map, sort_param.key);
+ DBUG_PRINT("repair", ("set enabled index #: %u", sort_param.key));
if (sort_param.fix_datafile)
{
@@ -2428,7 +2543,8 @@ err:
my_free(mi_get_rec_buff_ptr(info, sort_param.rec_buff),
MYF(MY_ALLOW_ZERO_PTR));
- my_free(sort_param.record,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(mi_get_rec_buff_ptr(info, sort_param.record),
+ MYF(MY_ALLOW_ZERO_PTR));
my_free((gptr) sort_info.key_block,MYF(MY_ALLOW_ZERO_PTR));
my_free((gptr) sort_info.ft_buf, MYF(MY_ALLOW_ZERO_PTR));
my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR));
@@ -2504,9 +2620,11 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
IO_CACHE new_data_cache; /* For non-quick repair. */
IO_CACHE_SHARE io_share;
SORT_INFO sort_info;
- ulonglong key_map=share->state.key_map;
+ ulonglong key_map;
pthread_attr_t thr_attr;
+ ulong max_pack_reclength;
DBUG_ENTER("mi_repair_parallel");
+ LINT_INIT(key_map);
start_records=info->state->records;
got_error=1;
@@ -2608,25 +2726,14 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
}
info->update= (short) (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
- if (!(param->testflag & T_CREATE_MISSING_KEYS))
- {
- /*
- Flush key cache for this file if we are calling this outside
- myisamchk
- */
- flush_key_blocks(share->key_cache,share->kfile, FLUSH_IGNORE_CHANGED);
- /* Clear the pointers to the given rows */
- for (i=0 ; i < share->base.keys ; i++)
- share->state.key_root[i]= HA_OFFSET_ERROR;
- for (i=0 ; i < share->state.header.max_block_size ; i++)
- share->state.key_del[i]= HA_OFFSET_ERROR;
- info->state->key_file_length=share->base.keystart;
- }
- else
+
+ /* Optionally drop indexes and optionally modify the key_map. */
+ mi_drop_all_indexes(param, info, FALSE);
+ key_map= share->state.key_map;
+ if (param->testflag & T_CREATE_MISSING_KEYS)
{
- if (flush_key_blocks(share->key_cache,share->kfile, FLUSH_FORCE_WRITE))
- goto err;
- key_map= ~key_map; /* Create the missing keys */
+ /* Invert the copied key_map to recreate all disabled indexes. */
+ key_map= ~key_map;
}
sort_info.info=info;
@@ -2662,10 +2769,13 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
del=info->state->del;
param->glob_crc=0;
-
+ /* for compressed tables */
+ max_pack_reclength= share->base.pack_reclength;
+ if (share->options & HA_OPTION_COMPRESS_RECORD)
+ set_if_bigger(max_pack_reclength, share->max_pack_length);
if (!(sort_param=(MI_SORT_PARAM *)
my_malloc((uint) share->base.keys *
- (sizeof(MI_SORT_PARAM) + share->base.pack_reclength),
+ (sizeof(MI_SORT_PARAM) + max_pack_reclength),
MYF(MY_ZEROFILL))))
{
mi_check_print_error(param,"Not enough memory for key!");
@@ -2682,6 +2792,10 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
sort_param[i].key=key;
sort_param[i].keyinfo=share->keyinfo+key;
sort_param[i].seg=sort_param[i].keyinfo->seg;
+ /*
+ Skip this index if it is marked disabled in the copied
+ (and possibly inverted) key_map.
+ */
if (! mi_is_key_active(key_map, key))
{
/* Remember old statistics for key */
@@ -2717,7 +2831,7 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
sort_param[i].max_pos=sort_param[i].pos=share->pack.header_length;
sort_param[i].record= (((char *)(sort_param+share->base.keys))+
- (share->base.pack_reclength * i));
+ (max_pack_reclength * i));
if (!mi_alloc_rec_buff(info, -1, &sort_param[i].rec_buff))
{
mi_check_print_error(param,"Not enough memory!");
@@ -4333,7 +4447,7 @@ err:
void update_auto_increment_key(MI_CHECK *param, MI_INFO *info,
my_bool repair_only)
{
- byte *record;
+ byte *record= 0;
DBUG_ENTER("update_auto_increment_key");
if (!info->s->base.auto_key ||
@@ -4352,8 +4466,7 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info,
We have to use an allocated buffer instead of info->rec_buff as
_mi_put_key_in_record() may use info->rec_buff
*/
- if (!(record= (byte*) my_malloc((uint) info->s->base.pack_reclength,
- MYF(0))))
+ if (!mi_alloc_rec_buff(info, -1, &record))
{
mi_check_print_error(param,"Not enough memory for extra record");
DBUG_VOID_RETURN;
@@ -4365,7 +4478,7 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info,
if (my_errno != HA_ERR_END_OF_FILE)
{
mi_extra(info,HA_EXTRA_NO_KEYREAD,0);
- my_free((char*) record, MYF(0));
+ my_free(mi_get_rec_buff_ptr(info, record), MYF(0));
mi_check_print_error(param,"%d when reading last record",my_errno);
DBUG_VOID_RETURN;
}
@@ -4380,7 +4493,7 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info,
set_if_bigger(info->s->state.auto_increment, param->auto_increment_value);
}
mi_extra(info,HA_EXTRA_NO_KEYREAD,0);
- my_free((char*) record, MYF(0));
+ my_free(mi_get_rec_buff_ptr(info, record), MYF(0));
update_state_info(param, info, UPDATE_AUTO_INC);
DBUG_VOID_RETURN;
}
diff --git a/myisam/mi_dynrec.c b/myisam/mi_dynrec.c
index 11f51f08d23..67d40ec50bf 100644
--- a/myisam/mi_dynrec.c
+++ b/myisam/mi_dynrec.c
@@ -144,6 +144,29 @@ static int write_dynamic_record(MI_INFO *info, const byte *record,
DBUG_ENTER("write_dynamic_record");
flag=0;
+
+ /*
+ Check if we have enough room for the new record.
+ First we do simplified check to make usual case faster.
+ Then we do more precise check for the space left.
+ Though it still is not absolutely precise, as
+ we always use MI_MAX_DYN_BLOCK_HEADER while it can be
+ less in the most of the cases.
+ */
+
+ if (unlikely(info->s->base.max_data_file_length -
+ info->state->data_file_length <
+ reclength + MI_MAX_DYN_BLOCK_HEADER))
+ {
+ if (info->s->base.max_data_file_length - info->state->data_file_length +
+ info->state->empty - info->state->del * MI_MAX_DYN_BLOCK_HEADER <
+ reclength + MI_MAX_DYN_BLOCK_HEADER)
+ {
+ my_errno=HA_ERR_RECORD_FILE_FULL;
+ DBUG_RETURN(1);
+ }
+ }
+
do
{
if (_mi_find_writepos(info,reclength,&filepos,&length))
@@ -580,6 +603,51 @@ static int update_dynamic_record(MI_INFO *info, my_off_t filepos, byte *record,
DBUG_ENTER("update_dynamic_record");
flag=block_info.second_read=0;
+ /*
+ Check if we have enough room for the record.
+ First we do simplified check to make usual case faster.
+ Then we do more precise check for the space left.
+ Though it still is not absolutely precise, as
+ we always use MI_MAX_DYN_BLOCK_HEADER while it can be
+ less in the most of the cases.
+ */
+
+ /*
+ compare with just the reclength as we're going
+ to get some space from the old replaced record
+ */
+ if (unlikely(info->s->base.max_data_file_length -
+ info->state->data_file_length < reclength))
+ {
+ /*
+ let's read the old record's block to find out the length of the
+ old record
+ */
+ if ((error=_mi_get_block_info(&block_info,info->dfile,filepos))
+ & (BLOCK_DELETED | BLOCK_ERROR | BLOCK_SYNC_ERROR | BLOCK_FATAL_ERROR))
+ {
+ DBUG_PRINT("error",("Got wrong block info"));
+ if (!(error & BLOCK_FATAL_ERROR))
+ my_errno=HA_ERR_WRONG_IN_RECORD;
+ goto err;
+ }
+
+ /*
+ if new record isn't longer, we can go on safely
+ */
+ if (block_info.rec_len < reclength)
+ {
+ if (info->s->base.max_data_file_length - info->state->data_file_length +
+ info->state->empty - info->state->del * MI_MAX_DYN_BLOCK_HEADER <
+ reclength - block_info.rec_len + MI_MAX_DYN_BLOCK_HEADER)
+ {
+ my_errno=HA_ERR_RECORD_FILE_FULL;
+ goto err;
+ }
+ }
+ block_info.second_read=0;
+ }
+
while (reclength > 0)
{
if (filepos != info->s->state.dellink)
diff --git a/myisam/mi_open.c b/myisam/mi_open.c
index b4b41b81815..172f282e049 100644
--- a/myisam/mi_open.c
+++ b/myisam/mi_open.c
@@ -675,8 +675,11 @@ byte *mi_alloc_rec_buff(MI_INFO *info, ulong length, byte **buf)
/* to simplify initial init of info->rec_buf in mi_open and mi_extra */
if (length == (ulong) -1)
{
- length= max(info->s->base.pack_reclength,
- info->s->base.max_key_length);
+ if (info->s->options & HA_OPTION_COMPRESS_RECORD)
+ length= max(info->s->base.pack_reclength, info->s->max_pack_length);
+ else
+ length= info->s->base.pack_reclength;
+ length= max(length, info->s->base.max_key_length);
/* Avoid unnecessary realloc */
if (newptr && length == old_length)
return newptr;
diff --git a/myisam/mi_packrec.c b/myisam/mi_packrec.c
index 0bd13d228d1..81fc4d046e7 100644
--- a/myisam/mi_packrec.c
+++ b/myisam/mi_packrec.c
@@ -165,7 +165,6 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys)
share->pack.header_length= uint4korr(header+4);
share->min_pack_length=(uint) uint4korr(header+8);
share->max_pack_length=(uint) uint4korr(header+12);
- set_if_bigger(share->base.pack_reclength,share->max_pack_length);
elements=uint4korr(header+16);
intervall_length=uint4korr(header+20);
trees=uint2korr(header+24);
@@ -564,7 +563,7 @@ static void fill_quick_table(uint16 *table, uint bits, uint max_bits,
*/
value|= (max_bits - bits) << 8 | IS_CHAR;
- for (end= table + ((uint) 1 << bits); table < end; table++)
+ for (end= table + ((my_ptrdiff_t) 1 << bits); table < end; table++)
{
*table= (uint16) value;
}
diff --git a/myisam/mi_write.c b/myisam/mi_write.c
index cc17d4c6165..967fbdc2330 100644
--- a/myisam/mi_write.c
+++ b/myisam/mi_write.c
@@ -975,7 +975,7 @@ int mi_init_bulk_insert(MI_INFO *info, ulong cache_size, ha_rows rows)
DBUG_RETURN(0);
if (rows && rows*total_keylength < cache_size)
- cache_size=rows;
+ cache_size= (ulong)rows;
else
cache_size/=total_keylength*16;
diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c
index d0117e12ede..d421bbc92ed 100644
--- a/myisam/myisamchk.c
+++ b/myisam/myisamchk.c
@@ -1543,8 +1543,8 @@ static int mi_sort_records(MI_CHECK *param,
mi_check_print_error(param,"Not enough memory for key block");
goto err;
}
- if (!(sort_param.record=(byte*) my_malloc((uint) share->base.pack_reclength,
- MYF(0))))
+
+ if (!mi_alloc_rec_buff(info, -1, &sort_param.record))
{
mi_check_print_error(param,"Not enough memory for record");
goto err;
@@ -1639,7 +1639,8 @@ err:
{
my_afree((gptr) temp_buff);
}
- my_free(sort_param.record,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(mi_get_rec_buff_ptr(info, sort_param.record),
+ MYF(MY_ALLOW_ZERO_PTR));
info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
VOID(end_io_cache(&info->rec_cache));
my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR));
diff --git a/myisam/myisampack.c b/myisam/myisampack.c
index 4ead51639f3..fa58211ea88 100644
--- a/myisam/myisampack.c
+++ b/myisam/myisampack.c
@@ -3148,7 +3148,7 @@ static void fakebigcodes(HUFF_COUNTS *huff_counts, HUFF_COUNTS *end_count)
cur_sort_p= sort_counts;
while (cur_count_p < end_count_p)
*(cur_sort_p++)= cur_count_p++;
- (void) qsort(sort_counts, 256, sizeof(my_off_t*), (qsort_cmp) fakecmp);
+ (void) my_qsort(sort_counts, 256, sizeof(my_off_t*), (qsort_cmp) fakecmp);
/*
Assign faked counts.
diff --git a/myisam/rt_index.c b/myisam/rt_index.c
index cf144839dd1..8ecb3688ad5 100644
--- a/myisam/rt_index.c
+++ b/myisam/rt_index.c
@@ -483,15 +483,16 @@ static uchar *rtree_pick_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key,
uint key_length, uchar *page_buf, uint nod_flag)
{
double increase;
- double best_incr = DBL_MAX;
+ double best_incr;
double area;
double best_area;
- uchar *best_key;
+ uchar *best_key= NULL;
uchar *k = rt_PAGE_FIRST_KEY(page_buf, nod_flag);
uchar *last = rt_PAGE_END(page_buf);
LINT_INIT(best_area);
LINT_INIT(best_key);
+ LINT_INIT(best_incr);
for (; k < last; k = rt_PAGE_NEXT_KEY(k, key_length, nod_flag))
{
@@ -500,22 +501,13 @@ static uchar *rtree_pick_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key,
&area)) == -1.0)
return NULL;
/* The following should be safe, even if we compare doubles */
- if (increase < best_incr)
+ if (!best_key || increase < best_incr ||
+ ((increase == best_incr) && (area < best_area)))
{
best_key = k;
best_area = area;
best_incr = increase;
}
- else
- {
- /* The following should be safe, even if we compare doubles */
- if ((increase == best_incr) && (area < best_area))
- {
- best_key = k;
- best_area = area;
- best_incr = increase;
- }
- }
}
return best_key;
}
diff --git a/myisam/rt_mbr.c b/myisam/rt_mbr.c
index 1855e24feb0..deca23bbec7 100644
--- a/myisam/rt_mbr.c
+++ b/myisam/rt_mbr.c
@@ -523,7 +523,10 @@ double rtree_overlapping_area(HA_KEYSEG *keyseg, uchar* a, uchar* b,
}
/*
-Calculates MBR_AREA(a+b) - MBR_AREA(a)
+ Calculates MBR_AREA(a+b) - MBR_AREA(a)
+ Note: when 'a' and 'b' objects are far from each other,
+ the area increase can be really big, so this function
+ can return 'inf' as a result.
*/
double rtree_area_increase(HA_KEYSEG *keyseg, uchar* a, uchar* b,
uint key_length, double *ab_area)
diff --git a/myisam/sort.c b/myisam/sort.c
index f48161b7c8e..2465227a449 100644
--- a/myisam/sort.c
+++ b/myisam/sort.c
@@ -141,7 +141,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
if ((records < UINT_MAX32) &&
((my_off_t) (records + 1) *
(sort_length + sizeof(char*)) <= (my_off_t) memavl))
- keys= records+1;
+ keys= (uint)records+1;
else
do
{
@@ -349,7 +349,7 @@ pthread_handler_t thr_find_all_keys(void *arg)
sort_keys= (uchar **) NULL;
memavl= max(sort_param->sortbuff_size, MIN_SORT_MEMORY);
- idx= sort_param->sort_info->max_records;
+ idx= (uint)sort_param->sort_info->max_records;
sort_length= sort_param->key_length;
maxbuffer= 1;
@@ -565,9 +565,10 @@ int thr_write_keys(MI_SORT_PARAM *sort_param)
if (!mergebuf)
{
length=param->sort_buffer_length;
- while (length >= MIN_SORT_MEMORY && !mergebuf)
+ while (length >= MIN_SORT_MEMORY)
{
- mergebuf=my_malloc(length, MYF(0));
+ if ((mergebuf= my_malloc(length, MYF(0))))
+ break;
length=length*3/4;
}
if (!mergebuf)
@@ -649,8 +650,8 @@ static int NEAR_F write_keys(MI_SORT_PARAM *info, register uchar **sort_keys,
uint sort_length=info->key_length;
DBUG_ENTER("write_keys");
- qsort2((byte*) sort_keys,count,sizeof(byte*),(qsort2_cmp) info->key_cmp,
- info);
+ my_qsort2((byte*) sort_keys,count,sizeof(byte*),(qsort2_cmp) info->key_cmp,
+ info);
if (!my_b_inited(tempfile) &&
open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST",
DISK_BUFFER_SIZE, info->sort_info->param->myf_rw))
@@ -692,8 +693,8 @@ static int NEAR_F write_keys_varlen(MI_SORT_PARAM *info,
int err;
DBUG_ENTER("write_keys_varlen");
- qsort2((byte*) sort_keys,count,sizeof(byte*),(qsort2_cmp) info->key_cmp,
- info);
+ my_qsort2((byte*) sort_keys,count,sizeof(byte*),(qsort2_cmp) info->key_cmp,
+ info);
if (!my_b_inited(tempfile) &&
open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST",
DISK_BUFFER_SIZE, info->sort_info->param->myf_rw))
@@ -735,8 +736,8 @@ static int NEAR_F write_index(MI_SORT_PARAM *info, register uchar **sort_keys,
{
DBUG_ENTER("write_index");
- qsort2((gptr) sort_keys,(size_t) count,sizeof(byte*),
- (qsort2_cmp) info->key_cmp,info);
+ my_qsort2((gptr) sort_keys,(size_t) count,sizeof(byte*),
+ (qsort2_cmp) info->key_cmp,info);
while (count--)
{
if ((*info->key_write)(info,*sort_keys++))
@@ -905,6 +906,7 @@ merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
count=error=0;
maxcount=keys/((uint) (Tb-Fb) +1);
+ DBUG_ASSERT(maxcount > 0);
LINT_INIT(to_start_filepos);
if (to_file)
to_start_filepos=my_b_tell(to_file);
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
index cbc3e754312..75d00457d14 100644
--- a/mysql-test/Makefile.am
+++ b/mysql-test/Makefile.am
@@ -139,6 +139,7 @@ SUFFIXES = .sh
-e 's!@''PERL''@!@PERL@!' \
-e 's!@''VERSION''@!@VERSION@!' \
-e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \
+ -e 's!@''MYSQL_TCP_PORT_DEFAULT''@!@MYSQL_TCP_PORT_DEFAULT@!' \
-e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \
-e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \
-e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \
diff --git a/mysql-test/include/ctype_common.inc b/mysql-test/include/ctype_common.inc
index 202c508a9c9..9ee0a40c8ce 100644
--- a/mysql-test/include/ctype_common.inc
+++ b/mysql-test/include/ctype_common.inc
@@ -51,6 +51,15 @@ SELECT c1 as want1result from t1 where c1 like 'locatio%';
SELECT c1 as want1result from t1 where c1 like 'location%';
DROP TABLE t1;
+#
+# Bug #31070: crash during conversion of charsets
+#
+create table t1 (a set('a') not null);
+insert into t1 values (),();
+select cast(a as char(1)) from t1;
+select a sounds like a from t1;
+drop table t1;
+
DROP DATABASE d1;
# Restore settings
USE test;
diff --git a/mysql-test/include/ctype_regex.inc b/mysql-test/include/ctype_regex.inc
new file mode 100644
index 00000000000..0e6b4c41607
--- /dev/null
+++ b/mysql-test/include/ctype_regex.inc
@@ -0,0 +1,42 @@
+#
+# To test a desired collation, set session.collation_connection to
+# this collation before including this file
+#
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+#
+# Create a table with two varchar(64) null-able column,
+# using current values of
+# @@character_set_connection and @@collation_connection.
+#
+
+create table t1 as
+select repeat(' ', 64) as s1, repeat(' ',64) as s2
+union
+select null, null;
+show create table t1;
+delete from t1;
+
+insert into t1 values('aaa','aaa');
+insert into t1 values('aaa|qqq','qqq');
+insert into t1 values('gheis','^[^a-dXYZ]+$');
+insert into t1 values('aab','^aa?b');
+insert into t1 values('Baaan','^Ba*n');
+insert into t1 values('aaa','qqq|aaa');
+insert into t1 values('qqq','qqq|aaa');
+
+insert into t1 values('bbb','qqq|aaa');
+insert into t1 values('bbb','qqq');
+insert into t1 values('aaa','aba');
+
+insert into t1 values(null,'abc');
+insert into t1 values('def',null);
+insert into t1 values(null,null);
+insert into t1 values('ghi','ghi[');
+
+select HIGH_PRIORITY s1 regexp s2 from t1;
+
+drop table t1;
diff --git a/mysql-test/include/gis_keys.inc b/mysql-test/include/gis_keys.inc
new file mode 100644
index 00000000000..c75311f062a
--- /dev/null
+++ b/mysql-test/include/gis_keys.inc
@@ -0,0 +1,46 @@
+--source include/have_geometry.inc
+
+#
+# Spatial objects with keys
+#
+
+#
+# Bug #30825: Problems when putting a non-spatial index on a GIS column
+#
+
+CREATE TABLE t1 (p POINT);
+CREATE TABLE t2 (p POINT, INDEX(p));
+INSERT INTO t1 VALUES (POINTFROMTEXT('POINT(1 2)'));
+INSERT INTO t2 VALUES (POINTFROMTEXT('POINT(1 2)'));
+
+# no index, returns 1 as expected
+SELECT COUNT(*) FROM t1 WHERE p=POINTFROMTEXT('POINT(1 2)');
+
+# with index, returns 1 as expected
+# EXPLAIN shows that the index is not used though
+# due to the "most rows covered anyway, so a scan is more effective" rule
+EXPLAIN
+SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
+SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
+
+# adding another row to the table so that
+# the "most rows covered" rule doesn't kick in anymore
+# now EXPLAIN shows the index used on the table
+# and we're getting the wrong result again
+INSERT INTO t1 VALUES (POINTFROMTEXT('POINT(1 2)'));
+INSERT INTO t2 VALUES (POINTFROMTEXT('POINT(1 2)'));
+EXPLAIN
+SELECT COUNT(*) FROM t1 WHERE p=POINTFROMTEXT('POINT(1 2)');
+SELECT COUNT(*) FROM t1 WHERE p=POINTFROMTEXT('POINT(1 2)');
+
+EXPLAIN
+SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
+SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
+
+EXPLAIN
+SELECT COUNT(*) FROM t2 IGNORE INDEX(p) WHERE p=POINTFROMTEXT('POINT(1 2)');
+SELECT COUNT(*) FROM t2 IGNORE INDEX(p) WHERE p=POINTFROMTEXT('POINT(1 2)');
+
+DROP TABLE t1, t2;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/include/windows.inc b/mysql-test/include/windows.inc
index 05ec7b0e021..88553d8aa59 100644
--- a/mysql-test/include/windows.inc
+++ b/mysql-test/include/windows.inc
@@ -1,4 +1,5 @@
---require r/true.require
-disable_query_log;
-select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") as "TRUE";
-enable_query_log;
+if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") = 0`)
+{
+ skip Need windows;
+}
+
diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl
index 5e176dce109..b9943fb6cfa 100644
--- a/mysql-test/lib/mtr_cases.pl
+++ b/mysql-test/lib/mtr_cases.pl
@@ -27,6 +27,24 @@ sub collect_one_test_case ($$$$$$$);
sub mtr_options_from_test_file($$);
+my $do_test;
+my $skip_test;
+
+sub init_pattern {
+ my ($from, $what)= @_;
+ if ( $from =~ /^[a-z0-9]$/ ) {
+ # Does not contain any regex, make the pattern match
+ # beginning of string
+ $from= "^$from";
+ }
+ # Check that pattern is a valid regex
+ eval { "" =~/$from/; 1 } or
+ mtr_error("Invalid regex '$from' passed to $what\nPerl says: $@");
+ return $from;
+}
+
+
+
##############################################################################
#
# Collect information about test cases we are to run
@@ -39,6 +57,9 @@ sub collect_test_cases ($) {
my $testdir;
my $resdir;
+ $do_test= init_pattern($::opt_do_test, "--do-test");
+ $skip_test= init_pattern($::opt_skip_test, "--skip-test");
+
if ( $suite eq "main" )
{
$testdir= "$::glob_mysql_test_dir/t";
@@ -162,8 +183,7 @@ sub collect_test_cases ($) {
}
# Skip tests that does not match the --do-test= filter
- next if $::opt_do_test and
- ! defined mtr_match_prefix($elem,$::opt_do_test);
+ next if ($do_test and not $tname =~ /$do_test/o);
collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,\%disabled,
$component_id);
@@ -288,7 +308,7 @@ sub collect_one_test_case($$$$$$$) {
# Skip some tests but include in list, just mark them to skip
# ----------------------------------------------------------------------
- if ( $::opt_skip_test and defined mtr_match_prefix($tname,$::opt_skip_test) )
+ if ( $skip_test and $tname =~ /$skip_test/o )
{
$tinfo->{'skip'}= 1;
return;
diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl
index 31b0c4cd29e..226f73a21de 100644
--- a/mysql-test/lib/mtr_misc.pl
+++ b/mysql-test/lib/mtr_misc.pl
@@ -204,22 +204,15 @@ sub mtr_copy_dir($$) {
sub mtr_rmtree($) {
my ($dir)= @_;
- my $need_file_find= 0;
mtr_verbose("mtr_rmtree: $dir");
- {
- # Try to use File::Path::rmtree. Recent versions
- # handles removal of directories and files that don't
- # have full permissions, while older versions
- # may have a problem with that and we use our own version
-
- local $SIG{__WARN__}= sub {
- $need_file_find= 1;
- mtr_warning($_[0]);
- };
- rmtree($dir);
- }
- if ( $need_file_find ) {
+ # Try to use File::Path::rmtree. Recent versions
+ # handles removal of directories and files that don't
+ # have full permissions, while older versions
+ # may have a problem with that and we use our own version
+
+ eval { rmtree($dir); };
+ if ( $@ ) {
mtr_warning("rmtree($dir) failed, trying with File::Find...");
my $errors= 0;
diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl
index ca66138d279..1694ad1cb2e 100644
--- a/mysql-test/lib/mtr_report.pl
+++ b/mysql-test/lib/mtr_report.pl
@@ -196,7 +196,7 @@ sub mtr_report_stats ($) {
"of what went wrong.\n",
"If you want to report this error, please read first ",
"the documentation at\n",
- "http://www.mysql.com/doc/en/MySQL_test_suite.html\n";
+ "http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html\n";
}
if (!$::opt_extern)
{
diff --git a/mysql-test/mysql-test-run-shell.sh b/mysql-test/mysql-test-run-shell.sh
index a81a3b8b607..e0f151904f8 100644
--- a/mysql-test/mysql-test-run-shell.sh
+++ b/mysql-test/mysql-test-run-shell.sh
@@ -17,7 +17,16 @@ USE_MANAGER=0
MY_TZ=GMT-3
TZ=$MY_TZ; export TZ # for UNIX_TIMESTAMP tests to work
LOCAL_SOCKET=@MYSQL_UNIX_ADDR@
-MYSQL_TCP_PORT=@MYSQL_TCP_PORT@
+
+if [ -z "$MYSQL_TCP_PORT" ]; then
+ MYSQL_TCP_PORT=@MYSQL_TCP_PORT@
+ if [ @MYSQL_TCP_PORT_DEFAULT@ -eq 0 ]; then
+ ESP=`getent services mysql/tcp`
+ if [ $? -eq 0 ]; then
+ MYSQL_TCP_PORT=`echo "$ESP"|sed -e's-^[a-z]*[ ]*\([0-9]*\)/[a-z]*$-\1-g'`
+ fi
+ fi
+fi
umask 022
@@ -926,7 +935,7 @@ show_failed_diff ()
$DIFF -c $result_file $reject_file
echo "-------------------------------------------------------"
echo "Please follow the instructions outlined at"
- echo "http://dev.mysql.com/doc/mysql/en/reporting-mysqltest-bugs.html"
+ echo "http://forge.mysql.com/wiki/MySQL_Internals_Porting#Debugging_a_MySQL_Server"
echo "to find the reason to this problem and how to report this."
echo ""
fi
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index ba2056e2818..42298d635e7 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -255,13 +255,13 @@ our $opt_timer= 1;
our $opt_user;
-our $opt_valgrind= 0;
-our $opt_valgrind_mysqld= 0;
-our $opt_valgrind_mysqltest= 0;
-our $default_valgrind_options= "--show-reachable=yes";
-our $opt_valgrind_options;
-our $opt_valgrind_path;
-our $opt_callgrind;
+my $opt_valgrind= 0;
+my $opt_valgrind_mysqld= 0;
+my $opt_valgrind_mysqltest= 0;
+my @default_valgrind_args= ("--show-reachable=yes");
+my @valgrind_args;
+my $opt_valgrind_path;
+my $opt_callgrind;
our $opt_stress= "";
our $opt_stress_suite= "main";
@@ -461,6 +461,19 @@ sub main () {
#
##############################################################################
+#
+# When an option is no longer used by this program, it must be explicitly
+# ignored or else it will be passed through to mysqld. GetOptions will call
+# this subroutine once for each such option on the command line. See
+# Getopt::Long documentation.
+#
+
+sub warn_about_removed_option {
+ my ($option, $value, $hash_value) = @_;
+
+ warn "WARNING: This option is no longer used, and is ignored: --$option\n";
+}
+
sub command_line_setup () {
# These are defaults for things that are set on the command line
@@ -498,6 +511,15 @@ sub command_line_setup () {
# Read the command line
# Note: Keep list, and the order, in sync with usage at end of this file
+ # Options that are no longer used must still be processed, because all
+ # unprocessed options are passed directly to mysqld. The user will be
+ # warned that the option is being ignored.
+ #
+ # Put the complete option string here. For example, to remove the --suite
+ # option, remove it from GetOptions() below and put 'suite|suites=s' here.
+ my @removed_options = (
+ );
+
Getopt::Long::Configure("pass_through");
GetOptions(
# Control what engine/variation to run
@@ -575,7 +597,18 @@ sub command_line_setup () {
'valgrind|valgrind-all' => \$opt_valgrind,
'valgrind-mysqltest' => \$opt_valgrind_mysqltest,
'valgrind-mysqld' => \$opt_valgrind_mysqld,
- 'valgrind-options=s' => \$opt_valgrind_options,
+ 'valgrind-options=s' => sub {
+ my ($opt, $value)= @_;
+ # Deprecated option unless it's what we know pushbuild uses
+ if ($value eq "--gen-suppressions=all --show-reachable=yes") {
+ push(@valgrind_args, $_) for (split(' ', $value));
+ return;
+ }
+ die("--valgrind-options=s is deprecated. Use ",
+ "--valgrind-option=s, to be specified several",
+ " times if necessary");
+ },
+ 'valgrind-option=s' => \@valgrind_args,
'valgrind-path=s' => \$opt_valgrind_path,
'callgrind' => \$opt_callgrind,
@@ -615,6 +648,9 @@ sub command_line_setup () {
'suite-timeout=i' => \$opt_suite_timeout,
'warnings|log-warnings' => \$opt_warnings,
+ # Options which are no longer used
+ (map { $_ => \&warn_about_removed_option } @removed_options),
+
'help|h' => \$opt_usage,
) or usage("Can't read options");
@@ -992,7 +1028,7 @@ sub command_line_setup () {
# --------------------------------------------------------------------------
# Check valgrind arguments
# --------------------------------------------------------------------------
- if ( $opt_valgrind or $opt_valgrind_path or defined $opt_valgrind_options)
+ if ( $opt_valgrind or $opt_valgrind_path or @valgrind_args)
{
mtr_report("Turning on valgrind for all executables");
$opt_valgrind= 1;
@@ -1017,17 +1053,18 @@ sub command_line_setup () {
$opt_valgrind_mysqld= 1;
# Set special valgrind options unless options passed on command line
- $opt_valgrind_options="--trace-children=yes"
- unless defined $opt_valgrind_options;
+ push(@valgrind_args, "--trace-children=yes")
+ unless @valgrind_args;
}
if ( $opt_valgrind )
{
# Set valgrind_options to default unless already defined
- $opt_valgrind_options=$default_valgrind_options
- unless defined $opt_valgrind_options;
+ push(@valgrind_args, @default_valgrind_args)
+ unless @valgrind_args;
- mtr_report("Running valgrind with options \"$opt_valgrind_options\"");
+ mtr_report("Running valgrind with options \"",
+ join(" ", @valgrind_args), "\"");
}
if ( ! $opt_testcase_timeout )
@@ -1334,12 +1371,13 @@ sub datadir_list_setup () {
sub collect_mysqld_features () {
my $found_variable_list_start= 0;
+ my $tmpdir= tempdir(CLEANUP => 0); # Directory removed by this function
#
# Execute "mysqld --no-defaults --help --verbose" to get a
# list of all features and settings
#
- my $list= `$exe_mysqld --no-defaults --verbose --help`;
+ my $list= `$exe_mysqld --no-defaults --datadir=$tmpdir --verbose --help`;
foreach my $line (split('\n', $list))
{
@@ -1394,7 +1432,7 @@ sub collect_mysqld_features () {
}
}
}
-
+ rmtree($tmpdir);
mtr_error("Could not find version of MySQL") unless $mysql_version_id;
mtr_error("Could not find variabes list") unless $found_variable_list_start;
@@ -2064,6 +2102,21 @@ sub environment_setup () {
($lib_udf_example ? dirname($lib_udf_example) : "") .
($ENV{'LD_LIBRARY_PATH'} ? ":$ENV{'LD_LIBRARY_PATH'}" : "");
+ # ----------------------------------------------------
+ # Setup env so childs can execute myisampack and myisamchk
+ # ----------------------------------------------------
+ $ENV{'MYISAMCHK'}= mtr_native_path(mtr_exe_exists(
+ vs_config_dirs('storage/myisam', 'myisamchk'),
+ vs_config_dirs('myisam', 'myisamchk'),
+ "$path_client_bindir/myisamchk",
+ "$glob_basedir/storage/myisam/myisamchk",
+ "$glob_basedir/myisam/myisamchk"));
+ $ENV{'MYISAMPACK'}= mtr_native_path(mtr_exe_exists(
+ vs_config_dirs('storage/myisam', 'myisampack'),
+ vs_config_dirs('myisam', 'myisampack'),
+ "$path_client_bindir/myisampack",
+ "$glob_basedir/storage/myisam/myisampack",
+ "$glob_basedir/myisam/myisampack"));
# ----------------------------------------------------
# We are nice and report a bit about our settings
@@ -3709,6 +3762,21 @@ sub mysqld_arguments ($$$$) {
mtr_add_arg($args, "%s--language=%s", $prefix, $path_language);
mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix);
+ # Increase default connect_timeout to avoid intermittent
+ # disconnects when test servers are put under load
+ # see BUG#28359
+ mtr_add_arg($args, "%s--connect-timeout=60", $prefix);
+
+
+ # When mysqld is run by a root user(euid is 0), it will fail
+ # to start unless we specify what user to run as. If not running
+ # as root it will be ignored, see BUG#30630
+ my $euid= $>;
+ if (!$glob_win32 and $euid == 0 and
+ grep(/^--user/, @$extra_opt, @opt_extra_mysqld_opt) == 0) {
+ mtr_add_arg($args, "%s--user=root");
+ }
+
if ( $opt_valgrind_mysqld )
{
mtr_add_arg($args, "%s--skip-safemalloc", $prefix);
@@ -5002,7 +5070,7 @@ sub valgrind_arguments {
}
# Add valgrind options, can be overriden by user
- mtr_add_arg($args, '%s', $_) for (split(' ', $opt_valgrind_options));
+ mtr_add_arg($args, '%s', $_) for (@valgrind_args);
mtr_add_arg($args, $$exe);
@@ -5075,12 +5143,16 @@ Options to control what test suites or cases to run
skip-ndb[cluster] Skip all tests that need cluster
skip-ndb[cluster]-slave Skip all tests that need a slave cluster
ndb-extra Run extra tests from ndb directory
- do-test=PREFIX Run test cases which name are prefixed with PREFIX
+ do-test=PREFIX or REGEX
+ Run test cases which name are prefixed with PREFIX
+ or fulfills REGEX
+ skip-test=PREFIX or REGEX
+ Skip test cases which name are prefixed with PREFIX
+ or fulfills REGEX
start-from=PREFIX Run test cases starting from test prefixed with PREFIX
suite=NAME Run the test suite named NAME. The default is "main"
skip-rpl Skip the replication test cases.
skip-im Don't start IM, and skip the IM test cases
- skip-test=PREFIX Skip test cases which name are prefixed with PREFIX
big-test Set the environment variable BIG_TEST, which can be
checked from test cases.
@@ -5138,12 +5210,14 @@ Options for coverage, profiling etc
gcov FIXME
gprof FIXME
valgrind Run the "mysqltest" and "mysqld" executables using
- valgrind with options($default_valgrind_options)
+ valgrind with default options
valgrind-all Synonym for --valgrind
valgrind-mysqltest Run the "mysqltest" and "mysql_client_test" executable
with valgrind
valgrind-mysqld Run the "mysqld" executable with valgrind
- valgrind-options=ARGS Options to give valgrind, replaces default options
+ valgrind-options=ARGS Deprecated, use --valgrind-option
+ valgrind-option=ARGS Option to give valgrind, replaces default option(s),
+ can be specified more then once
valgrind-path=[EXE] Path to the valgrind executable
callgrind Instruct valgrind to use callgrind
diff --git a/mysql-test/r/almost_full.result b/mysql-test/r/almost_full.result
new file mode 100644
index 00000000000..eb28f12fa51
--- /dev/null
+++ b/mysql-test/r/almost_full.result
@@ -0,0 +1,29 @@
+drop table if exists t1;
+set global myisam_data_pointer_size=2;
+CREATE TABLE t1 (a int auto_increment primary key not null, b longtext) ENGINE=MyISAM;
+DELETE FROM t1 WHERE a=1 or a=5;
+INSERT INTO t1 SET b=repeat('a',600);
+ERROR HY000: The table 't1' is full
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check warning Datafile is almost full, 65448 of 65534 used
+test.t1 check status OK
+UPDATE t1 SET b=repeat('a', 800) where a=10;
+ERROR HY000: The table 't1' is full
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check warning Datafile is almost full, 65448 of 65534 used
+test.t1 check status OK
+INSERT INTO t1 SET b=repeat('a',400);
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check warning Datafile is almost full, 65448 of 65534 used
+test.t1 check status OK
+DELETE FROM t1 WHERE a=2 or a=6;
+UPDATE t1 SET b=repeat('a', 600) where a=11;
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check warning Datafile is almost full, 65448 of 65534 used
+test.t1 check status OK
+drop table t1;
+set global myisam_data_pointer_size=default;
diff --git a/mysql-test/r/analyze.result b/mysql-test/r/analyze.result
index 7b476c3cca2..c3dbb846402 100644
--- a/mysql-test/r/analyze.result
+++ b/mysql-test/r/analyze.result
@@ -56,3 +56,11 @@ 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 5 NULL NULL YES BTREE
drop table t1;
+End of 4.1 tests
+create table t1(a int);
+analyze table t1 extended;
+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 'extended' at line 1
+optimize table t1 extended;
+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 'extended' at line 1
+drop table t1;
+End of 5.0 tests
diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result
index b6a313ddf1a..0fc43f58908 100644
--- a/mysql-test/r/archive.result
+++ b/mysql-test/r/archive.result
@@ -2618,7 +2618,7 @@ auto fld1 companynr fld3 fld4 fld5 fld6
INSERT INTO t2 VALUES (2,011401,37,'breaking','dreaded','Steinberg','W');
INSERT INTO t2 VALUES (3,011402,37,'Romans','scholastics','jarring','');
INSERT INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily','');
-OPTIMIZE TABLE t2 EXTENDED;
+OPTIMIZE TABLE t2;
Table Op Msg_type Msg_text
test.t2 optimize status OK
SELECT * FROM t2;
@@ -11123,10 +11123,11 @@ auto fld1 companynr fld3 fld4 fld5 fld6
SELECT COUNT(auto) FROM t2;
COUNT(auto)
1213
-INSERT DELAYED INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily','');
+INSERT DELAYED INTO t2 VALUES (99999,011403,37,'the','delayed','insert','');
+INSERT INTO t2 VALUES (100000,000001,00,'after','delayed','insert','');
SELECT COUNT(auto) FROM t2;
COUNT(auto)
-1214
+1215
ALTER TABLE t2 DROP COLUMN fld6;
SHOW CREATE TABLE t2;
Table Create Table
@@ -11138,7 +11139,7 @@ t2 CREATE TABLE `t2` (
`fld4` char(35) NOT NULL default '',
`fld5` char(35) NOT NULL default ''
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
-SELECT * from t2;
+SELECT * from t2 WHERE auto != 100000;
auto fld1 companynr fld3 fld4 fld5
1 000001 00 Omaha teethe neat
2 011401 37 breaking dreaded Steinberg
@@ -12353,7 +12354,7 @@ auto fld1 companynr fld3 fld4 fld5
2 011401 37 breaking dreaded Steinberg
3 011402 37 Romans scholastics jarring
4 011403 37 intercepted audiology tinily
-4 011403 37 intercepted audiology tinily
+99999 011403 37 the delayed insert
drop table t1, t2, t4;
create table t1 (i int) engine=archive;
insert into t1 values (1);
diff --git a/mysql-test/r/bdb_gis.result b/mysql-test/r/bdb_gis.result
index d48b5a26e1d..6651421b51c 100644
--- a/mysql-test/r/bdb_gis.result
+++ b/mysql-test/r/bdb_gis.result
@@ -542,3 +542,42 @@ Overlaps(@horiz1, @point2)
0
DROP TABLE t1;
End of 5.0 tests
+CREATE TABLE t1 (p POINT);
+CREATE TABLE t2 (p POINT, INDEX(p));
+INSERT INTO t1 VALUES (POINTFROMTEXT('POINT(1 2)'));
+INSERT INTO t2 VALUES (POINTFROMTEXT('POINT(1 2)'));
+SELECT COUNT(*) FROM t1 WHERE p=POINTFROMTEXT('POINT(1 2)');
+COUNT(*)
+1
+EXPLAIN
+SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref p p 28 const 1 Using where
+SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
+COUNT(*)
+1
+INSERT INTO t1 VALUES (POINTFROMTEXT('POINT(1 2)'));
+INSERT INTO t2 VALUES (POINTFROMTEXT('POINT(1 2)'));
+EXPLAIN
+SELECT COUNT(*) FROM t1 WHERE p=POINTFROMTEXT('POINT(1 2)');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
+SELECT COUNT(*) FROM t1 WHERE p=POINTFROMTEXT('POINT(1 2)');
+COUNT(*)
+2
+EXPLAIN
+SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL p NULL NULL NULL 2 Using where
+SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
+COUNT(*)
+2
+EXPLAIN
+SELECT COUNT(*) FROM t2 IGNORE INDEX(p) WHERE p=POINTFROMTEXT('POINT(1 2)');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where
+SELECT COUNT(*) FROM t2 IGNORE INDEX(p) WHERE p=POINTFROMTEXT('POINT(1 2)');
+COUNT(*)
+2
+DROP TABLE t1, t2;
+End of 5.0 tests
diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result
index 064304b27aa..b0d114f1655 100644
--- a/mysql-test/r/bigint.result
+++ b/mysql-test/r/bigint.result
@@ -170,6 +170,12 @@ t2.value64=t1.value64;
value64 value32 value64 value32
9223372036854775807 2 9223372036854775807 4
drop table t1, t2;
+create table t1 (sint64 bigint not null);
+insert into t1 values (-9223372036854775808);
+select * from t1;
+sint64
+-9223372036854775808
+drop table t1;
create table t1 select 1 as 'a';
show create table t1;
Table Create Table
diff --git a/mysql-test/r/binlog_killed.result b/mysql-test/r/binlog_killed.result
index ba4f38fb4c1..e04cc192876 100644
--- a/mysql-test/r/binlog_killed.result
+++ b/mysql-test/r/binlog_killed.result
@@ -9,4 +9,48 @@ insert into t2 values (null, null), (null, get_lock("a", 10));
select @result /* must be zero either way */;
@result
0
+select RELEASE_LOCK("a");
+RELEASE_LOCK("a")
+1
+delete from t1;
+delete from t2;
+insert into t1 values (1,1),(2,2);
+begin;
+update t1 set b=11 where a=2;
+begin;
+update t1 set b=b+10;
+kill query ID;
+rollback;
+rollback;
+select * from t1 order by a /* must be the same as before (1,1),(2,2) */;
+a b
+1 1
+2 2
+begin;
+delete from t1 where a=2;
+begin;
+delete from t1 where a=2;
+kill query ID;
+rollback;
+rollback;
+select * from t1 order by a /* must be the same as before (1,1),(2,2) */;
+a b
+1 1
+2 2
+drop table if exists t4;
+create table t4 (a int, b int) engine=innodb;
+insert into t4 values (3, 3);
+begin;
+insert into t1 values (3, 3);
+begin;
+insert into t1 select * from t4 for update;
+kill query ID;
+rollback;
+rollback;
+select * from t1 /* must be the same as before (1,1),(2,2) */;
+a b
+1 1
+2 2
+drop table t4;
drop table t1,t2,t3;
+end of the tests
diff --git a/mysql-test/r/binlog_killed_simulate.result b/mysql-test/r/binlog_killed_simulate.result
new file mode 100644
index 00000000000..a21ac5b1e32
--- /dev/null
+++ b/mysql-test/r/binlog_killed_simulate.result
@@ -0,0 +1,33 @@
+drop table if exists t1,t2;
+create table t1 (a int) engine=MyISAM;
+insert into t1 set a=1;
+reset master;
+update t1 set a=2 /* will be "killed" after work has been done */;
+select
+(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
+is not null;
+(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
+is not null
+1
+select 1 /* must return 1 as query completed before got killed*/;
+1
+1
+create table t2 (a int, b int) ENGINE=MyISAM;
+reset master;
+load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */;
+ERROR 70100: Query execution was interrupted
+show binlog events from 98;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 98 Begin_load_query 1 # ;file_id=1;block_len=12
+master-bin.000001 133 Execute_load_query 1 # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */ ;file_id=1
+select
+(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
+is not null;
+(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
+is not null
+1
+select 0 /* must return 0 to mean the killed query is in */;
+0
+0
+drop table t1,t2;
+end of the tests
diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result
index cf358e6a404..bc05edcfac1 100644
--- a/mysql-test/r/case.result
+++ b/mysql-test/r/case.result
@@ -1,4 +1,4 @@
-drop table if exists t1;
+drop table if exists t1, t2;
select CASE "b" when "a" then 1 when "b" then 2 END;
CASE "b" when "a" then 1 when "b" then 2 END
2
@@ -200,3 +200,21 @@ CEMPNUM EMPMUM1 EMPNUM2
0.00 0 0.00
2.00 2 NULL
DROP TABLE t1,t2;
+End of 4.1 tests
+create table t1 (a int, b bigint unsigned);
+create table t2 (c int);
+insert into t1 (a, b) values (1,4572794622775114594), (2,18196094287899841997),
+(3,11120436154190595086);
+insert into t2 (c) values (1), (2), (3);
+select t1.a, (case t1.a when 0 then 0 else t1.b end) d from t1
+join t2 on t1.a=t2.c order by d;
+a d
+1 4572794622775114594
+3 11120436154190595086
+2 18196094287899841997
+select t1.a, (case t1.a when 0 then 0 else t1.b end) d from t1
+join t2 on t1.a=t2.c where b=11120436154190595086 order by d;
+a d
+3 11120436154190595086
+drop table t1, t2;
+End of 5.0 tests
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result
index 524ff48d69e..88601eceb0a 100644
--- a/mysql-test/r/cast.result
+++ b/mysql-test/r/cast.result
@@ -414,4 +414,28 @@ NULL
NULL
20070719
drop table t1;
+CREATE TABLE t1 (f1 DATE);
+INSERT INTO t1 VALUES ('2007-07-19'), (NULL);
+SELECT HOUR(f1),
+MINUTE(f1),
+SECOND(f1) FROM t1;
+HOUR(f1) MINUTE(f1) SECOND(f1)
+0 0 0
+NULL NULL NULL
+SELECT HOUR(CAST('2007-07-19' AS DATE)),
+MINUTE(CAST('2007-07-19' AS DATE)),
+SECOND(CAST('2007-07-19' AS DATE));
+HOUR(CAST('2007-07-19' AS DATE)) MINUTE(CAST('2007-07-19' AS DATE)) SECOND(CAST('2007-07-19' AS DATE))
+0 0 0
+SELECT HOUR(CAST(NULL AS DATE)),
+MINUTE(CAST(NULL AS DATE)),
+SECOND(CAST(NULL AS DATE));
+HOUR(CAST(NULL AS DATE)) MINUTE(CAST(NULL AS DATE)) SECOND(CAST(NULL AS DATE))
+NULL NULL NULL
+SELECT HOUR(NULL),
+MINUTE(NULL),
+SECOND(NULL);
+HOUR(NULL) MINUTE(NULL) SECOND(NULL)
+NULL NULL NULL
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index ab5d23d6cea..3d7486b6ba2 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -425,7 +425,7 @@ explain t2;
Field Type Null Key Default Extra
a int(11) YES NULL
b bigint(11) NO 0
-c bigint(11) NO 0
+c bigint(11) unsigned NO 0
d date YES NULL
e varchar(1) NO
f datetime YES NULL
diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result
index 3900597d2a6..dca4e349c8a 100644
--- a/mysql-test/r/csv.result
+++ b/mysql-test/r/csv.result
@@ -5029,4 +5029,46 @@ F7 ÷ DIVISION SIGN
FE þ LATIN SMALL LETTER THORN
FF ÿ LATIN SMALL LETTER Y WITH DIAERESIS
drop table t1;
+create table t1(a datetime) engine=csv;
+insert into t1 values();
+select * from t1;
+a
+0000-00-00 00:00:00
+drop table t1;
+create table t1(a set('foo','bar')) engine=csv;
+insert into t1 values();
+select * from t1;
+a
+
+drop table t1;
+create table t1(a varchar(32)) engine=csv;
+insert into t1 values();
+select * from t1;
+a
+
+drop table t1;
+create table t1(a int) engine=csv;
+insert into t1 values();
+select * from t1;
+a
+0
+drop table t1;
+create table t1(a blob) engine=csv;
+insert into t1 values();
+select * from t1;
+a
+
+drop table t1;
+create table t1(a bit(1)) engine=csv;
+insert into t1 values();
+select BIN(a) from t1;
+BIN(a)
+0
+drop table t1;
+create table t1(a enum('foo','bar') default 'foo') engine=csv;
+insert into t1 values();
+select * from t1;
+a
+foo
+drop table t1;
End of 5.0 tests
diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result
index 6d318a445f5..b190273cc64 100644
--- a/mysql-test/r/ctype_big5.result
+++ b/mysql-test/r/ctype_big5.result
@@ -52,6 +52,19 @@ SELECT c1 as want1result from t1 where c1 like 'location%';
want1result
location
DROP TABLE t1;
+create table t1 (a set('a') not null);
+insert into t1 values (),();
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
+select cast(a as char(1)) from t1;
+cast(a as char(1))
+
+
+select a sounds like a from t1;
+a sounds like a
+1
+1
+drop table t1;
DROP DATABASE d1;
USE test;
SET character_set_server= @safe_character_set_server;
diff --git a/mysql-test/r/ctype_euckr.result b/mysql-test/r/ctype_euckr.result
index 6017bc07763..ee786202c01 100644
--- a/mysql-test/r/ctype_euckr.result
+++ b/mysql-test/r/ctype_euckr.result
@@ -52,6 +52,19 @@ SELECT c1 as want1result from t1 where c1 like 'location%';
want1result
location
DROP TABLE t1;
+create table t1 (a set('a') not null);
+insert into t1 values (),();
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
+select cast(a as char(1)) from t1;
+cast(a as char(1))
+
+
+select a sounds like a from t1;
+a sounds like a
+1
+1
+drop table t1;
DROP DATABASE d1;
USE test;
SET character_set_server= @safe_character_set_server;
@@ -165,3 +178,44 @@ hex(a)
A2E6
FEF7
DROP TABLE t1;
+create table t1 (s1 varchar(5) character set euckr);
+insert into t1 values (0xA141);
+insert into t1 values (0xA15A);
+insert into t1 values (0xA161);
+insert into t1 values (0xA17A);
+insert into t1 values (0xA181);
+insert into t1 values (0xA1FE);
+insert into t1 values (0xA140);
+Warnings:
+Warning 1366 Incorrect string value: '\xA1@' for column 's1' at row 1
+insert into t1 values (0xA15B);
+Warnings:
+Warning 1366 Incorrect string value: '\xA1[' for column 's1' at row 1
+insert into t1 values (0xA160);
+Warnings:
+Warning 1366 Incorrect string value: '\xA1`' for column 's1' at row 1
+insert into t1 values (0xA17B);
+Warnings:
+Warning 1366 Incorrect string value: '\xA1{' for column 's1' at row 1
+insert into t1 values (0xA180);
+Warnings:
+Warning 1366 Incorrect string value: '\xA1\x80' for column 's1' at row 1
+insert into t1 values (0xA1FF);
+Warnings:
+Warning 1366 Incorrect string value: '\xA1\xFF' for column 's1' at row 1
+select hex(s1), hex(convert(s1 using utf8)) from t1 order by binary s1;
+hex(s1) hex(convert(s1 using utf8))
+
+
+
+
+
+
+A141 ECA2A5
+A15A ECA381
+A161 ECA382
+A17A ECA3A5
+A181 ECA3A6
+A1FE EFBFA2
+drop table t1;
+End of 5.0 tests
diff --git a/mysql-test/r/ctype_gb2312.result b/mysql-test/r/ctype_gb2312.result
index 314c336bab9..90c94c3b299 100644
--- a/mysql-test/r/ctype_gb2312.result
+++ b/mysql-test/r/ctype_gb2312.result
@@ -52,6 +52,19 @@ SELECT c1 as want1result from t1 where c1 like 'location%';
want1result
location
DROP TABLE t1;
+create table t1 (a set('a') not null);
+insert into t1 values (),();
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
+select cast(a as char(1)) from t1;
+cast(a as char(1))
+
+
+select a sounds like a from t1;
+a sounds like a
+1
+1
+drop table t1;
DROP DATABASE d1;
USE test;
SET character_set_server= @safe_character_set_server;
diff --git a/mysql-test/r/ctype_gbk.result b/mysql-test/r/ctype_gbk.result
index 3f5d8b0d8c6..fe90c7bff29 100644
--- a/mysql-test/r/ctype_gbk.result
+++ b/mysql-test/r/ctype_gbk.result
@@ -52,6 +52,19 @@ SELECT c1 as want1result from t1 where c1 like 'location%';
want1result
location
DROP TABLE t1;
+create table t1 (a set('a') not null);
+insert into t1 values (),();
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
+select cast(a as char(1)) from t1;
+cast(a as char(1))
+
+
+select a sounds like a from t1;
+a sounds like a
+1
+1
+drop table t1;
DROP DATABASE d1;
USE test;
SET character_set_server= @safe_character_set_server;
diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result
index 889702e380c..ae9146fc9db 100644
--- a/mysql-test/r/ctype_uca.result
+++ b/mysql-test/r/ctype_uca.result
@@ -2587,6 +2587,19 @@ SELECT c1 as want1result from t1 where c1 like 'location%';
want1result
location
DROP TABLE t1;
+create table t1 (a set('a') not null);
+insert into t1 values (),();
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
+select cast(a as char(1)) from t1;
+cast(a as char(1))
+
+
+select a sounds like a from t1;
+a sounds like a
+1
+1
+drop table t1;
DROP DATABASE d1;
USE test;
SET character_set_server= @safe_character_set_server;
@@ -2754,4 +2767,49 @@ a
c
ch
drop table t1;
+set collation_connection=ucs2_unicode_ci;
+drop table if exists t1;
+create table t1 as
+select repeat(' ', 64) as s1, repeat(' ',64) as s2
+union
+select null, null;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `s1` varchar(64) character set ucs2 collate ucs2_unicode_ci default NULL,
+ `s2` varchar(64) character set ucs2 collate ucs2_unicode_ci default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+delete from t1;
+insert into t1 values('aaa','aaa');
+insert into t1 values('aaa|qqq','qqq');
+insert into t1 values('gheis','^[^a-dXYZ]+$');
+insert into t1 values('aab','^aa?b');
+insert into t1 values('Baaan','^Ba*n');
+insert into t1 values('aaa','qqq|aaa');
+insert into t1 values('qqq','qqq|aaa');
+insert into t1 values('bbb','qqq|aaa');
+insert into t1 values('bbb','qqq');
+insert into t1 values('aaa','aba');
+insert into t1 values(null,'abc');
+insert into t1 values('def',null);
+insert into t1 values(null,null);
+insert into t1 values('ghi','ghi[');
+select HIGH_PRIORITY s1 regexp s2 from t1;
+s1 regexp s2
+1
+1
+1
+1
+1
+1
+1
+0
+0
+0
+NULL
+NULL
+NULL
+NULL
+drop table t1;
+set names utf8;
End for 5.0 tests
diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result
index 023267c227c..a6d6c604b9b 100644
--- a/mysql-test/r/ctype_ucs.result
+++ b/mysql-test/r/ctype_ucs.result
@@ -811,6 +811,20 @@ quote(name)
????????
????????????????
drop table bug20536;
+set names ucs2;
+ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2'
+set names ucs2 collate ucs2_bin;
+ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2'
+set character_set_client= ucs2;
+ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2'
+set character_set_client= concat('ucs', substr('2', 1));
+ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2'
+CREATE TABLE t1(a TEXT CHARSET ucs2 COLLATE ucs2_unicode_ci);
+INSERT INTO t1 VALUES('abcd');
+SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abcd' IN BOOLEAN MODE);
+a
+abcd
+DROP TABLE t1;
End of 4.1 tests
CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3));
INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0);
@@ -922,4 +936,52 @@ ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_gen
select * from t1 where a=if(b<10,_ucs2 0x0062,_ucs2 0x00C0);
ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_general_ci,COERCIBLE) for operation '='
drop table t1;
+set collation_connection=ucs2_general_ci;
+drop table if exists t1;
+create table t1 as
+select repeat(' ', 64) as s1, repeat(' ',64) as s2
+union
+select null, null;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `s1` varchar(64) character set ucs2 default NULL,
+ `s2` varchar(64) character set ucs2 default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+delete from t1;
+insert into t1 values('aaa','aaa');
+insert into t1 values('aaa|qqq','qqq');
+insert into t1 values('gheis','^[^a-dXYZ]+$');
+insert into t1 values('aab','^aa?b');
+insert into t1 values('Baaan','^Ba*n');
+insert into t1 values('aaa','qqq|aaa');
+insert into t1 values('qqq','qqq|aaa');
+insert into t1 values('bbb','qqq|aaa');
+insert into t1 values('bbb','qqq');
+insert into t1 values('aaa','aba');
+insert into t1 values(null,'abc');
+insert into t1 values('def',null);
+insert into t1 values(null,null);
+insert into t1 values('ghi','ghi[');
+select HIGH_PRIORITY s1 regexp s2 from t1;
+s1 regexp s2
+1
+1
+1
+1
+1
+1
+1
+0
+0
+0
+NULL
+NULL
+NULL
+NULL
+drop table t1;
+set names latin1;
+select hex(char(0x41 using ucs2));
+hex(char(0x41 using ucs2))
+0041
End of 5.0 tests
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 710cac388a5..5ca1d578d2a 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -267,6 +267,51 @@ b
select * from t1 where a = 'b' and a != 'b';
a
drop table t1;
+set collation_connection=utf8_general_ci;
+drop table if exists t1;
+create table t1 as
+select repeat(' ', 64) as s1, repeat(' ',64) as s2
+union
+select null, null;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `s1` varchar(64) character set utf8 default NULL,
+ `s2` varchar(64) character set utf8 default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+delete from t1;
+insert into t1 values('aaa','aaa');
+insert into t1 values('aaa|qqq','qqq');
+insert into t1 values('gheis','^[^a-dXYZ]+$');
+insert into t1 values('aab','^aa?b');
+insert into t1 values('Baaan','^Ba*n');
+insert into t1 values('aaa','qqq|aaa');
+insert into t1 values('qqq','qqq|aaa');
+insert into t1 values('bbb','qqq|aaa');
+insert into t1 values('bbb','qqq');
+insert into t1 values('aaa','aba');
+insert into t1 values(null,'abc');
+insert into t1 values('def',null);
+insert into t1 values(null,null);
+insert into t1 values('ghi','ghi[');
+select HIGH_PRIORITY s1 regexp s2 from t1;
+s1 regexp s2
+1
+1
+1
+1
+1
+1
+1
+0
+0
+0
+NULL
+NULL
+NULL
+NULL
+drop table t1;
+set names utf8;
set names utf8;
select 'ваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]';
'ваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]'
@@ -1538,12 +1583,12 @@ char(53647 using utf8)
Ñ
select char(0xff,0x8f using utf8);
char(0xff,0x8f using utf8)
-ÿ
+
Warnings:
Warning 1300 Invalid utf8 character string: 'FF8F'
select convert(char(0xff,0x8f) using utf8);
convert(char(0xff,0x8f) using utf8)
-ÿ
+
Warnings:
Warning 1300 Invalid utf8 character string: 'FF8F'
set sql_mode=traditional;
@@ -1730,3 +1775,41 @@ i
1
н1234567890
DROP TABLE t1, t2;
+set sql_mode=traditional;
+select hex(char(0xFF using utf8));
+hex(char(0xFF using utf8))
+NULL
+Warnings:
+Error 1300 Invalid utf8 character string: 'FF'
+select hex(convert(0xFF using utf8));
+hex(convert(0xFF using utf8))
+NULL
+Warnings:
+Error 1300 Invalid utf8 character string: 'FF'
+select hex(_utf8 0x616263FF);
+ERROR HY000: Invalid utf8 character string: 'FF'
+select hex(_utf8 X'616263FF');
+ERROR HY000: Invalid utf8 character string: 'FF'
+select hex(_utf8 B'001111111111');
+ERROR HY000: Invalid utf8 character string: 'FF'
+select (_utf8 X'616263FF');
+ERROR HY000: Invalid utf8 character string: 'FF'
+set sql_mode=default;
+select hex(char(0xFF using utf8));
+hex(char(0xFF using utf8))
+
+Warnings:
+Warning 1300 Invalid utf8 character string: 'FF'
+select hex(convert(0xFF using utf8));
+hex(convert(0xFF using utf8))
+
+Warnings:
+Warning 1300 Invalid utf8 character string: 'FF'
+select hex(_utf8 0x616263FF);
+ERROR HY000: Invalid utf8 character string: 'FF'
+select hex(_utf8 X'616263FF');
+ERROR HY000: Invalid utf8 character string: 'FF'
+select hex(_utf8 B'001111111111');
+ERROR HY000: Invalid utf8 character string: 'FF'
+select (_utf8 X'616263FF');
+ERROR HY000: Invalid utf8 character string: 'FF'
diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result
index d62c865bb3c..6833a7f1594 100644
--- a/mysql-test/r/date_formats.result
+++ b/mysql-test/r/date_formats.result
@@ -481,7 +481,7 @@ str_to_date(a,b)
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
+str_to_date(a,b) datetime 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,
diff --git a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result
index b37679847be..ff333d88fef 100644
--- a/mysql-test/r/delayed.result
+++ b/mysql-test/r/delayed.result
@@ -73,13 +73,13 @@ a
13
DROP TABLE t1;
SET @bug20627_old_auto_increment_offset=
-@@auto_increment_offset= 2;
+@@auto_increment_offset;
SET @bug20627_old_auto_increment_increment=
-@@auto_increment_increment= 3;
+@@auto_increment_increment;
SET @bug20627_old_session_auto_increment_offset=
-@@session.auto_increment_offset= 4;
+@@session.auto_increment_offset;
SET @bug20627_old_session_auto_increment_increment=
-@@session.auto_increment_increment= 5;
+@@session.auto_increment_increment;
SET @@auto_increment_offset= 2;
SET @@auto_increment_increment= 3;
SET @@session.auto_increment_offset= 4;
@@ -116,13 +116,13 @@ SET @@session.auto_increment_offset=
SET @@session.auto_increment_increment=
@bug20627_old_session_auto_increment_increment;
SET @bug20830_old_auto_increment_offset=
-@@auto_increment_offset= 2;
+@@auto_increment_offset;
SET @bug20830_old_auto_increment_increment=
-@@auto_increment_increment= 3;
+@@auto_increment_increment;
SET @bug20830_old_session_auto_increment_offset=
-@@session.auto_increment_offset= 4;
+@@session.auto_increment_offset;
SET @bug20830_old_session_auto_increment_increment=
-@@session.auto_increment_increment= 5;
+@@session.auto_increment_increment;
SET @@auto_increment_offset= 2;
SET @@auto_increment_increment= 3;
SET @@session.auto_increment_offset= 4;
diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result
index 5084498c01c..eb93c69d960 100644
--- a/mysql-test/r/delete.result
+++ b/mysql-test/r/delete.result
@@ -271,3 +271,11 @@ a
DROP TABLE t1, t2;
DROP DATABASE db1;
DROP DATABASE db2;
+CREATE FUNCTION f1() RETURNS INT RETURN 1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (0);
+DELETE FROM t1 ORDER BY (f1(10)) LIMIT 1;
+ERROR 42000: Incorrect number of arguments for FUNCTION test.f1; expected 0, got 1
+DROP TABLE t1;
+DROP FUNCTION f1;
+End of 5.0 tests
diff --git a/mysql-test/r/flush.result b/mysql-test/r/flush.result
index 7eb7fd16edb..ce64e09c1d3 100644
--- a/mysql-test/r/flush.result
+++ b/mysql-test/r/flush.result
@@ -55,3 +55,20 @@ flush tables with read lock;
insert into t2 values(1);
unlock tables;
drop table t1, t2;
+drop table if exists t1, t2;
+set session low_priority_updates=1;
+create table t1 (a int);
+create table t2 (b int);
+lock tables t1 write;
+flush tables with read lock;
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
+unlock tables;
+lock tables t1 read, t2 write;
+flush tables with read lock;
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
+unlock tables;
+lock tables t1 read;
+flush tables with read lock;
+unlock tables;
+drop table t1, t2;
+set session low_priority_updates=default;
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index f6efe2411c0..29fb430bb97 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -463,3 +463,9 @@ ALTER TABLE t1 DISABLE KEYS;
SELECT * FROM t1 WHERE MATCH(a) AGAINST('test');
ERROR HY000: Can't find FULLTEXT index matching the column list
DROP TABLE t1;
+CREATE TABLE t1(a TEXT);
+INSERT INTO t1 VALUES(' aaaaa aaaa');
+SELECT * FROM t1 WHERE MATCH(a) AGAINST ('"aaaa"' IN BOOLEAN MODE);
+a
+ aaaaa aaaa
+DROP TABLE t1;
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index 35487c25ae3..df61954b22a 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -819,4 +819,55 @@ id group_concat(b.name)
1 óra,óra
2 óra,óra
drop table t1;
+create table t1(a bit not null);
+insert into t1 values (), (), ();
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
+select group_concat(distinct a) from t1;
+group_concat(distinct a)
+0
+select group_concat(distinct a order by a) from t1;
+group_concat(distinct a order by a)
+0
+drop table t1;
+create table t1(a bit(2) not null);
+insert into t1 values (1), (0), (0), (3), (1);
+select group_concat(distinct a) from t1;
+group_concat(distinct a)
+1,0,3
+select group_concat(distinct a order by a) from t1;
+group_concat(distinct a order by a)
+0,1,3
+select group_concat(distinct a order by a desc) from t1;
+group_concat(distinct a order by a desc)
+3,1,0
+drop table t1;
+create table t1(a bit(2), b varchar(10), c bit);
+insert into t1 values (1, 'a', 0), (0, 'b', 1), (0, 'c', 0), (3, 'd', 1),
+(1, 'e', 1), (3, 'f', 1), (0, 'g', 1);
+select group_concat(distinct a, c) from t1;
+group_concat(distinct a, c)
+10,01,00,31,11
+select group_concat(distinct a, c order by a) from t1;
+group_concat(distinct a, c order by a)
+00,01,11,10,31
+select group_concat(distinct a, c) from t1;
+group_concat(distinct a, c)
+10,01,00,31,11
+select group_concat(distinct a, c order by a, c) from t1;
+group_concat(distinct a, c order by a, c)
+00,01,10,11,31
+select group_concat(distinct a, c order by a desc, c desc) from t1;
+group_concat(distinct a, c order by a desc, c desc)
+31,11,10,01,00
+drop table t1;
+create table t1 (f1 char(20));
+insert into t1 values (''),('');
+select group_concat(distinct f1) from t1;
+group_concat(distinct f1)
+
+select group_concat(f1) from t1;
+group_concat(f1)
+,
+drop table t1;
End of 5.0 tests
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index e5720cc1ee0..1e130877088 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -1377,4 +1377,34 @@ SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1 and b > 1;
MIN(a) MIN(b)
1 2
DROP TABLE t1, t2, t3, t4, t5;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 values (),(),();
+SELECT (SELECT SLEEP(0) FROM t1 ORDER BY AVG(DISTINCT a) ) as x FROM t1
+GROUP BY x;
+x
+0
+SELECT 1 FROM t1 GROUP BY (SELECT SLEEP(0) FROM t1 ORDER BY AVG(DISTINCT a) );
+1
+1
+DROP TABLE t1;
+CREATE TABLE t1 (a int, b date NOT NULL, KEY k1 (a,b));
+SELECT MIN(b) FROM t1 WHERE a=1 AND b>'2007-08-01';
+MIN(b)
+NULL
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+SET SQL_MODE=ONLY_FULL_GROUP_BY;
+SELECT a FROM t1 HAVING COUNT(*)>2;
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+SELECT COUNT(*), a FROM t1;
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+SET SQL_MODE=DEFAULT;
+SELECT a FROM t1 HAVING COUNT(*)>2;
+a
+1
+SELECT COUNT(*), a FROM t1;
+COUNT(*) a
+4 1
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index ace94217fdc..150b6003dbe 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -322,4 +322,42 @@ mod(5, cast(-2 as unsigned)) mod(5, 18446744073709551614) mod(5, -2)
select pow(cast(-2 as unsigned), 5), pow(18446744073709551614, 5), pow(-2, 5);
pow(cast(-2 as unsigned), 5) pow(18446744073709551614, 5) pow(-2, 5)
2.1359870359209e+96 2.1359870359209e+96 -32
+CREATE TABLE t1 (a timestamp, b varchar(20), c bit(1));
+INSERT INTO t1 VALUES('1998-09-23', 'str1', 1), ('2003-03-25', 'str2', 0);
+SELECT a DIV 900 y FROM t1 GROUP BY y;
+y
+22201025555
+22255916666
+SELECT DISTINCT a DIV 900 y FROM t1;
+y
+22201025555
+22255916666
+SELECT b DIV 900 y FROM t1 GROUP BY y;
+y
+0
+SELECT c DIV 900 y FROM t1 GROUP BY y;
+y
+0
+DROP TABLE t1;
+CREATE TABLE t1(a LONGBLOB);
+INSERT INTO t1 VALUES('1'),('2'),('3');
+SELECT DISTINCT (a DIV 254576881) FROM t1;
+(a DIV 254576881)
+0
+SELECT (a DIV 254576881) FROM t1 UNION ALL
+SELECT (a DIV 254576881) FROM t1;
+(a DIV 254576881)
+0
+0
+0
+0
+0
+0
+DROP TABLE t1;
+CREATE TABLE t1(a SET('a','b','c'));
+INSERT INTO t1 VALUES ('a');
+SELECT a DIV 2 FROM t1 UNION SELECT a DIV 2 FROM t1;
+a DIV 2
+0
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result
index 35101e26ff6..a302ad4769e 100644
--- a/mysql-test/r/func_misc.result
+++ b/mysql-test/r/func_misc.result
@@ -185,4 +185,32 @@ ERROR 21000: Operand should contain 1 column(s)
drop table table_26093;
drop function func_26093_a;
drop function func_26093_b;
+SELECT NAME_CONST('test', NOW());
+ERROR HY000: Incorrect arguments to NAME_CONST
+SELECT NAME_CONST('test', UPPER('test'));
+ERROR HY000: Incorrect arguments to NAME_CONST
+SELECT NAME_CONST('test', NULL);
+test
+NULL
+SELECT NAME_CONST('test', 1);
+test
+1
+SELECT NAME_CONST('test', -1);
+test
+-1
+SELECT NAME_CONST('test', 1.0);
+test
+1.0
+SELECT NAME_CONST('test', -1.0);
+test
+-1.0
+SELECT NAME_CONST('test', 'test');
+test
+test
+create table t1 (a int not null);
+insert into t1 values (-1), (-2);
+select min(a) from t1 group by inet_ntoa(a);
+min(a)
+-2
+drop table t1;
End of 5.0 tests
diff --git a/mysql-test/r/func_regexp.result b/mysql-test/r/func_regexp.result
index 584c8a9b820..c2dbfc3c331 100644
--- a/mysql-test/r/func_regexp.result
+++ b/mysql-test/r/func_regexp.result
@@ -1,5 +1,17 @@
drop table if exists t1;
-create table t1 (s1 char(64),s2 char(64));
+set names latin1;
+drop table if exists t1;
+create table t1 as
+select repeat(' ', 64) as s1, repeat(' ',64) as s2
+union
+select null, null;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `s1` varchar(64) default NULL,
+ `s2` varchar(64) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+delete from t1;
insert into t1 values('aaa','aaa');
insert into t1 values('aaa|qqq','qqq');
insert into t1 values('gheis','^[^a-dXYZ]+$');
@@ -98,3 +110,8 @@ R2
R3
deallocate prepare stmt1;
drop table t1;
+End of 4.1 tests
+SELECT 1 REGEXP NULL;
+1 REGEXP NULL
+NULL
+End of 5.0 tests
diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result
index dbae7e551e5..4db0416bdce 100644
--- a/mysql-test/r/func_sapdb.result
+++ b/mysql-test/r/func_sapdb.result
@@ -93,6 +93,9 @@ makedate(9999,365)
select makedate(9999,366);
makedate(9999,366)
NULL
+select makedate(100,1);
+makedate(100,1)
+0100-01-01
select addtime("1997-12-31 23:59:59.999999", "1 1:1:1.000002");
addtime("1997-12-31 23:59:59.999999", "1 1:1:1.000002")
1998-01-02 01:01:01.000001
@@ -196,7 +199,7 @@ f2 datetime YES NULL
f3 time YES NULL
f4 time YES NULL
f5 time YES NULL
-f6 time NO 00:00:00
+f6 time YES NULL
f7 datetime YES NULL
f8 date YES NULL
f9 time YES NULL
diff --git a/mysql-test/r/func_set.result b/mysql-test/r/func_set.result
index aa71cee0752..ef5526ca13e 100644
--- a/mysql-test/r/func_set.result
+++ b/mysql-test/r/func_set.result
@@ -73,3 +73,33 @@ find_in_set(binary 'a', 'A,B,C')
select find_in_set('1','3,1,');
find_in_set('1','3,1,')
2
+End of 4.1 tests
+SELECT INTERVAL(0.0, NULL);
+INTERVAL(0.0, NULL)
+1
+SELECT INTERVAL(0.0, CAST(NULL AS DECIMAL));
+INTERVAL(0.0, CAST(NULL AS DECIMAL))
+1
+SELECT INTERVAL(0.0, CAST(DATE(NULL) AS DECIMAL));
+INTERVAL(0.0, CAST(DATE(NULL) AS DECIMAL))
+1
+SELECT INTERVAL(0.0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INTERVAL(0.0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
+8
+SELECT INTERVAL(0.0, CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL),
+CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL),
+CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL));
+INTERVAL(0.0, CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL),
+CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL),
+CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL))
+8
+SELECT INTERVAL(0.0, CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL),
+CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL),
+CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL),
+CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL));
+INTERVAL(0.0, CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL),
+CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL),
+CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL),
+CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL))
+8
+End of 5.0 tests
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index ce9633006af..d0809eca65b 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -722,11 +722,11 @@ Warning 1265 Data truncated for column 'format(130,10)' at row 1
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `bin(130)` varchar(64) NOT NULL default '',
- `oct(130)` varchar(64) NOT NULL default '',
- `conv(130,16,10)` varchar(64) NOT NULL default '',
+ `bin(130)` varchar(64) default NULL,
+ `oct(130)` varchar(64) default NULL,
+ `conv(130,16,10)` varchar(64) default NULL,
`hex(130)` varchar(6) NOT NULL default '',
- `char(130)` varbinary(1) NOT NULL default '',
+ `char(130)` varbinary(4) NOT NULL default '',
`format(130,10)` varchar(4) NOT NULL default '',
`left(_latin2'a',1)` varchar(1) character set latin2 NOT NULL default '',
`right(_latin2'a',1)` varchar(1) character set latin2 NOT NULL default '',
@@ -1096,6 +1096,18 @@ id select_type table type possible_keys key key_len ref rows Extra
Warnings:
Note 1003 select decode('','zxcv') AS `enc` from `test`.`t1`
drop table t1;
+create table t1 (a bigint not null)engine=myisam;
+insert into t1 set a = 1024*1024*1024*4;
+delete from t1 order by (inet_ntoa(a)) desc limit 10;
+drop table t1;
+create table t1 (a char(36) not null)engine=myisam;
+insert ignore into t1 set a = ' ';
+insert ignore into t1 set a = ' ';
+select * from t1 order by (oct(a));
+a
+
+
+drop table t1;
End of 4.1 tests
create table t1 (d decimal default null);
insert into t1 values (null);
@@ -2153,4 +2165,14 @@ SUBSTR(a,1,len)
ba
DROP TABLE t1;
+CREATE TABLE t1 AS SELECT CHAR(0x414243) as c1;
+SELECT HEX(c1) from t1;
+HEX(c1)
+414243
+DROP TABLE t1;
+CREATE VIEW v1 AS SELECT CHAR(0x414243) as c1;
+SELECT HEX(c1) from v1;
+HEX(c1)
+414243
+DROP VIEW v1;
End of 5.0 tests
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index ee8b8c1e908..74859be4d04 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -1027,6 +1027,15 @@ fmtddate field2
Sep-4 12:00AM abcd
DROP TABLE testBug8868;
SET NAMES DEFAULT;
+CREATE TABLE t1 (
+a TIMESTAMP
+);
+INSERT INTO t1 VALUES (now()), (now());
+SELECT 1 FROM t1 ORDER BY MAKETIME(1, 1, a);
+1
+1
+1
+DROP TABLE t1;
(select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 DAY)),'%H') As H)
union
(select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 DAY)),'%H') As H);
diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result
index 8476ea9e838..99bfede3ee0 100644
--- a/mysql-test/r/gis-rtree.result
+++ b/mysql-test/r/gis-rtree.result
@@ -167,7 +167,7 @@ count(*)
150
EXPLAIN SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))'));
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range g g 32 NULL 8 Using where
+1 SIMPLE t1 range g g 34 NULL 8 Using where
SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))'));
fid AsText(g)
1 LINESTRING(150 150,150 150)
@@ -301,7 +301,7 @@ count(*)
EXPLAIN SELECT fid, AsText(g) FROM t2 WHERE Within(g,
GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))'));
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range g g 32 NULL 4 Using where
+1 SIMPLE t2 range g g 34 NULL 4 Using where
SELECT fid, AsText(g) FROM t2 WHERE Within(g,
GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))'));
fid AsText(g)
@@ -1425,6 +1425,37 @@ CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
+create table t1 (a geometry not null, spatial index(a));
+insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 131072)));
+insert into t1 values (PointFromWKB(POINT(9.1248812352444e+192, 2.9740338169556e+284)));
+insert into t1 values (PointFromWKB(POINT(4.7783097267365e-299, -0)));
+insert into t1 values (PointFromWKB(POINT(1.49166814624e-154, 2.0880974297595e-53)));
+insert into t1 values (PointFromWKB(POINT(4.0917382598702e+149, 1.2024538023802e+111)));
+insert into t1 values (PointFromWKB(POINT(2.0349165139404e+236, 2.9993936277913e-241)));
+insert into t1 values (PointFromWKB(POINT(2.5243548967072e-29, 1.2024538023802e+111)));
+insert into t1 values (PointFromWKB(POINT(0, 6.9835074892995e-251)));
+insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 3.1050361846014e+231)));
+insert into t1 values (PointFromWKB(POINT(2.8728483499323e-188, 2.4600631144627e+260)));
+insert into t1 values (PointFromWKB(POINT(3.0517578125e-05, 2.0349165139404e+236)));
+insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 1.1818212630766e-125)));
+insert into t1 values (PointFromWKB(POINT(2.481040258324e-265, 5.7766220027675e-275)));
+insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 2.5243548967072e-29)));
+insert into t1 values (PointFromWKB(POINT(5.7766220027675e-275, 9.9464647281957e+86)));
+insert into t1 values (PointFromWKB(POINT(2.2181357552967e+130, 3.7857669957337e-270)));
+insert into t1 values (PointFromWKB(POINT(4.5767114681874e-246, 3.6893488147419e+19)));
+insert into t1 values (PointFromWKB(POINT(4.5767114681874e-246, 3.7537584144024e+255)));
+insert into t1 values (PointFromWKB(POINT(3.7857669957337e-270, 1.8033161362863e-130)));
+insert into t1 values (PointFromWKB(POINT(0, 5.8774717541114e-39)));
+insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 2.2761049594727e-159)));
+insert into t1 values (PointFromWKB(POINT(6.243497100632e+144, 3.7857669957337e-270)));
+insert into t1 values (PointFromWKB(POINT(3.7857669957337e-270, 2.6355494858076e-82)));
+insert into t1 values (PointFromWKB(POINT(2.0349165139404e+236, 3.8518598887745e-34)));
+insert into t1 values (PointFromWKB(POINT(4.6566128730774e-10, 2.0880974297595e-53)));
+insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 1.8827498946116e-183)));
+insert into t1 values (PointFromWKB(POINT(1.8033161362863e-130, 9.1248812352444e+192)));
+insert into t1 values (PointFromWKB(POINT(4.7783097267365e-299, 2.2761049594727e-159)));
+insert into t1 values (PointFromWKB(POINT(1.94906280228e+289, 1.2338789709327e-178)));
+drop table t1;
CREATE TABLE t1(foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) );
INSERT INTO t1(foo) VALUES (NULL);
ERROR 23000: Column 'foo' cannot be null
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index f6189ec1236..40c70721347 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -736,6 +736,12 @@ SELECT * FROM t1;
a
NULL
DROP TABLE t1;
+CREATE TABLE `t1` ( `col9` set('a'), `col89` date);
+INSERT INTO `t1` VALUES ('','0000-00-00');
+select geomfromtext(col9,col89) as a from t1;
+a
+NULL
+DROP TABLE t1;
End of 4.1 tests
create table t1 (s1 geometry not null,s2 char(100));
create trigger t1_bu before update on t1 for each row set new.s1 = null;
@@ -888,4 +894,43 @@ drop table t1, t2;
SELECT 1;
1
1
+CREATE TABLE t1 (p POINT);
+CREATE TABLE t2 (p POINT, INDEX(p));
+INSERT INTO t1 VALUES (POINTFROMTEXT('POINT(1 2)'));
+INSERT INTO t2 VALUES (POINTFROMTEXT('POINT(1 2)'));
+SELECT COUNT(*) FROM t1 WHERE p=POINTFROMTEXT('POINT(1 2)');
+COUNT(*)
+1
+EXPLAIN
+SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 system p NULL NULL NULL 1
+SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
+COUNT(*)
+1
+INSERT INTO t1 VALUES (POINTFROMTEXT('POINT(1 2)'));
+INSERT INTO t2 VALUES (POINTFROMTEXT('POINT(1 2)'));
+EXPLAIN
+SELECT COUNT(*) FROM t1 WHERE p=POINTFROMTEXT('POINT(1 2)');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
+SELECT COUNT(*) FROM t1 WHERE p=POINTFROMTEXT('POINT(1 2)');
+COUNT(*)
+2
+EXPLAIN
+SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref p p 28 const 1 Using where
+SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
+COUNT(*)
+2
+EXPLAIN
+SELECT COUNT(*) FROM t2 IGNORE INDEX(p) WHERE p=POINTFROMTEXT('POINT(1 2)');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where
+SELECT COUNT(*) FROM t2 IGNORE INDEX(p) WHERE p=POINTFROMTEXT('POINT(1 2)');
+COUNT(*)
+2
+DROP TABLE t1, t2;
+End of 5.0 tests
End of 5.0 tests
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index a4c51cca277..e27ef64af43 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -1105,6 +1105,7 @@ ERROR 42000: SELECT command denied to user 'mysqltest_2'@'localhost' for table '
DROP DATABASE mysqltest1;
DROP DATABASE mysqltest2;
DROP USER mysqltest_1@localhost;
+DROP USER mysqltest_2@localhost;
use test;
CREATE TABLE t1 (f1 int, f2 int);
INSERT INTO t1 VALUES(1,1), (2,2);
@@ -1121,6 +1122,10 @@ SELECT * FROM test.t1;
f1 f2
1 1
2 2
+REVOKE UPDATE (f1) ON `test`.`t1` FROM 'mysqltest_1'@'localhost';
+REVOKE SELECT ON `test`.* FROM 'mysqltest_1'@'localhost';
+REVOKE ALL ON db27878.* FROM 'mysqltest_1'@'localhost';
+DROP USER mysqltest_1@localhost;
DROP DATABASE db27878;
use test;
DROP TABLE t1;
diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result
index 6de9a83aeed..e3c92ecc7c8 100644
--- a/mysql-test/r/grant2.result
+++ b/mysql-test/r/grant2.result
@@ -421,4 +421,22 @@ revoke all privileges, grant option from mysqltest_1@localhost;
revoke all privileges, grant option from mysqltest_2@localhost;
drop user mysqltest_1@localhost;
drop user mysqltest_2@localhost;
+CREATE DATABASE db1;
+USE db1;
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (1,1),(2,2);
+CREATE TABLE t2 (b INT, c INT);
+INSERT INTO t2 VALUES (1,100),(2,200);
+GRANT SELECT ON t1 TO mysqltest1@localhost;
+GRANT SELECT (b) ON t2 TO mysqltest1@localhost;
+USE db1;
+SELECT c FROM t2;
+ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for column 'c' in table 't2'
+SELECT * FROM t2;
+ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for column 'c' in table 't2'
+SELECT * FROM t1 JOIN t2 USING (b);
+ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for column 'c' in table 't2'
+DROP TABLE db1.t1, db1.t2;
+DROP USER mysqltest1@localhost;
+DROP DATABASE db1;
End of 5.0 tests
diff --git a/mysql-test/r/grant3.result b/mysql-test/r/grant3.result
index 6193c4fd49d..cc7f46855b2 100644
--- a/mysql-test/r/grant3.result
+++ b/mysql-test/r/grant3.result
@@ -16,3 +16,125 @@ delete from mysql.db where user like 'mysqltest\_%';
delete from mysql.tables_priv where user like 'mysqltest\_%';
delete from mysql.columns_priv where user like 'mysqltest\_%';
flush privileges;
+grant select on test.* to CUser@localhost;
+grant select on test.* to CUser@LOCALHOST;
+flush privileges;
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+user host
+CUser LOCALHOST
+CUser localhost
+SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2;
+user host db select_priv
+CUser LOCALHOST test Y
+CUser localhost test Y
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST';
+flush privileges;
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+user host
+CUser LOCALHOST
+CUser localhost
+SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2;
+user host db select_priv
+CUser localhost test Y
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost';
+flush privileges;
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+user host
+CUser LOCALHOST
+CUser localhost
+SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2;
+user host db select_priv
+DROP USER CUser@localhost;
+DROP USER CUser@LOCALHOST;
+create table t1 (a int);
+grant select on test.t1 to CUser@localhost;
+grant select on test.t1 to CUser@LOCALHOST;
+flush privileges;
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+user host
+CUser LOCALHOST
+CUser localhost
+SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
+user host db Table_name Table_priv Column_priv
+CUser LOCALHOST test t1 Select
+CUser localhost test t1 Select
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST';
+flush privileges;
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+user host
+CUser LOCALHOST
+CUser localhost
+SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
+user host db Table_name Table_priv Column_priv
+CUser localhost test t1 Select
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost';
+flush privileges;
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+user host
+CUser LOCALHOST
+CUser localhost
+SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
+user host db Table_name Table_priv Column_priv
+DROP USER CUser@localhost;
+DROP USER CUser@LOCALHOST;
+grant select(a) on test.t1 to CUser@localhost;
+grant select(a) on test.t1 to CUser@LOCALHOST;
+flush privileges;
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+user host
+CUser LOCALHOST
+CUser localhost
+SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
+user host db Table_name Table_priv Column_priv
+CUser LOCALHOST test t1 Select
+CUser localhost test t1 Select
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST';
+flush privileges;
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+user host
+CUser LOCALHOST
+CUser localhost
+SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
+user host db Table_name Table_priv Column_priv
+CUser localhost test t1 Select
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost';
+flush privileges;
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+user host
+CUser LOCALHOST
+CUser localhost
+SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
+user host db Table_name Table_priv Column_priv
+DROP USER CUser@localhost;
+DROP USER CUser@LOCALHOST;
+drop table t1;
+grant select on test.* to CUser2@localhost;
+grant select on test.* to CUser2@LOCALHOST;
+flush privileges;
+SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2;
+user host
+CUser2 LOCALHOST
+CUser2 localhost
+SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2;
+user host db select_priv
+CUser2 LOCALHOST test Y
+CUser2 localhost test Y
+REVOKE SELECT ON test.* FROM 'CUser2'@'LOCALHOST';
+flush privileges;
+SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2;
+user host
+CUser2 LOCALHOST
+CUser2 localhost
+SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2;
+user host db select_priv
+CUser2 localhost test Y
+REVOKE SELECT ON test.* FROM 'CUser2'@'localhost';
+flush privileges;
+SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2;
+user host
+CUser2 LOCALHOST
+CUser2 localhost
+SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2;
+user host db select_priv
+DROP USER CUser2@localhost;
+DROP USER CUser2@LOCALHOST;
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index 053c2901509..1693fa646eb 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -1113,3 +1113,68 @@ c b
3 1
3 2
DROP TABLE t1;
+CREATE TABLE t1(
+id INT AUTO_INCREMENT PRIMARY KEY,
+c1 INT NOT NULL,
+c2 INT NOT NULL,
+UNIQUE KEY (c2,c1));
+INSERT INTO t1(c1,c2) VALUES (5,1), (4,1), (3,5), (2,3), (1,3);
+SELECT * FROM t1 ORDER BY c1;
+id c1 c2
+5 1 3
+4 2 3
+3 3 5
+2 4 1
+1 5 1
+SELECT * FROM t1 GROUP BY id ORDER BY c1;
+id c1 c2
+5 1 3
+4 2 3
+3 3 5
+2 4 1
+1 5 1
+SELECT * FROM t1 GROUP BY id ORDER BY id DESC;
+id c1 c2
+5 1 3
+4 2 3
+3 3 5
+2 4 1
+1 5 1
+SELECT * FROM t1 GROUP BY c2 ,c1, id ORDER BY c2, c1;
+id c1 c2
+2 4 1
+1 5 1
+5 1 3
+4 2 3
+3 3 5
+SELECT * FROM t1 GROUP BY c2, c1, id ORDER BY c2 DESC, c1;
+id c1 c2
+3 3 5
+5 1 3
+4 2 3
+2 4 1
+1 5 1
+SELECT * FROM t1 GROUP BY c2, c1, id ORDER BY c2 DESC, c1 DESC;
+id c1 c2
+3 3 5
+4 2 3
+5 1 3
+1 5 1
+2 4 1
+SELECT * FROM t1 GROUP BY c2 ORDER BY c2, c1;
+id c1 c2
+1 5 1
+4 2 3
+3 3 5
+SELECT * FROM t1 GROUP BY c2 ORDER BY c2 DESC, c1;
+id c1 c2
+3 3 5
+4 2 3
+1 5 1
+SELECT * FROM t1 GROUP BY c2 ORDER BY c2 DESC, c1 DESC;
+id c1 c2
+3 3 5
+4 2 3
+1 5 1
+DROP TABLE t1;
+End of 5.0 tests
diff --git a/mysql-test/r/heap_btree.result b/mysql-test/r/heap_btree.result
index 91f51a95936..c20dfbe80d2 100644
--- a/mysql-test/r/heap_btree.result
+++ b/mysql-test/r/heap_btree.result
@@ -307,6 +307,13 @@ UNIQUE USING BTREE(c1)
) ENGINE= MEMORY DEFAULT CHARSET= utf8;
INSERT INTO t1 VALUES('1'), ('2');
DROP TABLE t1;
+CREATE TABLE t1 (a INT, KEY USING BTREE(a)) ENGINE=MEMORY;
+INSERT INTO t1 VALUES(1),(2),(2);
+DELETE FROM t1 WHERE a=2;
+SELECT * FROM t1;
+a
+1
+DROP TABLE t1;
End of 4.1 tests
CREATE TABLE t1(val INT, KEY USING BTREE(val)) ENGINE=memory;
INSERT INTO t1 VALUES(0);
@@ -321,4 +328,12 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT, UNIQUE USING BTREE(a)) ENGINE=MEMORY;
INSERT INTO t1 VALUES(NULL),(NULL);
DROP TABLE t1;
+create table t1(a varchar(255), b varchar(255),
+key using btree (a,b)) engine=memory;
+insert into t1 values (1, 1), (3, 3), (2, 2), (NULL, 1), (NULL, NULL), (0, 0);
+select * from t1 where a is null;
+a b
+NULL NULL
+NULL 1
+drop table t1;
End of 5.0 tests
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index 87d41943c93..265769eb436 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -1396,4 +1396,40 @@ f6 bigint(20) NO 10
f7 datetime NO NULL
f8 datetime YES 2006-01-01 00:00:00
drop table t1;
+select * from information_schema.columns where table_schema = NULL;
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
+select * from `information_schema`.`COLUMNS` where `TABLE_NAME` = NULL;
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
+select * from `information_schema`.`KEY_COLUMN_USAGE` where `TABLE_SCHEMA` = NULL;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
+select * from `information_schema`.`KEY_COLUMN_USAGE` where `TABLE_NAME` = NULL;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
+select * from information_schema.schemata where schema_name = NULL;
+CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
+select * from `information_schema`.`STATISTICS` where `TABLE_SCHEMA` = NULL;
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
+select * from `information_schema`.`STATISTICS` where `TABLE_NAME` = NULL;
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
+select * from information_schema.tables where table_schema = NULL;
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
+select * from information_schema.tables where table_catalog = NULL;
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
+select * from information_schema.tables where table_name = NULL;
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
+select * from `information_schema`.`TABLE_CONSTRAINTS` where `TABLE_SCHEMA` = NULL;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
+select * from `information_schema`.`TABLE_CONSTRAINTS` where `TABLE_NAME` = NULL;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
+select * from `information_schema`.`TRIGGERS` where `EVENT_OBJECT_SCHEMA` = NULL;
+TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER
+select * from `information_schema`.`TRIGGERS` where `EVENT_OBJECT_TABLE` = NULL;
+TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER
+select * from `information_schema`.`VIEWS` where `TABLE_SCHEMA` = NULL;
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
+select * from `information_schema`.`VIEWS` where `TABLE_NAME` = NULL;
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
End of 5.0 tests.
+show fields from information_schema.table_names;
+ERROR 42S02: Unknown table 'table_names' in information_schema
+show keys from information_schema.table_names;
+ERROR 42S02: Unknown table 'table_names' in information_schema
diff --git a/mysql-test/r/information_schema_db.result b/mysql-test/r/information_schema_db.result
index 2b9601641d7..716786b6fa7 100644
--- a/mysql-test/r/information_schema_db.result
+++ b/mysql-test/r/information_schema_db.result
@@ -131,7 +131,7 @@ Warnings:
Warning 1356 View 'testdb_1.v7' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
show fields from testdb_1.v7;
Field Type Null Key Default Extra
-f1 null YES NULL
+f1 char(4) YES NULL
Warnings:
Note 1449 There is no 'no_such_user'@'no_such_host' registered
create table t3 (f1 char(4), f2 char(4));
@@ -151,7 +151,7 @@ View Create View
v6 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v6` AS select `testdb_1`.`t1`.`f1` AS `f1` from `testdb_1`.`t1`
show fields from testdb_1.v7;
Field Type Null Key Default Extra
-f1 null YES NULL
+f1 char(4) YES NULL
Warnings:
Note 1449 There is no 'no_such_user'@'no_such_host' registered
show create view testdb_1.v7;
@@ -179,7 +179,7 @@ show create view v4;
ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
show fields from v4;
Field Type Null Key Default Extra
-f1 null YES NULL
+f1 char(4) YES NULL
f2 char(4) YES NULL
show fields from v2;
Field Type Null Key Default Extra
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index 6082a30bce3..38b26425ec8 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -1119,6 +1119,19 @@ show master status /* there must be no UPDATE query event */;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 98
drop table t1, t2;
+drop table if exists t1, t2;
+CREATE TABLE t1 (a int, PRIMARY KEY (a));
+CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
+create trigger trg_del_t2 after delete on t2 for each row
+insert into t1 values (1);
+insert into t1 values (1);
+insert into t2 values (1),(2);
+delete t2 from t2;
+ERROR 23000: Duplicate entry '1' for key 1
+select count(*) from t2 /* must be 2 as restored after rollback caused by the error */;
+count(*)
+2
+drop table t1, t2;
create table t1 (a int, b int) engine=innodb;
insert into t1 values(20,null);
select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
@@ -1792,10 +1805,10 @@ Variable_name Value
Innodb_page_size 16384
show status like "Innodb_rows_deleted";
Variable_name Value
-Innodb_rows_deleted 72
+Innodb_rows_deleted 73
show status like "Innodb_rows_inserted";
Variable_name Value
-Innodb_rows_inserted 29732
+Innodb_rows_inserted 29734
show status like "Innodb_rows_updated";
Variable_name Value
Innodb_rows_updated 29532
diff --git a/mysql-test/r/innodb_gis.result b/mysql-test/r/innodb_gis.result
index 2c62537aa94..bfe8c984b7b 100644
--- a/mysql-test/r/innodb_gis.result
+++ b/mysql-test/r/innodb_gis.result
@@ -542,3 +542,42 @@ Overlaps(@horiz1, @point2)
0
DROP TABLE t1;
End of 5.0 tests
+CREATE TABLE t1 (p POINT);
+CREATE TABLE t2 (p POINT, INDEX(p));
+INSERT INTO t1 VALUES (POINTFROMTEXT('POINT(1 2)'));
+INSERT INTO t2 VALUES (POINTFROMTEXT('POINT(1 2)'));
+SELECT COUNT(*) FROM t1 WHERE p=POINTFROMTEXT('POINT(1 2)');
+COUNT(*)
+1
+EXPLAIN
+SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref p p 28 const 1 Using where
+SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
+COUNT(*)
+1
+INSERT INTO t1 VALUES (POINTFROMTEXT('POINT(1 2)'));
+INSERT INTO t2 VALUES (POINTFROMTEXT('POINT(1 2)'));
+EXPLAIN
+SELECT COUNT(*) FROM t1 WHERE p=POINTFROMTEXT('POINT(1 2)');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
+SELECT COUNT(*) FROM t1 WHERE p=POINTFROMTEXT('POINT(1 2)');
+COUNT(*)
+2
+EXPLAIN
+SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref p p 28 const 1 Using where
+SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
+COUNT(*)
+2
+EXPLAIN
+SELECT COUNT(*) FROM t2 IGNORE INDEX(p) WHERE p=POINTFROMTEXT('POINT(1 2)');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where
+SELECT COUNT(*) FROM t2 IGNORE INDEX(p) WHERE p=POINTFROMTEXT('POINT(1 2)');
+COUNT(*)
+2
+DROP TABLE t1, t2;
+End of 5.0 tests
diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index d5f014b6840..5a85df76347 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -1211,4 +1211,19 @@ a b
3 2
1 1
DROP TABLE t1;
+create table t1(a char(10) not null, unique key aa(a(1)),
+b char(4) not null, unique key bb(b(4))) engine=innodb;
+desc t1;
+Field Type Null Key Default Extra
+a char(10) NO UNI NULL
+b char(4) NO PRI NULL
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(10) NOT NULL,
+ `b` char(4) NOT NULL,
+ UNIQUE KEY `bb` (`b`),
+ UNIQUE KEY `aa` (`a`(1))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t1;
End of 5.0 tests
diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result
index 8a0a3ba848c..2e49bd373d6 100644
--- a/mysql-test/r/insert.result
+++ b/mysql-test/r/insert.result
@@ -461,4 +461,138 @@ i
2
2
DROP TABLE t1, t2;
+CREATE TABLE t1 (
+a char(20) NOT NULL,
+b char(7) DEFAULT NULL,
+c char(4) DEFAULT NULL
+);
+INSERT INTO t1(a,b,c) VALUES (9.999999e+0, 9.999999e+0, 9.999e+0);
+INSERT INTO t1(a,b,c) VALUES (1.225e-05, 1.225e-05, 1.225e-05);
+Warnings:
+Warning 1265 Data truncated for column 'c' at row 1
+INSERT INTO t1(a,b) VALUES (1.225e-04, 1.225e-04);
+INSERT INTO t1(a,b) VALUES (1.225e-01, 1.225e-01);
+INSERT INTO t1(a,b) VALUES (1.225877e-01, 1.225877e-01);
+INSERT INTO t1(a,b) VALUES (1.225e+01, 1.225e+01);
+INSERT INTO t1(a,b,c) VALUES (1.225e+01, 1.225e+01, 1.225e+01);
+INSERT INTO t1(a,b) VALUES (1.225e+05, 1.225e+05);
+INSERT INTO t1(a,b) VALUES (1.225e+10, 1.225e+10);
+INSERT INTO t1(a,b) VALUES (1.225e+15, 1.225e+15);
+INSERT INTO t1(a,b) VALUES (5000000e+0, 5000000e+0);
+INSERT INTO t1(a,b) VALUES (1.25e+78, 1.25e+78);
+INSERT INTO t1(a,b) VALUES (1.25e-94, 1.25e-94);
+INSERT INTO t1(a,b) VALUES (1.25e+203, 1.25e+203);
+INSERT INTO t1(a,b) VALUES (1.25e-175, 1.25e-175);
+INSERT INTO t1(a,c) VALUES (1.225e+0, 1.225e+0);
+INSERT INTO t1(a,c) VALUES (1.37e+0, 1.37e+0);
+INSERT INTO t1(a,c) VALUES (-1.37e+0, -1.37e+0);
+Warnings:
+Warning 1265 Data truncated for column 'c' at row 1
+INSERT INTO t1(a,c) VALUES (1.87e-3, 1.87e-3);
+Warnings:
+Warning 1265 Data truncated for column 'c' at row 1
+INSERT INTO t1(a,c) VALUES (-1.87e-2, -1.87e-2);
+Warnings:
+Warning 1265 Data truncated for column 'c' at row 1
+INSERT INTO t1(a,c) VALUES (5000e+0, 5000e+0);
+INSERT INTO t1(a,c) VALUES (-5000e+0, -5000e+0);
+Warnings:
+Warning 1265 Data truncated for column 'c' at row 1
+SELECT * FROM t1;
+a b c
+9.999999 10 10
+1.225e-05 1.2e-05 1e-0
+0.0001225 0.00012 NULL
+0.1225 0.1225 NULL
+0.1225877 0.12259 NULL
+12.25 12.25 NULL
+12.25 12.25 12.2
+122500 122500 NULL
+12250000000 1.2e+10 NULL
+1.225e+15 1.2e+15 NULL
+5000000 5000000 NULL
+1.25e+78 1.2e+78 NULL
+1.25e-94 1.2e-94 NULL
+1.25e+203 1e+203 NULL
+1.25e-175 1e-175 NULL
+1.225 NULL 1.23
+1.37 NULL 1.37
+-1.37 NULL -1.3
+0.00187 NULL 0.00
+-0.0187 NULL -0.0
+5000 NULL 5000
+-5000 NULL -500
+DROP TABLE t1;
+CREATE TABLE t1 (
+a char(20) NOT NULL,
+b char(7) DEFAULT NULL,
+c char(5)
+);
+INSERT INTO t1(a,b,c) VALUES (9.999999e+0, 9.999999e+0, 9.999e+0);
+INSERT INTO t1(a,b,c) VALUES (1.225e-05, 1.225e-05, 1.225e-05);
+INSERT INTO t1(a,b) VALUES (1.225e-04, 1.225e-04);
+INSERT INTO t1(a,b) VALUES (1.225e-01, 1.225e-01);
+INSERT INTO t1(a,b) VALUES (1.225877e-01, 1.225877e-01);
+INSERT INTO t1(a,b) VALUES (1.225e+01, 1.225e+01);
+INSERT INTO t1(a,b,c) VALUES (1.225e+01, 1.225e+01, 1.225e+01);
+INSERT INTO t1(a,b) VALUES (1.225e+05, 1.225e+05);
+INSERT INTO t1(a,b) VALUES (1.225e+10, 1.225e+10);
+INSERT INTO t1(a,b) VALUES (1.225e+15, 1.225e+15);
+INSERT INTO t1(a,b) VALUES (5000000e+0, 5000000e+0);
+INSERT INTO t1(a,b) VALUES (1.25e+78, 1.25e+78);
+INSERT INTO t1(a,b) VALUES (1.25e-94, 1.25e-94);
+INSERT INTO t1(a,b) VALUES (1.25e+203, 1.25e+203);
+INSERT INTO t1(a,b) VALUES (1.25e-175, 1.25e-175);
+INSERT INTO t1(a,c) VALUES (1.225e+0, 1.225e+0);
+INSERT INTO t1(a,c) VALUES (1.37e+0, 1.37e+0);
+INSERT INTO t1(a,c) VALUES (-1.37e+0, -1.37e+0);
+INSERT INTO t1(a,c) VALUES (1.87e-3, 1.87e-3);
+INSERT INTO t1(a,c) VALUES (-1.87e-2, -1.87e-2);
+Warnings:
+Warning 1265 Data truncated for column 'c' at row 1
+INSERT INTO t1(a,c) VALUES (5000e+0, 5000e+0);
+INSERT INTO t1(a,c) VALUES (-5000e+0, -5000e+0);
+SELECT * FROM t1;
+a b c
+9.999999 10 9.999
+1.225e-05 1.2e-05 1e-05
+0.0001225 0.00012 NULL
+0.1225 0.1225 NULL
+0.1225877 0.12259 NULL
+12.25 12.25 NULL
+12.25 12.25 12.25
+122500 122500 NULL
+12250000000 1.2e+10 NULL
+1.225e+15 1.2e+15 NULL
+5000000 5000000 NULL
+1.25e+78 1.2e+78 NULL
+1.25e-94 1.2e-94 NULL
+1.25e+203 1e+203 NULL
+1.25e-175 1e-175 NULL
+1.225 NULL 1.225
+1.37 NULL 1.37
+-1.37 NULL -1.37
+0.00187 NULL 0.002
+-0.0187 NULL -0.01
+5000 NULL 5000
+-5000 NULL -5000
+DROP TABLE t1;
+CREATE TABLE t (a CHAR(10),b INT);
+INSERT INTO t VALUES (),(),();
+INSERT INTO t(a) SELECT rand() FROM t;
+DROP TABLE t;
+CREATE TABLE t1 (c1 INT NOT NULL);
+INSERT INTO t1 VALUES(4188.32999999999992724042385816574096679687500),
+('4188.32999999999992724042385816574096679687500'), (4188);
+SELECT * FROM t1;
+c1
+4188
+4188
+4188
+CREATE TABLE t2 (c1 BIGINT);
+INSERT INTO t2 VALUES('15449237462.0000000000');
+SELECT * FROM t2;
+c1
+15449237462
+DROP TABLE t1, t2;
End of 5.0 tests.
diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result
index d16562d97e2..7a37f49125a 100644
--- a/mysql-test/r/insert_select.result
+++ b/mysql-test/r/insert_select.result
@@ -830,3 +830,15 @@ id prev_id join_id
3 2 0
4 3 0
DROP TABLE t1,t2;
+#
+# Bug#30384: Having SQL_BUFFER_RESULT option in the
+# CREATE .. KEY(..) .. SELECT led to creating corrupted index.
+#
+create table t1(f1 int);
+insert into t1 values(1),(2),(3);
+create table t2 (key(f1)) engine=myisam select sql_buffer_result f1 from t1;
+check table t2 extended;
+Table Op Msg_type Msg_text
+test.t2 check status OK
+drop table t1,t2;
+##################################################################
diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result
index 2fc751c63bf..0f1ea46bd61 100644
--- a/mysql-test/r/key.result
+++ b/mysql-test/r/key.result
@@ -462,4 +462,48 @@ EXPLAIN SELECT MAX(a) FROM t1 FORCE INDEX(a);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1
DROP TABLE t1;
+create table t1(a int not null, key aa(a),
+b char(10) not null, unique key bb(b(1)),
+c char(4) not null, unique key cc(c));
+desc t1;
+Field Type Null Key Default Extra
+a int(11) NO MUL NULL
+b char(10) NO UNI NULL
+c char(4) NO PRI NULL
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `b` char(10) NOT NULL,
+ `c` char(4) NOT NULL,
+ UNIQUE KEY `cc` (`c`),
+ UNIQUE KEY `bb` (`b`(1)),
+ KEY `aa` (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1(a int not null, key aa(a),
+b char(10) not null, unique key bb(b(1)),
+c char(4) not null);
+desc t1;
+Field Type Null Key Default Extra
+a int(11) NO MUL NULL
+b char(10) NO UNI NULL
+c char(4) NO NULL
+alter table t1 add unique key cc(c);
+desc t1;
+Field Type Null Key Default Extra
+a int(11) NO MUL NULL
+b char(10) NO UNI NULL
+c char(4) NO PRI NULL
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `b` char(10) NOT NULL,
+ `c` char(4) NOT NULL,
+ UNIQUE KEY `cc` (`c`),
+ UNIQUE KEY `bb` (`b`(1)),
+ KEY `aa` (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
End of 5.0 tests.
diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result
index af49e1a27dc..079f92ca420 100644
--- a/mysql-test/r/lock_multi.result
+++ b/mysql-test/r/lock_multi.result
@@ -88,3 +88,14 @@ alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1
alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
unlock tables;
drop table t1;
+drop table if exists t1;
+create table t1 (a int);
+connection: locker
+lock tables t1 read;
+connection: writer
+create table t2 like t1;;
+connection: default
+kill query
+ERROR 70100: Query execution was interrupted
+unlock tables;
+drop table t1;
diff --git a/mysql-test/r/lowercase_view.result b/mysql-test/r/lowercase_view.result
index f09725dafcb..a89b79263c5 100644
--- a/mysql-test/r/lowercase_view.result
+++ b/mysql-test/r/lowercase_view.result
@@ -119,7 +119,7 @@ create table t1Aa (col1 int);
create view v1Aa as select col1 from t1Aa as AaA;
show create view v1AA;
View Create View
-v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `aaa`.`col1` AS `col1` from `t1aa` `AaA`
+v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `aaa`.`col1` AS `col1` from `t1aa` `aaa`
drop view v1AA;
select Aaa.col1 from t1Aa as AaA;
col1
@@ -128,6 +128,23 @@ drop view v1AA;
create view v1Aa as select AaA.col1 from t1Aa as AaA;
show create view v1AA;
View Create View
-v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `aaa`.`col1` AS `col1` from `t1aa` `AaA`
+v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `aaa`.`col1` AS `col1` from `t1aa` `aaa`
drop view v1AA;
drop table t1Aa;
+CREATE TABLE t1 (a int, b int);
+select X.a from t1 AS X group by X.b having (X.a = 1);
+a
+select X.a from t1 AS X group by X.b having (x.a = 1);
+a
+select X.a from t1 AS X group by X.b having (x.b = 1);
+a
+CREATE OR REPLACE VIEW v1 AS
+select X.a from t1 AS X group by X.b having (X.a = 1);
+SHOW CREATE VIEW v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `x`.`a` AS `a` from `t1` `x` group by `x`.`b` having (`x`.`a` = 1)
+SELECT * FROM v1;
+a
+DROP VIEW v1;
+DROP TABLE t1;
+End of 5.0 tests.
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index 42669eeb66f..24a56fbf575 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -876,4 +876,9 @@ CHECK TABLE tm1;
Table Op Msg_type Msg_text
test.tm1 check status OK
DROP TABLE tm1, t1, t2;
+CREATE TABLE t1(c1 INT);
+CREATE TABLE t2 (c1 INT) ENGINE=MERGE UNION=(t1) INSERT_METHOD=FIRST;
+CREATE TABLE IF NOT EXISTS t1 SELECT * FROM t2;
+ERROR HY000: You can't specify target table 't1' for update in FROM clause
+DROP TABLE t1, t2;
End of 5.0 tests
diff --git a/mysql-test/r/mix_innodb_myisam_binlog.result b/mysql-test/r/mix_innodb_myisam_binlog.result
index 5777bd890b2..89ee82e9655 100644
--- a/mysql-test/r/mix_innodb_myisam_binlog.result
+++ b/mysql-test/r/mix_innodb_myisam_binlog.result
@@ -351,7 +351,7 @@ drop function if exists bug27417;
drop table if exists t1,t2;
CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM;
CREATE TABLE t2 (a int NOT NULL auto_increment, PRIMARY KEY (a));
-create function bug27417(n int)
+create function bug27417(n int)
RETURNS int(11)
begin
insert into t1 values (null);
@@ -365,7 +365,7 @@ insert into t2 values (bug27417(2));
ERROR 23000: Duplicate entry '2' for key 1
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 98
+master-bin.000001 196
/* only (!) with fixes for #23333 will show there is the query */;
select count(*) from t1 /* must be 3 */;
count(*)
@@ -390,6 +390,119 @@ affected rows: 0
select count(*) from t1 /* must be 7 */;
count(*)
7
-drop function bug27417;
drop table t1,t2;
+CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM;
+CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
+CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique) ENGINE=MyISAM;
+CREATE TABLE t4 (a int, PRIMARY KEY (a), b int unique) ENGINE=Innodb;
+CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
+insert into t2 values (1);
+reset master;
+insert into t2 values (bug27417(1));
+ERROR 23000: Duplicate entry '1' for key 1
+show master status /* the offset must denote there is the query */;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 267
+select count(*) from t1 /* must be 1 */;
+count(*)
+1
+delete from t1;
+delete from t2;
+insert into t2 values (2);
+reset master;
+insert into t2 select bug27417(1) union select bug27417(2);
+ERROR 23000: Duplicate entry '2' for key 1
+show master status /* the offset must denote there is the query */;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 290
+select count(*) from t1 /* must be 2 */;
+count(*)
+2
+delete from t1;
+insert into t3 values (1,1),(2,3),(3,4);
+reset master;
+update t3 set b=b+bug27417(1);
+ERROR 23000: Duplicate entry '4' for key 2
+show master status /* the offset must denote there is the query */;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 190
+select count(*) from t1 /* must be 2 */;
+count(*)
+2
+delete from t3;
+delete from t4;
+insert into t3 values (1,1);
+insert into t4 values (1,1),(2,2);
+reset master;
+UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */;
+ERROR 23000: Duplicate entry '2' for key 1
+show master status /* the offset must denote there is the query */;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 301
+select count(*) from t1 /* must be 4 */;
+count(*)
+4
+delete from t1;
+delete from t3;
+delete from t4;
+insert into t3 values (1,1),(2,2);
+insert into t4 values (1,1),(2,2);
+reset master;
+UPDATE t3,t4 SET t3.a=t4.a + bug27417(1);
+ERROR 23000: Duplicate entry '2' for key 1
+select count(*) from t1 /* must be 1 */;
+count(*)
+1
+drop table t4;
+delete from t1;
+delete from t2;
+delete from t3;
+insert into t2 values (1);
+insert into t3 values (1,1);
+create trigger trg_del before delete on t2 for each row
+insert into t3 values (bug27417(1), 2);
+reset master;
+delete from t2;
+ERROR 23000: Duplicate entry '1' for key 1
+show master status /* the offset must denote there is the query */;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 246
+select count(*) from t1 /* must be 1 */;
+count(*)
+1
+drop trigger trg_del;
+delete from t1;
+delete from t2;
+delete from t5;
+create trigger trg_del_t2 after delete on t2 for each row
+insert into t1 values (1);
+insert into t2 values (2),(3);
+insert into t5 values (1),(2);
+reset master;
+delete t2.* from t2,t5 where t2.a=t5.a + 1;
+ERROR 23000: Duplicate entry '1' for key 1
+show master status /* the offset must denote there is the query */;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 274
+select count(*) from t1 /* must be 1 */;
+count(*)
+1
+delete from t1;
+create table t4 (a int default 0, b int primary key) engine=innodb;
+insert into t4 values (0, 17);
+reset master;
+load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
+ERROR 23000: Duplicate entry '17' for key 1
+select * from t4;
+a b
+0 17
+select count(*) from t1 /* must be 2 */;
+count(*)
+2
+show master status /* the offset must denote there is the query */;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 376
+drop trigger trg_del_t2;
+drop table t1,t2,t3,t4,t5;
+drop function bug27417;
end of tests
diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result
index 0f624e3ee8d..d95036090a5 100644
--- a/mysql-test/r/multi_update.result
+++ b/mysql-test/r/multi_update.result
@@ -545,7 +545,7 @@ a b
4 4
show master status /* there must be the UPDATE query event */;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 189
+master-bin.000001 260
delete from t1;
delete from t2;
insert into t1 values (1,2),(3,4),(4,4);
@@ -555,6 +555,26 @@ UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a;
ERROR 23000: Duplicate entry '4' for key 1
show master status /* there must be the UPDATE query event */;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 204
+master-bin.000001 275
drop table t1, t2;
+drop table if exists t1, t2, t3;
+CREATE TABLE t1 (a int, PRIMARY KEY (a));
+CREATE TABLE t2 (a int, PRIMARY KEY (a));
+CREATE TABLE t3 (a int, PRIMARY KEY (a)) ENGINE=MyISAM;
+create trigger trg_del_t3 before delete on t3 for each row insert into t1 values (1);
+insert into t2 values (1),(2);
+insert into t3 values (1),(2);
+reset master;
+delete t3.* from t2,t3 where t2.a=t3.a;
+ERROR 23000: Duplicate entry '1' for key 1
+select count(*) from t1 /* must be 1 */;
+count(*)
+1
+select count(*) from t3 /* must be 1 */;
+count(*)
+1
+show binlog events from 98;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 98 Query 1 # use `test`; delete t3.* from t2,t3 where t2.a=t3.a
+drop table t1, t2, t3;
end of tests
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index 7fc29cd13ca..56933f45fbf 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -1806,4 +1806,37 @@ SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1;
a
1
DROP TABLE t1;
+CREATE TABLE t1 (c1 INT, c2 INT, UNIQUE INDEX (c1), INDEX (c2)) ENGINE=MYISAM;
+SHOW TABLE STATUS LIKE 't1';
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 MyISAM 10 Fixed 0 # # # 1024 # # # # # # #
+INSERT INTO t1 VALUES (1,1);
+SHOW TABLE STATUS LIKE 't1';
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 MyISAM 10 Fixed 1 # # # 3072 # # # # # # #
+ALTER TABLE t1 DISABLE KEYS;
+SHOW TABLE STATUS LIKE 't1';
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 MyISAM 10 Fixed 1 # # # 3072 # # # # # # #
+ALTER TABLE t1 ENABLE KEYS;
+SHOW TABLE STATUS LIKE 't1';
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 MyISAM 10 Fixed 1 # # # 3072 # # # # # # #
+ALTER TABLE t1 DISABLE KEYS;
+SHOW TABLE STATUS LIKE 't1';
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 MyISAM 10 Fixed 1 # # # 3072 # # # # # # #
+ALTER TABLE t1 ENABLE KEYS;
+SHOW TABLE STATUS LIKE 't1';
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 MyISAM 10 Fixed 1 # # # 3072 # # # # # # #
+# Enable keys with parallel repair
+SET @@myisam_repair_threads=2;
+ALTER TABLE t1 DISABLE KEYS;
+ALTER TABLE t1 ENABLE KEYS;
+SET @@myisam_repair_threads=1;
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/myisampack.result b/mysql-test/r/myisampack.result
new file mode 100644
index 00000000000..5f39d318234
--- /dev/null
+++ b/mysql-test/r/myisampack.result
@@ -0,0 +1,29 @@
+CREATE TABLE t1(c1 DOUBLE, c2 DOUBLE, c3 DOUBLE, c4 DOUBLE, c5 DOUBLE,
+c6 DOUBLE, c7 DOUBLE, c8 DOUBLE, c9 DOUBLE, a INT PRIMARY KEY);
+INSERT INTO t1 VALUES
+(-3.31168791059336e-06,-3.19054655887874e-06,-1.06528081684847e-05,-1.227278240089e-06,-1.66718069164799e-06,-2.59038972510885e-06,-2.83145227805303e-06,-4.09678491270648e-07,-2.22610091291797e-06,6),
+(0.0030743000272545,2.53222044316438e-05,2.78674650061845e-05,1.95914465544536e-05,1.7347572525984e-05,1.87513810069614e-05,1.69882826885005e-05,2.44449336987598e-05,1.89914629921774e-05,9),
+(2.85229319423495e-05,3.05970988282259e-05,3.77161100113133e-05,2.3055238978766e-05,2.08241267364615e-05,2.28009504270553e-05,2.12070165658947e-05,2.84350091565409e-05,2.3366822910704e-05,3),
+(0,0,0,0,0,0,0,0,0,12),
+(3.24544577570754e-05,3.44619021870993e-05,4.37561613201124e-05,2.57556808726748e-05,2.3195354640561e-05,2.58532400758869e-05,2.34934241667179e-05,3.1621640063232e-05,2.58229982746189e-05,19),
+(2.53222044316438e-05,0.00445071933455582,2.97447268116016e-05,2.12379514059868e-05,1.86777776502663e-05,2.0170058676712e-05,1.8946030385445e-05,2.66040037173511e-05,2.09161899668946e-05,20),
+(3.03462382611645e-05,3.26517930083994e-05,3.5242025468662e-05,2.53219745106391e-05,2.24384532945004e-05,2.4052346047657e-05,2.23865572957053e-05,3.1634313969082e-05,2.48285463481801e-05,21),
+(1.95914465544536e-05,2.12379514059868e-05,2.27808649037128e-05,0.000341724375366877,1.4512761275113e-05,1.56475828693953e-05,1.44372366441415e-05,2.07952121981765e-05,1.61488256935919e-05,28),
+(1.7347572525984e-05,1.86777776502663e-05,2.04116907052727e-05,1.4512761275113e-05,0.000432162526082388,1.38116514014465e-05,1.2712914948904e-05,1.82503165178506e-05,1.43043075345922e-05,30),
+(1.68339762136661e-05,1.77836497166611e-05,2.36328309295222e-05,1.30183423732016e-05,1.18674654241553e-05,1.32467273128652e-05,1.24581739117775e-05,1.55624190959406e-05,1.33010638508213e-05,31),
+(1.89643062824415e-05,2.06997140070717e-05,2.29045490159364e-05,1.57918175731019e-05,1.39864987449492e-05,1.50580274578455e-05,1.45908734129609e-05,1.95329296993327e-05,1.5814709481221e-05,32),
+(1.69882826885005e-05,1.8946030385445e-05,2.00820439721439e-05,1.44372366441415e-05,1.2712914948904e-05,1.35209686474184e-05,0.00261563314789896,1.78285095864627e-05,1.46699314500019e-05,34),
+(2.0278186540684e-05,2.18923409729654e-05,2.39981539939738e-05,1.71774589459438e-05,1.54654355357383e-05,1.62731485707636e-05,1.49253140625051e-05,2.18229800160297e-05,1.71923561673718e-05,35),
+(2.44449336987598e-05,2.66040037173511e-05,2.84860148925308e-05,2.07952121981765e-05,1.82503165178506e-05,1.97667730441441e-05,1.78285095864627e-05,0.00166478601822712,2.0299952103232e-05,36),
+(1.89914629921774e-05,2.09161899668946e-05,2.26026841007872e-05,1.61488256935919e-05,1.43043075345922e-05,1.52609063290127e-05,1.46699314500019e-05,2.0299952103232e-05,0.00306670170971682,39),
+(0,0,0,0,0,0,0,0,0,41),
+(0,0,0,0,0,0,0,0,0,17),
+(0,0,0,0,0,0,0,0,0,18),
+(2.51880677333017e-05,2.63051795435778e-05,2.79874748974906e-05,2.02888886670845e-05,1.8178636318197e-05,1.91308527003585e-05,1.83260023644133e-05,2.4422300558171e-05,1.96411467520551e-05,44),
+(2.22402118719591e-05,2.37546284320705e-05,2.58463051055541e-05,1.83391609130854e-05,1.6300720519646e-05,1.74559091886791e-05,1.63733785575587e-05,2.26616253279828e-05,1.79541237435621e-05,45),
+(3.01092775359837e-05,3.23865212934412e-05,4.09444584045994e-05,0,2.15470966302776e-05,2.39082636344032e-05,2.28296706429177e-05,2.9007671511595e-05,2.44201138973326e-05,46);
+FLUSH TABLES;
+CHECK TABLE t1 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result
index c6e589a5fb7..eded1a3fc3b 100644
--- a/mysql-test/r/mysql.result
+++ b/mysql-test/r/mysql.result
@@ -178,4 +178,6 @@ ERROR at line 1: DELIMITER cannot contain a backslash character
1
1
1
+This is a file starting with UTF8 BOM 0xEFBBBF
+This is a file starting with UTF8 BOM 0xEFBBBF
End of 5.0 tests
diff --git a/mysql-test/r/mysql_comments.result b/mysql-test/r/mysql_comments.result
new file mode 100644
index 00000000000..366ceeb5bbf
--- /dev/null
+++ b/mysql-test/r/mysql_comments.result
@@ -0,0 +1,50 @@
+drop table if exists t1;
+drop function if exists foofct;
+drop procedure if exists empty;
+drop procedure if exists foosp;
+drop procedure if exists nicesp;
+drop trigger if exists t1_empty;
+drop trigger if exists t1_bi;
+"Pass 1 : --disable-comments"
+1
+1
+2
+2
+foofct("call 1")
+call 1
+Function sql_mode Create Function
+foofct CREATE DEFINER=`root`@`localhost` FUNCTION `foofct`(x char(20)) RETURNS char(20) CHARSET latin1\nreturn\n\n\n\nx
+foofct("call 2")
+call 2
+Function sql_mode Create Function
+foofct CREATE DEFINER=`root`@`localhost` FUNCTION `foofct`(x char(20)) RETURNS char(20) CHARSET latin1\nbegin\n \n \n \n\n \n\n \n return x;\nend
+Procedure sql_mode Create Procedure
+empty CREATE DEFINER=`root`@`localhost` PROCEDURE `empty`()\nbegin\nend
+id data
+foo 42
+Procedure sql_mode Create Procedure
+foosp CREATE DEFINER=`root`@`localhost` PROCEDURE `foosp`()\ninsert into test.t1\n\n\n\n\n \n\n \n values ("foo", 42)
+Procedure sql_mode Create Procedure
+nicesp CREATE DEFINER=`root`@`localhost` PROCEDURE `nicesp`(a int)\nbegin\n \n declare b int;\n declare c float;\n\n \n \n\n \nend
+"Pass 2 : --enable-comments"
+1
+1
+2
+2
+foofct("call 1")
+call 1
+Function sql_mode Create Function
+foofct CREATE DEFINER=`root`@`localhost` FUNCTION `foofct`(x char(20)) RETURNS char(20) CHARSET latin1\nreturn\n-- comment 1a\n# comment 1b\n/* comment 1c */\nx # after body, on same line
+foofct("call 2")
+call 2
+Function sql_mode Create Function
+foofct CREATE DEFINER=`root`@`localhost` FUNCTION `foofct`(x char(20)) RETURNS char(20) CHARSET latin1\nbegin\n -- comment 1a\n # comment 1b\n /*\n comment 1c\n */\n\n -- empty line below\n\n -- empty line above\n return x;\nend
+Procedure sql_mode Create Procedure
+empty CREATE DEFINER=`root`@`localhost` PROCEDURE `empty`()\nbegin\nend
+id data
+foo 42
+Procedure sql_mode Create Procedure
+foosp CREATE DEFINER=`root`@`localhost` PROCEDURE `foosp`()\ninsert into test.t1\n## These comments are part of the procedure body, and should be kept.\n# Comment 2a\n-- Comment 2b\n/* Comment 2c */\n -- empty line below\n\n -- empty line above\n values ("foo", 42) # comment 3, still part of the body
+Procedure sql_mode Create Procedure
+nicesp CREATE DEFINER=`root`@`localhost` PROCEDURE `nicesp`(a int)\nbegin\n -- declare some variables here\n declare b int;\n declare c float;\n\n -- do more stuff here\n -- commented nicely and so on\n\n -- famous last words ...\nend
+End of 5.0 tests
diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result
index d16a4c39a11..9f001c293de 100644
--- a/mysql-test/r/mysqlbinlog.result
+++ b/mysql-test/r/mysqlbinlog.result
@@ -325,4 +325,5 @@ flush logs;
drop table t1;
1
drop table t1;
+shell> mysqlbinlog std_data/corrupt-relay-bin.000624 > var/tmp/bug31793.sql
End of 5.0 tests
diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result
index 207b6ec88df..dcd55200914 100644
--- a/mysql-test/r/mysqlcheck.result
+++ b/mysql-test/r/mysqlcheck.result
@@ -1,4 +1,4 @@
-DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t1, `t``1`, `t 1`;
drop view if exists v1;
drop database if exists client_test_db;
mysql.columns_priv OK
@@ -41,6 +41,11 @@ test.t1 OK
test.t1 OK
drop view v1;
drop table t1;
+create table `t``1`(a int);
+create table `t 1`(a int);
+test.t 1 OK
+test.t`1 OK
+drop table `t``1`, `t 1`;
create database d_bug25347;
use d_bug25347;
create table t_bug25347 (a int);
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 42c437857b7..ca0aa399a56 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -3544,5 +3544,27 @@ c1
2
DROP TABLE t1,t2;
#
+# Bug#29815: new option for suppressing last line of mysqldump:
+# "Dump completed on"
+#
+# --skip-dump-date:
+--
+
+
+
+-- Dump completed
+# --dump-date:
+--
+
+
+
+-- Dump completed on DATE
+# --dump-date (default):
+--
+
+
+
+-- Dump completed on DATE
+#
# End of 5.0 tests
#
diff --git a/mysql-test/r/named_pipe.result b/mysql-test/r/named_pipe.result
new file mode 100644
index 00000000000..5d22fe4a69b
--- /dev/null
+++ b/mysql-test/r/named_pipe.result
@@ -0,0 +1,2153 @@
+drop table if exists t1,t2,t3,t4;
+CREATE TABLE t1 (
+Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
+Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
+);
+INSERT INTO t1 VALUES (9410,9412);
+select period from t1;
+period
+9410
+select * from t1;
+Period Varor_period
+9410 9412
+select t1.* from t1;
+Period Varor_period
+9410 9412
+CREATE TABLE t2 (
+auto int not null auto_increment,
+fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL,
+companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL,
+fld3 char(30) DEFAULT '' NOT NULL,
+fld4 char(35) DEFAULT '' NOT NULL,
+fld5 char(35) DEFAULT '' NOT NULL,
+fld6 char(4) DEFAULT '' NOT NULL,
+UNIQUE fld1 (fld1),
+KEY fld3 (fld3),
+PRIMARY KEY (auto)
+);
+select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%";
+fld3
+imaginable
+select fld3 from t2 where fld3 like "%cultivation" ;
+fld3
+cultivation
+select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3;
+fld3 companynr
+concoct 58
+druggists 58
+engrossing 58
+Eurydice 58
+exclaimers 58
+ferociousness 58
+hopelessness 58
+Huey 58
+imaginable 58
+judges 58
+merging 58
+ostrich 58
+peering 58
+Phelps 58
+presumes 58
+Ruth 58
+sentences 58
+Shylock 58
+straggled 58
+synergy 58
+thanking 58
+tying 58
+unlocks 58
+select fld3,companynr from t2 where companynr = 58 order by fld3;
+fld3 companynr
+concoct 58
+druggists 58
+engrossing 58
+Eurydice 58
+exclaimers 58
+ferociousness 58
+hopelessness 58
+Huey 58
+imaginable 58
+judges 58
+merging 58
+ostrich 58
+peering 58
+Phelps 58
+presumes 58
+Ruth 58
+sentences 58
+Shylock 58
+straggled 58
+synergy 58
+thanking 58
+tying 58
+unlocks 58
+select fld3 from t2 order by fld3 desc limit 10;
+fld3
+youthfulness
+yelped
+Wotan
+workers
+Witt
+witchcraft
+Winsett
+Willy
+willed
+wildcats
+select fld3 from t2 order by fld3 desc limit 5;
+fld3
+youthfulness
+yelped
+Wotan
+workers
+Witt
+select fld3 from t2 order by fld3 desc limit 5,5;
+fld3
+witchcraft
+Winsett
+Willy
+willed
+wildcats
+select t2.fld3 from t2 where fld3 = 'honeysuckle';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'h%le';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_';
+fld3
+select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%';
+fld3
+explain select t2.fld3 from t2 where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
+explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
+explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
+explain select fld3 from t2 ignore index (fld3,not_used);
+ERROR HY000: Key 'not_used' doesn't exist in table 't2'
+explain select fld3 from t2 use index (not_used);
+ERROR HY000: Key 'not_used' doesn't exist in table 't2'
+select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
+fld3
+honeysuckle
+honoring
+explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range fld3 fld3 30 NULL 2 Using where; Using index
+select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3;
+fld1 fld3
+148504 Colombo
+068305 Colombo
+000000 nondecreasing
+select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes';
+fld1 fld3
+232605 appendixes
+1232605 appendixes
+1232606 appendixes
+1232607 appendixes
+1232608 appendixes
+1232609 appendixes
+select fld1 from t2 where fld1=250501 or fld1="250502";
+fld1
+250501
+250502
+explain select fld1 from t2 where fld1=250501 or fld1="250502";
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range fld1 fld1 4 NULL 2 Using where; Using index
+select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502;
+fld1
+250501
+250502
+250505
+250601
+explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range fld1 fld1 4 NULL 4 Using where; Using index
+select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%';
+fld1 fld3
+218401 faithful
+018007 fanatic
+228311 fated
+018017 featherweight
+218022 feed
+088303 feminine
+058004 Fenton
+038017 fetched
+018054 fetters
+208101 fiftieth
+238007 filial
+013606 fingerings
+218008 finishers
+038205 firearm
+188505 fitting
+202301 Fitzpatrick
+238008 fixedly
+012001 flanking
+018103 flint
+018104 flopping
+188007 flurried
+013602 foldout
+226205 foothill
+232102 forgivably
+228306 forthcoming
+186002 freakish
+208113 freest
+231315 freezes
+036002 funereal
+226209 furnishings
+198006 furthermore
+select fld3 from t2 where fld3 like "L%" and fld3 = "ok";
+fld3
+select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly");
+fld3
+Chantilly
+select fld1,fld3 from t2 where fld1 like "25050%";
+fld1 fld3
+250501 poisoning
+250502 Iraqis
+250503 heaving
+250504 population
+250505 bomb
+select fld1,fld3 from t2 where fld1 like "25050_";
+fld1 fld3
+250501 poisoning
+250502 Iraqis
+250503 heaving
+250504 population
+250505 bomb
+select distinct companynr from t2;
+companynr
+00
+37
+36
+50
+58
+29
+40
+53
+65
+41
+34
+68
+select distinct companynr from t2 order by companynr;
+companynr
+00
+29
+34
+36
+37
+40
+41
+50
+53
+58
+65
+68
+select distinct companynr from t2 order by companynr desc;
+companynr
+68
+65
+58
+53
+50
+41
+40
+37
+36
+34
+29
+00
+select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%";
+fld3 period
+obliterates 9410
+offload 9410
+opaquely 9410
+organizer 9410
+overestimating 9410
+overlay 9410
+select distinct fld3 from t2 where companynr = 34 order by fld3;
+fld3
+absentee
+accessed
+ahead
+alphabetic
+Asiaticizations
+attitude
+aye
+bankruptcies
+belays
+Blythe
+bomb
+boulevard
+bulldozes
+cannot
+caressing
+charcoal
+checksumming
+chess
+clubroom
+colorful
+cosy
+creator
+crying
+Darius
+diffusing
+duality
+Eiffel
+Epiphany
+Ernestine
+explorers
+exterminated
+famine
+forked
+Gershwins
+heaving
+Hodges
+Iraqis
+Italianization
+Lagos
+landslide
+libretto
+Majorca
+mastering
+narrowed
+occurred
+offerers
+Palestine
+Peruvianizes
+pharmaceutic
+poisoning
+population
+Pygmalion
+rats
+realest
+recording
+regimented
+retransmitting
+reviver
+rouses
+scars
+sicker
+sleepwalk
+stopped
+sugars
+translatable
+uncles
+unexpected
+uprisings
+versatility
+vest
+select distinct fld3 from t2 limit 10;
+fld3
+abates
+abiding
+Abraham
+abrogating
+absentee
+abut
+accessed
+accruing
+accumulating
+accuracies
+select distinct fld3 from t2 having fld3 like "A%" limit 10;
+fld3
+abates
+abiding
+Abraham
+abrogating
+absentee
+abut
+accessed
+accruing
+accumulating
+accuracies
+select distinct substring(fld3,1,3) from t2 where fld3 like "A%";
+substring(fld3,1,3)
+aba
+abi
+Abr
+abs
+abu
+acc
+acq
+acu
+Ade
+adj
+Adl
+adm
+Ado
+ads
+adv
+aer
+aff
+afi
+afl
+afo
+agi
+ahe
+aim
+air
+Ald
+alg
+ali
+all
+alp
+alr
+ama
+ame
+amm
+ana
+and
+ane
+Ang
+ani
+Ann
+Ant
+api
+app
+aqu
+Ara
+arc
+Arm
+arr
+Art
+Asi
+ask
+asp
+ass
+ast
+att
+aud
+Aug
+aut
+ave
+avo
+awe
+aye
+Azt
+select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10;
+a
+aba
+abi
+Abr
+abs
+abu
+acc
+acq
+acu
+Ade
+adj
+select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10;
+substring(fld3,1,3)
+aba
+abi
+Abr
+abs
+abu
+acc
+acq
+acu
+Ade
+adj
+select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10;
+a
+aba
+abi
+Abr
+abs
+abu
+acc
+acq
+acu
+Ade
+adj
+create table t3 (
+period int not null,
+name char(32) not null,
+companynr int not null,
+price double(11,0),
+price2 double(11,0),
+key (period),
+key (name)
+);
+create temporary table tmp engine = myisam select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+alter table t3 add t2nr int not null auto_increment primary key first;
+drop table tmp;
+SET SQL_BIG_TABLES=1;
+select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10;
+namn
+Abraham Abraham
+abrogating abrogating
+admonishing admonishing
+Adolph Adolph
+afield afield
+aging aging
+ammonium ammonium
+analyzable analyzable
+animals animals
+animized animized
+SET SQL_BIG_TABLES=0;
+select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10;
+concat(fld3," ",fld3)
+Abraham Abraham
+abrogating abrogating
+admonishing admonishing
+Adolph Adolph
+afield afield
+aging aging
+ammonium ammonium
+analyzable analyzable
+animals animals
+animized animized
+select distinct fld5 from t2 limit 10;
+fld5
+neat
+Steinberg
+jarring
+tinily
+balled
+persist
+attainments
+fanatic
+measures
+rightfulness
+select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;
+fld3 count(*)
+affixed 1
+and 1
+annoyers 1
+Anthony 1
+assayed 1
+assurers 1
+attendants 1
+bedlam 1
+bedpost 1
+boasted 1
+SET SQL_BIG_TABLES=1;
+select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;
+fld3 count(*)
+affixed 1
+and 1
+annoyers 1
+Anthony 1
+assayed 1
+assurers 1
+attendants 1
+bedlam 1
+bedpost 1
+boasted 1
+SET SQL_BIG_TABLES=0;
+select distinct fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr,fld3 limit 100,10;
+fld3 repeat("a",length(fld3)) count(*)
+circus aaaaaa 1
+cited aaaaa 1
+Colombo aaaaaaa 1
+congresswoman aaaaaaaaaaaaa 1
+contrition aaaaaaaaaa 1
+corny aaaaa 1
+cultivation aaaaaaaaaaa 1
+definiteness aaaaaaaaaaaa 1
+demultiplex aaaaaaaaaaa 1
+disappointing aaaaaaaaaaaaa 1
+select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2;
+companynr rtrim(space(512+companynr))
+37
+78
+101
+154
+311
+447
+512
+select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3;
+fld3
+explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
+1 SIMPLE t3 ref period period 4 test.t1.period 4181
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t3 index period period 4 NULL 41810
+1 SIMPLE t1 ref period period 4 test.t3.period 4181
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index period period 4 NULL 41810
+1 SIMPLE t3 ref period period 4 test.t1.period 4181
+select period from t1;
+period
+9410
+select period from t1 where period=1900;
+period
+select fld3,period from t1,t2 where fld1 = 011401 order by period;
+fld3 period
+breaking 9410
+select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001;
+fld3 period
+breaking 1001
+explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 const fld1 fld1 4 const 1
+1 SIMPLE t3 const PRIMARY,period PRIMARY 4 const 1
+select fld3,period from t2,t1 where companynr*10 = 37*10;
+fld3 period
+breaking 9410
+Romans 9410
+intercepted 9410
+bewilderingly 9410
+astound 9410
+admonishing 9410
+sumac 9410
+flanking 9410
+combed 9410
+subjective 9410
+scatterbrain 9410
+Eulerian 9410
+Kane 9410
+overlay 9410
+perturb 9410
+goblins 9410
+annihilates 9410
+Wotan 9410
+snatching 9410
+concludes 9410
+laterally 9410
+yelped 9410
+grazing 9410
+Baird 9410
+celery 9410
+misunderstander 9410
+handgun 9410
+foldout 9410
+mystic 9410
+succumbed 9410
+Nabisco 9410
+fingerings 9410
+aging 9410
+afield 9410
+ammonium 9410
+boat 9410
+intelligibility 9410
+Augustine 9410
+teethe 9410
+dreaded 9410
+scholastics 9410
+audiology 9410
+wallet 9410
+parters 9410
+eschew 9410
+quitter 9410
+neat 9410
+Steinberg 9410
+jarring 9410
+tinily 9410
+balled 9410
+persist 9410
+attainments 9410
+fanatic 9410
+measures 9410
+rightfulness 9410
+capably 9410
+impulsive 9410
+starlet 9410
+terminators 9410
+untying 9410
+announces 9410
+featherweight 9410
+pessimist 9410
+daughter 9410
+decliner 9410
+lawgiver 9410
+stated 9410
+readable 9410
+attrition 9410
+cascade 9410
+motors 9410
+interrogate 9410
+pests 9410
+stairway 9410
+dopers 9410
+testicle 9410
+Parsifal 9410
+leavings 9410
+postulation 9410
+squeaking 9410
+contrasted 9410
+leftover 9410
+whiteners 9410
+erases 9410
+Punjab 9410
+Merritt 9410
+Quixotism 9410
+sweetish 9410
+dogging 9410
+scornfully 9410
+bellow 9410
+bills 9410
+cupboard 9410
+sureties 9410
+puddings 9410
+fetters 9410
+bivalves 9410
+incurring 9410
+Adolph 9410
+pithed 9410
+Miles 9410
+trimmings 9410
+tragedies 9410
+skulking 9410
+flint 9410
+flopping 9410
+relaxing 9410
+offload 9410
+suites 9410
+lists 9410
+animized 9410
+multilayer 9410
+standardizes 9410
+Judas 9410
+vacuuming 9410
+dentally 9410
+humanness 9410
+inch 9410
+Weissmuller 9410
+irresponsibly 9410
+luckily 9410
+culled 9410
+medical 9410
+bloodbath 9410
+subschema 9410
+animals 9410
+Micronesia 9410
+repetitions 9410
+Antares 9410
+ventilate 9410
+pityingly 9410
+interdependent 9410
+Graves 9410
+neonatal 9410
+chafe 9410
+honoring 9410
+realtor 9410
+elite 9410
+funereal 9410
+abrogating 9410
+sorters 9410
+Conley 9410
+lectured 9410
+Abraham 9410
+Hawaii 9410
+cage 9410
+hushes 9410
+Simla 9410
+reporters 9410
+Dutchman 9410
+descendants 9410
+groupings 9410
+dissociate 9410
+coexist 9410
+Beebe 9410
+Taoism 9410
+Connally 9410
+fetched 9410
+checkpoints 9410
+rusting 9410
+galling 9410
+obliterates 9410
+traitor 9410
+resumes 9410
+analyzable 9410
+terminator 9410
+gritty 9410
+firearm 9410
+minima 9410
+Selfridge 9410
+disable 9410
+witchcraft 9410
+betroth 9410
+Manhattanize 9410
+imprint 9410
+peeked 9410
+swelling 9410
+interrelationships 9410
+riser 9410
+Gandhian 9410
+peacock 9410
+bee 9410
+kanji 9410
+dental 9410
+scarf 9410
+chasm 9410
+insolence 9410
+syndicate 9410
+alike 9410
+imperial 9410
+convulsion 9410
+railway 9410
+validate 9410
+normalizes 9410
+comprehensive 9410
+chewing 9410
+denizen 9410
+schemer 9410
+chronicle 9410
+Kline 9410
+Anatole 9410
+partridges 9410
+brunch 9410
+recruited 9410
+dimensions 9410
+Chicana 9410
+announced 9410
+praised 9410
+employing 9410
+linear 9410
+quagmire 9410
+western 9410
+relishing 9410
+serving 9410
+scheduling 9410
+lore 9410
+eventful 9410
+arteriole 9410
+disentangle 9410
+cured 9410
+Fenton 9410
+avoidable 9410
+drains 9410
+detectably 9410
+husky 9410
+impelling 9410
+undoes 9410
+evened 9410
+squeezes 9410
+destroyer 9410
+rudeness 9410
+beaner 9410
+boorish 9410
+Everhart 9410
+encompass 9410
+mushrooms 9410
+Alison 9410
+externally 9410
+pellagra 9410
+cult 9410
+creek 9410
+Huffman 9410
+Majorca 9410
+governing 9410
+gadfly 9410
+reassigned 9410
+intentness 9410
+craziness 9410
+psychic 9410
+squabbled 9410
+burlesque 9410
+capped 9410
+extracted 9410
+DiMaggio 9410
+exclamation 9410
+subdirectory 9410
+Gothicism 9410
+feminine 9410
+metaphysically 9410
+sanding 9410
+Miltonism 9410
+freakish 9410
+index 9410
+straight 9410
+flurried 9410
+denotative 9410
+coming 9410
+commencements 9410
+gentleman 9410
+gifted 9410
+Shanghais 9410
+sportswriting 9410
+sloping 9410
+navies 9410
+leaflet 9410
+shooter 9410
+Joplin 9410
+babies 9410
+assails 9410
+admiring 9410
+swaying 9410
+Goldstine 9410
+fitting 9410
+Norwalk 9410
+analogy 9410
+deludes 9410
+cokes 9410
+Clayton 9410
+exhausts 9410
+causality 9410
+sating 9410
+icon 9410
+throttles 9410
+communicants 9410
+dehydrate 9410
+priceless 9410
+publicly 9410
+incidentals 9410
+commonplace 9410
+mumbles 9410
+furthermore 9410
+cautioned 9410
+parametrized 9410
+registration 9410
+sadly 9410
+positioning 9410
+babysitting 9410
+eternal 9410
+hoarder 9410
+congregates 9410
+rains 9410
+workers 9410
+sags 9410
+unplug 9410
+garage 9410
+boulder 9410
+specifics 9410
+Teresa 9410
+Winsett 9410
+convenient 9410
+buckboards 9410
+amenities 9410
+resplendent 9410
+sews 9410
+participated 9410
+Simon 9410
+certificates 9410
+Fitzpatrick 9410
+Evanston 9410
+misted 9410
+textures 9410
+save 9410
+count 9410
+rightful 9410
+chaperone 9410
+Lizzy 9410
+clenched 9410
+effortlessly 9410
+accessed 9410
+beaters 9410
+Hornblower 9410
+vests 9410
+indulgences 9410
+infallibly 9410
+unwilling 9410
+excrete 9410
+spools 9410
+crunches 9410
+overestimating 9410
+ineffective 9410
+humiliation 9410
+sophomore 9410
+star 9410
+rifles 9410
+dialysis 9410
+arriving 9410
+indulge 9410
+clockers 9410
+languages 9410
+Antarctica 9410
+percentage 9410
+ceiling 9410
+specification 9410
+regimented 9410
+ciphers 9410
+pictures 9410
+serpents 9410
+allot 9410
+realized 9410
+mayoral 9410
+opaquely 9410
+hostess 9410
+fiftieth 9410
+incorrectly 9410
+decomposition 9410
+stranglings 9410
+mixture 9410
+electroencephalography 9410
+similarities 9410
+charges 9410
+freest 9410
+Greenberg 9410
+tinting 9410
+expelled 9410
+warm 9410
+smoothed 9410
+deductions 9410
+Romano 9410
+bitterroot 9410
+corset 9410
+securing 9410
+environing 9410
+cute 9410
+Crays 9410
+heiress 9410
+inform 9410
+avenge 9410
+universals 9410
+Kinsey 9410
+ravines 9410
+bestseller 9410
+equilibrium 9410
+extents 9410
+relatively 9410
+pressure 9410
+critiques 9410
+befouled 9410
+rightfully 9410
+mechanizing 9410
+Latinizes 9410
+timesharing 9410
+Aden 9410
+embassies 9410
+males 9410
+shapelessly 9410
+mastering 9410
+Newtonian 9410
+finishers 9410
+abates 9410
+teem 9410
+kiting 9410
+stodgy 9410
+feed 9410
+guitars 9410
+airships 9410
+store 9410
+denounces 9410
+Pyle 9410
+Saxony 9410
+serializations 9410
+Peruvian 9410
+taxonomically 9410
+kingdom 9410
+stint 9410
+Sault 9410
+faithful 9410
+Ganymede 9410
+tidiness 9410
+gainful 9410
+contrary 9410
+Tipperary 9410
+tropics 9410
+theorizers 9410
+renew 9410
+already 9410
+terminal 9410
+Hegelian 9410
+hypothesizer 9410
+warningly 9410
+journalizing 9410
+nested 9410
+Lars 9410
+saplings 9410
+foothill 9410
+labeled 9410
+imperiously 9410
+reporters 9410
+furnishings 9410
+precipitable 9410
+discounts 9410
+excises 9410
+Stalin 9410
+despot 9410
+ripeness 9410
+Arabia 9410
+unruly 9410
+mournfulness 9410
+boom 9410
+slaughter 9410
+Sabine 9410
+handy 9410
+rural 9410
+organizer 9410
+shipyard 9410
+civics 9410
+inaccuracy 9410
+rules 9410
+juveniles 9410
+comprised 9410
+investigations 9410
+stabilizes 9410
+seminaries 9410
+Hunter 9410
+sporty 9410
+test 9410
+weasels 9410
+CERN 9410
+tempering 9410
+afore 9410
+Galatean 9410
+techniques 9410
+error 9410
+veranda 9410
+severely 9410
+Cassites 9410
+forthcoming 9410
+guides 9410
+vanish 9410
+lied 9410
+sawtooth 9410
+fated 9410
+gradually 9410
+widens 9410
+preclude 9410
+evenhandedly 9410
+percentage 9410
+disobedience 9410
+humility 9410
+gleaning 9410
+petted 9410
+bloater 9410
+minion 9410
+marginal 9410
+apiary 9410
+measures 9410
+precaution 9410
+repelled 9410
+primary 9410
+coverings 9410
+Artemia 9410
+navigate 9410
+spatial 9410
+Gurkha 9410
+meanwhile 9410
+Melinda 9410
+Butterfield 9410
+Aldrich 9410
+previewing 9410
+glut 9410
+unaffected 9410
+inmate 9410
+mineral 9410
+impending 9410
+meditation 9410
+ideas 9410
+miniaturizes 9410
+lewdly 9410
+title 9410
+youthfulness 9410
+creak 9410
+Chippewa 9410
+clamored 9410
+freezes 9410
+forgivably 9410
+reduce 9410
+McGovern 9410
+Nazis 9410
+epistle 9410
+socializes 9410
+conceptions 9410
+Kevin 9410
+uncovering 9410
+chews 9410
+appendixes 9410
+appendixes 9410
+appendixes 9410
+appendixes 9410
+appendixes 9410
+appendixes 9410
+raining 9410
+infest 9410
+compartment 9410
+minting 9410
+ducks 9410
+roped 9410
+waltz 9410
+Lillian 9410
+repressions 9410
+chillingly 9410
+noncritical 9410
+lithograph 9410
+spongers 9410
+parenthood 9410
+posed 9410
+instruments 9410
+filial 9410
+fixedly 9410
+relives 9410
+Pandora 9410
+watering 9410
+ungrateful 9410
+secures 9410
+poison 9410
+dusted 9410
+encompasses 9410
+presentation 9410
+Kantian 9410
+select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price;
+fld3 period price price2
+admonishing 1002 28357832 8723648
+analyzable 1002 28357832 8723648
+annihilates 1001 5987435 234724
+Antares 1002 28357832 8723648
+astound 1001 5987435 234724
+audiology 1001 5987435 234724
+Augustine 1002 28357832 8723648
+Baird 1002 28357832 8723648
+bewilderingly 1001 5987435 234724
+breaking 1001 5987435 234724
+Conley 1001 5987435 234724
+dentally 1002 28357832 8723648
+dissociate 1002 28357832 8723648
+elite 1001 5987435 234724
+eschew 1001 5987435 234724
+Eulerian 1001 5987435 234724
+flanking 1001 5987435 234724
+foldout 1002 28357832 8723648
+funereal 1002 28357832 8723648
+galling 1002 28357832 8723648
+Graves 1001 5987435 234724
+grazing 1001 5987435 234724
+groupings 1001 5987435 234724
+handgun 1001 5987435 234724
+humility 1002 28357832 8723648
+impulsive 1002 28357832 8723648
+inch 1001 5987435 234724
+intelligibility 1001 5987435 234724
+jarring 1001 5987435 234724
+lawgiver 1001 5987435 234724
+lectured 1002 28357832 8723648
+Merritt 1002 28357832 8723648
+neonatal 1001 5987435 234724
+offload 1002 28357832 8723648
+parters 1002 28357832 8723648
+pityingly 1002 28357832 8723648
+puddings 1002 28357832 8723648
+Punjab 1001 5987435 234724
+quitter 1002 28357832 8723648
+realtor 1001 5987435 234724
+relaxing 1001 5987435 234724
+repetitions 1001 5987435 234724
+resumes 1001 5987435 234724
+Romans 1002 28357832 8723648
+rusting 1001 5987435 234724
+scholastics 1001 5987435 234724
+skulking 1002 28357832 8723648
+stated 1002 28357832 8723648
+suites 1002 28357832 8723648
+sureties 1001 5987435 234724
+testicle 1002 28357832 8723648
+tinily 1002 28357832 8723648
+tragedies 1001 5987435 234724
+trimmings 1001 5987435 234724
+vacuuming 1001 5987435 234724
+ventilate 1001 5987435 234724
+wallet 1001 5987435 234724
+Weissmuller 1002 28357832 8723648
+Wotan 1002 28357832 8723648
+select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37;
+fld1 fld3 period price price2
+018201 relaxing 1001 5987435 234724
+018601 vacuuming 1001 5987435 234724
+018801 inch 1001 5987435 234724
+018811 repetitions 1001 5987435 234724
+create table t4 (
+companynr tinyint(2) unsigned zerofill NOT NULL default '00',
+companyname char(30) NOT NULL default '',
+PRIMARY KEY (companynr),
+UNIQUE KEY companyname(companyname)
+) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
+select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
+companynr companyname
+00 Unknown
+29 company 1
+34 company 2
+36 company 3
+37 company 4
+40 company 5
+41 company 6
+50 company 11
+53 company 7
+58 company 8
+65 company 9
+68 company 10
+select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
+companynr companyname
+00 Unknown
+29 company 1
+34 company 2
+36 company 3
+37 company 4
+40 company 5
+41 company 6
+50 company 11
+53 company 7
+58 company 8
+65 company 9
+68 company 10
+select * from t1,t1 t12;
+Period Varor_period Period Varor_period
+9410 9412 9410 9412
+select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505;
+fld1 fld1
+250501 250501
+250502 250501
+250503 250501
+250504 250501
+250505 250501
+250501 250502
+250502 250502
+250503 250502
+250504 250502
+250505 250502
+250501 250503
+250502 250503
+250503 250503
+250504 250503
+250505 250503
+250501 250504
+250502 250504
+250503 250504
+250504 250504
+250505 250504
+250501 250505
+250502 250505
+250503 250505
+250504 250505
+250505 250505
+insert into t2 (fld1, companynr) values (999999,99);
+select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null;
+companynr companyname
+99 NULL
+select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null;
+count(*)
+1199
+explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1200
+1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using where; Not exists
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 Using where; Not exists
+select companynr,companyname from t2 left join t4 using (companynr) where companynr is null;
+companynr companyname
+select count(*) from t2 left join t4 using (companynr) where companynr is not null;
+count(*)
+1200
+explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+delete from t2 where fld1=999999;
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
+companynr companynr
+37 36
+41 40
+explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008;
+fld1 companynr fld3 period
+038008 37 reporters 1008
+038208 37 Selfridge 1008
+select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009;
+fld1 companynr fld3 period
+038008 37 reporters 1008
+038208 37 Selfridge 1008
+select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009;
+fld1 companynr fld3 period
+038008 37 reporters 1008
+038208 37 Selfridge 1008
+select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909);
+period
+9410
+select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6)));
+period
+9410
+select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1;
+fld1
+250501
+250502
+250503
+250505
+select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606);
+fld1
+250502
+250503
+select fld1 from t2 where fld1 between 250502 and 250504;
+fld1
+250502
+250503
+250504
+select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ;
+fld3
+label
+labeled
+labeled
+landslide
+laterally
+leaflet
+lewdly
+Lillian
+luckily
+select count(*) from t1;
+count(*)
+1
+select companynr,count(*),sum(fld1) from t2 group by companynr;
+companynr count(*) sum(fld1)
+00 82 10355753
+29 95 14473298
+34 70 17788966
+36 215 22786296
+37 588 83602098
+40 37 6618386
+41 52 12816335
+50 11 1595438
+53 4 793210
+58 23 2254293
+65 10 2284055
+68 12 3097288
+select companynr,count(*) from t2 group by companynr order by companynr desc limit 5;
+companynr count(*)
+68 12
+65 10
+58 23
+53 4
+50 11
+select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>"";
+count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1)
+70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069
+explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>"";
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+Warnings:
+Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> _latin1''))
+select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3;
+companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1)
+00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087
+29 95 abut wetness 14473298 152350.5053 8368.5480 70032594.9026
+34 70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069
+select companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10;
+companynr t2nr count(price) sum(price) min(price) max(price) avg(price)
+37 1 1 5987435 5987435 5987435 5987435.0000
+37 2 1 28357832 28357832 28357832 28357832.0000
+37 3 1 39654943 39654943 39654943 39654943.0000
+37 11 1 5987435 5987435 5987435 5987435.0000
+37 12 1 28357832 28357832 28357832 28357832.0000
+37 13 1 39654943 39654943 39654943 39654943.0000
+37 21 1 5987435 5987435 5987435 5987435.0000
+37 22 1 28357832 28357832 28357832 28357832.0000
+37 23 1 39654943 39654943 39654943 39654943.0000
+37 31 1 5987435 5987435 5987435 5987435.0000
+select /*! SQL_SMALL_RESULT */ companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10;
+companynr t2nr count(price) sum(price) min(price) max(price) avg(price)
+37 1 1 5987435 5987435 5987435 5987435.0000
+37 2 1 28357832 28357832 28357832 28357832.0000
+37 3 1 39654943 39654943 39654943 39654943.0000
+37 11 1 5987435 5987435 5987435 5987435.0000
+37 12 1 28357832 28357832 28357832 28357832.0000
+37 13 1 39654943 39654943 39654943 39654943.0000
+37 21 1 5987435 5987435 5987435 5987435.0000
+37 22 1 28357832 28357832 28357832 28357832.0000
+37 23 1 39654943 39654943 39654943 39654943.0000
+37 31 1 5987435 5987435 5987435 5987435.0000
+select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ;
+companynr count(price) sum(price) min(price) max(price) avg(price)
+37 12543 309394878010 5987435 39654943 24666736.6667
+78 8362 414611089292 726498 98439034 49582766.0000
+101 4181 3489454238 834598 834598 834598.0000
+154 4181 4112197254950 983543950 983543950 983543950.0000
+311 4181 979599938 234298 234298 234298.0000
+447 4181 9929180954 2374834 2374834 2374834.0000
+512 4181 3288532102 786542 786542 786542.0000
+select distinct mod(companynr,10) from t4 group by companynr;
+mod(companynr,10)
+0
+9
+4
+6
+7
+1
+3
+8
+5
+select distinct 1 from t4 group by companynr;
+1
+1
+select count(distinct fld1) from t2;
+count(distinct fld1)
+1199
+select companynr,count(distinct fld1) from t2 group by companynr;
+companynr count(distinct fld1)
+00 82
+29 95
+34 70
+36 215
+37 588
+40 37
+41 52
+50 11
+53 4
+58 23
+65 10
+68 12
+select companynr,count(*) from t2 group by companynr;
+companynr count(*)
+00 82
+29 95
+34 70
+36 215
+37 588
+40 37
+41 52
+50 11
+53 4
+58 23
+65 10
+68 12
+select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr;
+companynr count(distinct concat(fld1,repeat(65,1000)))
+00 82
+29 95
+34 70
+36 215
+37 588
+40 37
+41 52
+50 11
+53 4
+58 23
+65 10
+68 12
+select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr;
+companynr count(distinct concat(fld1,repeat(65,200)))
+00 82
+29 95
+34 70
+36 215
+37 588
+40 37
+41 52
+50 11
+53 4
+58 23
+65 10
+68 12
+select companynr,count(distinct floor(fld1/100)) from t2 group by companynr;
+companynr count(distinct floor(fld1/100))
+00 47
+29 35
+34 14
+36 69
+37 108
+40 16
+41 11
+50 9
+53 1
+58 1
+65 1
+68 1
+select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr;
+companynr count(distinct concat(repeat(65,1000),floor(fld1/100)))
+00 47
+29 35
+34 14
+36 69
+37 108
+40 16
+41 11
+50 9
+53 1
+58 1
+65 1
+68 1
+select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10;
+sum(fld1) fld3
+11402 Romans
+select name,count(*) from t3 where name='cloakroom' group by name;
+name count(*)
+cloakroom 4181
+select name,count(*) from t3 where name='cloakroom' and price>10 group by name;
+name count(*)
+cloakroom 4181
+select count(*) from t3 where name='cloakroom' and price2=823742;
+count(*)
+4181
+select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name;
+name count(*)
+cloakroom 4181
+select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name;
+name count(*)
+extramarital 4181
+gazer 4181
+gems 4181
+Iranizes 4181
+spates 4181
+tucked 4181
+violinist 4181
+select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name;
+fld3 count(*)
+spates 4181
+select companynr|0,companyname from t4 group by 1;
+companynr|0 companyname
+0 Unknown
+29 company 1
+34 company 2
+36 company 3
+37 company 4
+40 company 5
+41 company 6
+50 company 11
+53 company 7
+58 company 8
+65 company 9
+68 company 10
+select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname;
+companynr companyname count(*)
+29 company 1 95
+68 company 10 12
+50 company 11 11
+34 company 2 70
+36 company 3 215
+37 company 4 588
+40 company 5 37
+41 company 6 52
+53 company 7 4
+58 company 8 23
+65 company 9 10
+00 Unknown 82
+select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name;
+fld1 count(*)
+158402 4181
+select sum(Period)/count(*) from t1;
+sum(Period)/count(*)
+9410.0000
+select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr;
+companynr count sum diff func
+37 12543 309394878010 0.0000 464091
+78 8362 414611089292 0.0000 652236
+101 4181 3489454238 0.0000 422281
+154 4181 4112197254950 0.0000 643874
+311 4181 979599938 0.0000 1300291
+447 4181 9929180954 0.0000 1868907
+512 4181 3288532102 0.0000 2140672
+select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg;
+companynr avg
+154 983543950.0000
+select companynr,count(*) from t2 group by companynr order by 2 desc;
+companynr count(*)
+37 588
+36 215
+29 95
+00 82
+34 70
+41 52
+40 37
+58 23
+68 12
+50 11
+65 10
+53 4
+select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc;
+companynr count(*)
+41 52
+58 23
+68 12
+50 11
+65 10
+53 4
+select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4;
+fld4 fld1 count(price) sum(price) min(price) max(price) avg(price)
+teethe 000001 1 5987435 5987435 5987435 5987435.0000
+dreaded 011401 1 5987435 5987435 5987435 5987435.0000
+scholastics 011402 1 28357832 28357832 28357832 28357832.0000
+audiology 011403 1 39654943 39654943 39654943 39654943.0000
+wallet 011501 1 5987435 5987435 5987435 5987435.0000
+parters 011701 1 5987435 5987435 5987435 5987435.0000
+eschew 011702 1 28357832 28357832 28357832 28357832.0000
+quitter 011703 1 39654943 39654943 39654943 39654943.0000
+neat 012001 1 5987435 5987435 5987435 5987435.0000
+Steinberg 012003 1 39654943 39654943 39654943 39654943.0000
+balled 012301 1 5987435 5987435 5987435 5987435.0000
+persist 012302 1 28357832 28357832 28357832 28357832.0000
+attainments 012303 1 39654943 39654943 39654943 39654943.0000
+capably 012501 1 5987435 5987435 5987435 5987435.0000
+impulsive 012602 1 28357832 28357832 28357832 28357832.0000
+starlet 012603 1 39654943 39654943 39654943 39654943.0000
+featherweight 012701 1 5987435 5987435 5987435 5987435.0000
+pessimist 012702 1 28357832 28357832 28357832 28357832.0000
+daughter 012703 1 39654943 39654943 39654943 39654943.0000
+lawgiver 013601 1 5987435 5987435 5987435 5987435.0000
+stated 013602 1 28357832 28357832 28357832 28357832.0000
+readable 013603 1 39654943 39654943 39654943 39654943.0000
+testicle 013801 1 5987435 5987435 5987435 5987435.0000
+Parsifal 013802 1 28357832 28357832 28357832 28357832.0000
+leavings 013803 1 39654943 39654943 39654943 39654943.0000
+squeaking 013901 1 5987435 5987435 5987435 5987435.0000
+contrasted 016001 1 5987435 5987435 5987435 5987435.0000
+leftover 016201 1 5987435 5987435 5987435 5987435.0000
+whiteners 016202 1 28357832 28357832 28357832 28357832.0000
+erases 016301 1 5987435 5987435 5987435 5987435.0000
+Punjab 016302 1 28357832 28357832 28357832 28357832.0000
+Merritt 016303 1 39654943 39654943 39654943 39654943.0000
+sweetish 018001 1 5987435 5987435 5987435 5987435.0000
+dogging 018002 1 28357832 28357832 28357832 28357832.0000
+scornfully 018003 1 39654943 39654943 39654943 39654943.0000
+fetters 018012 1 28357832 28357832 28357832 28357832.0000
+bivalves 018013 1 39654943 39654943 39654943 39654943.0000
+skulking 018021 1 5987435 5987435 5987435 5987435.0000
+flint 018022 1 28357832 28357832 28357832 28357832.0000
+flopping 018023 1 39654943 39654943 39654943 39654943.0000
+Judas 018032 1 28357832 28357832 28357832 28357832.0000
+vacuuming 018033 1 39654943 39654943 39654943 39654943.0000
+medical 018041 1 5987435 5987435 5987435 5987435.0000
+bloodbath 018042 1 28357832 28357832 28357832 28357832.0000
+subschema 018043 1 39654943 39654943 39654943 39654943.0000
+interdependent 018051 1 5987435 5987435 5987435 5987435.0000
+Graves 018052 1 28357832 28357832 28357832 28357832.0000
+neonatal 018053 1 39654943 39654943 39654943 39654943.0000
+sorters 018061 1 5987435 5987435 5987435 5987435.0000
+epistle 018062 1 28357832 28357832 28357832 28357832.0000
+Conley 018101 1 5987435 5987435 5987435 5987435.0000
+lectured 018102 1 28357832 28357832 28357832 28357832.0000
+Abraham 018103 1 39654943 39654943 39654943 39654943.0000
+cage 018201 1 5987435 5987435 5987435 5987435.0000
+hushes 018202 1 28357832 28357832 28357832 28357832.0000
+Simla 018402 1 28357832 28357832 28357832 28357832.0000
+reporters 018403 1 39654943 39654943 39654943 39654943.0000
+coexist 018601 1 5987435 5987435 5987435 5987435.0000
+Beebe 018602 1 28357832 28357832 28357832 28357832.0000
+Taoism 018603 1 39654943 39654943 39654943 39654943.0000
+Connally 018801 1 5987435 5987435 5987435 5987435.0000
+fetched 018802 1 28357832 28357832 28357832 28357832.0000
+checkpoints 018803 1 39654943 39654943 39654943 39654943.0000
+gritty 018811 1 5987435 5987435 5987435 5987435.0000
+firearm 018812 1 28357832 28357832 28357832 28357832.0000
+minima 019101 1 5987435 5987435 5987435 5987435.0000
+Selfridge 019102 1 28357832 28357832 28357832 28357832.0000
+disable 019103 1 39654943 39654943 39654943 39654943.0000
+witchcraft 019201 1 5987435 5987435 5987435 5987435.0000
+betroth 030501 1 5987435 5987435 5987435 5987435.0000
+Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000
+imprint 030503 1 39654943 39654943 39654943 39654943.0000
+swelling 031901 1 5987435 5987435 5987435 5987435.0000
+interrelationships 036001 1 5987435 5987435 5987435 5987435.0000
+riser 036002 1 28357832 28357832 28357832 28357832.0000
+bee 038001 1 5987435 5987435 5987435 5987435.0000
+kanji 038002 1 28357832 28357832 28357832 28357832.0000
+dental 038003 1 39654943 39654943 39654943 39654943.0000
+railway 038011 1 5987435 5987435 5987435 5987435.0000
+validate 038012 1 28357832 28357832 28357832 28357832.0000
+normalizes 038013 1 39654943 39654943 39654943 39654943.0000
+Kline 038101 1 5987435 5987435 5987435 5987435.0000
+Anatole 038102 1 28357832 28357832 28357832 28357832.0000
+partridges 038103 1 39654943 39654943 39654943 39654943.0000
+recruited 038201 1 5987435 5987435 5987435 5987435.0000
+dimensions 038202 1 28357832 28357832 28357832 28357832.0000
+Chicana 038203 1 39654943 39654943 39654943 39654943.0000
+select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3;
+companynr fld3 sum(price)
+512 boat 786542
+512 capably 786542
+512 cupboard 786542
+512 decliner 786542
+512 descendants 786542
+512 dopers 786542
+512 erases 786542
+512 Micronesia 786542
+512 Miles 786542
+512 skies 786542
+select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr;
+companynr count(*) min(fld3) max(fld3) sum(price) avg(price)
+00 1 Omaha Omaha 5987435 5987435.0000
+36 1 dubbed dubbed 28357832 28357832.0000
+37 83 Abraham Wotan 1908978016 22999735.1325
+50 2 scribbled tapestry 68012775 34006387.5000
+select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1;
+t3.companynr+0 t2nr fld3 sum(price)
+37 1 Omaha 5987435
+37 11401 breaking 5987435
+37 11402 Romans 28357832
+37 11403 intercepted 39654943
+37 11501 bewilderingly 5987435
+37 11701 astound 5987435
+37 11702 admonishing 28357832
+37 11703 sumac 39654943
+37 12001 flanking 5987435
+37 12003 combed 39654943
+37 12301 Eulerian 5987435
+37 12302 dubbed 28357832
+37 12303 Kane 39654943
+37 12501 annihilates 5987435
+37 12602 Wotan 28357832
+37 12603 snatching 39654943
+37 12701 grazing 5987435
+37 12702 Baird 28357832
+37 12703 celery 39654943
+37 13601 handgun 5987435
+37 13602 foldout 28357832
+37 13603 mystic 39654943
+37 13801 intelligibility 5987435
+37 13802 Augustine 28357832
+37 13803 teethe 39654943
+37 13901 scholastics 5987435
+37 16001 audiology 5987435
+37 16201 wallet 5987435
+37 16202 parters 28357832
+37 16301 eschew 5987435
+37 16302 quitter 28357832
+37 16303 neat 39654943
+37 18001 jarring 5987435
+37 18002 tinily 28357832
+37 18003 balled 39654943
+37 18012 impulsive 28357832
+37 18013 starlet 39654943
+37 18021 lawgiver 5987435
+37 18022 stated 28357832
+37 18023 readable 39654943
+37 18032 testicle 28357832
+37 18033 Parsifal 39654943
+37 18041 Punjab 5987435
+37 18042 Merritt 28357832
+37 18043 Quixotism 39654943
+37 18051 sureties 5987435
+37 18052 puddings 28357832
+37 18053 tapestry 39654943
+37 18061 trimmings 5987435
+37 18062 humility 28357832
+37 18101 tragedies 5987435
+37 18102 skulking 28357832
+37 18103 flint 39654943
+37 18201 relaxing 5987435
+37 18202 offload 28357832
+37 18402 suites 28357832
+37 18403 lists 39654943
+37 18601 vacuuming 5987435
+37 18602 dentally 28357832
+37 18603 humanness 39654943
+37 18801 inch 5987435
+37 18802 Weissmuller 28357832
+37 18803 irresponsibly 39654943
+37 18811 repetitions 5987435
+37 18812 Antares 28357832
+37 19101 ventilate 5987435
+37 19102 pityingly 28357832
+37 19103 interdependent 39654943
+37 19201 Graves 5987435
+37 30501 neonatal 5987435
+37 30502 scribbled 28357832
+37 30503 chafe 39654943
+37 31901 realtor 5987435
+37 36001 elite 5987435
+37 36002 funereal 28357832
+37 38001 Conley 5987435
+37 38002 lectured 28357832
+37 38003 Abraham 39654943
+37 38011 groupings 5987435
+37 38012 dissociate 28357832
+37 38013 coexist 39654943
+37 38101 rusting 5987435
+37 38102 galling 28357832
+37 38103 obliterates 39654943
+37 38201 resumes 5987435
+37 38202 analyzable 28357832
+37 38203 terminator 39654943
+select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008;
+sum(price)
+234298
+select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1;
+fld1 sum(price)
+038008 234298
+explain select fld3 from t2 where 1>2 or 2>3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+explain select fld3 from t2 where fld1=fld1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502;
+companynr fld1
+34 250501
+34 250502
+select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502;
+companynr fld1
+34 250501
+34 250502
+select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000;
+companynr count sum
+00 82 10355753
+29 95 14473298
+34 70 17788966
+37 588 83602098
+41 52 12816335
+select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ;
+companynr
+00
+29
+34
+37
+41
+select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40;
+companynr companyname count(*)
+68 company 10 12
+50 company 11 11
+40 company 5 37
+41 company 6 52
+53 company 7 4
+58 company 8 23
+65 company 9 10
+select count(*) from t2;
+count(*)
+1199
+select count(*) from t2 where fld1 < 098024;
+count(*)
+387
+select min(fld1) from t2 where fld1>= 098024;
+min(fld1)
+98024
+select max(fld1) from t2 where fld1>= 098024;
+max(fld1)
+1232609
+select count(*) from t3 where price2=76234234;
+count(*)
+4181
+select count(*) from t3 where companynr=512 and price2=76234234;
+count(*)
+4181
+explain select min(fld1),max(fld1),count(*) from t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select min(fld1),max(fld1),count(*) from t2;
+min(fld1) max(fld1) count(*)
+0 1232609 1199
+select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742;
+min(t2nr) max(t2nr)
+2115 2115
+select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78;
+count(*) min(t2nr) max(t2nr)
+4181 4 41804
+select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20;
+t2nr count(*)
+9 1
+19 1
+29 1
+39 1
+49 1
+59 1
+69 1
+79 1
+89 1
+99 1
+109 1
+119 1
+129 1
+139 1
+149 1
+159 1
+169 1
+179 1
+189 1
+199 1
+select max(t2nr) from t3 where price=983543950;
+max(t2nr)
+41807
+select t1.period from t3 = t1 limit 1;
+period
+1001
+select t1.period from t1 as t1 limit 1;
+period
+9410
+select t1.period as "Nuvarande period" from t1 as t1 limit 1;
+Nuvarande period
+9410
+select period as ok_period from t1 limit 1;
+ok_period
+9410
+select period as ok_period from t1 group by ok_period limit 1;
+ok_period
+9410
+select 1+1 as summa from t1 group by summa limit 1;
+summa
+2
+select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1;
+Nuvarande period
+9410
+show tables;
+Tables_in_test
+t1
+t2
+t3
+t4
+show tables from test like "s%";
+Tables_in_test (s%)
+show tables from test like "t?";
+Tables_in_test (t?)
+show full columns from t2;
+Field Type Collation Null Key Default Extra Privileges Comment
+auto int(11) NULL NO PRI NULL auto_increment #
+fld1 int(6) unsigned zerofill NULL NO UNI 000000 #
+companynr tinyint(2) unsigned zerofill NULL NO 00 #
+fld3 char(30) latin1_swedish_ci NO MUL #
+fld4 char(35) latin1_swedish_ci NO #
+fld5 char(35) latin1_swedish_ci NO #
+fld6 char(4) latin1_swedish_ci NO #
+show full columns from t2 from test like 'f%';
+Field Type Collation Null Key Default Extra Privileges Comment
+fld1 int(6) unsigned zerofill NULL NO UNI 000000 #
+fld3 char(30) latin1_swedish_ci NO MUL #
+fld4 char(35) latin1_swedish_ci NO #
+fld5 char(35) latin1_swedish_ci NO #
+fld6 char(4) latin1_swedish_ci NO #
+show full columns from t2 from test like 's%';
+Field Type Collation Null Key Default Extra Privileges Comment
+show keys from t2;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE
+t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE
+t2 1 fld3 1 fld3 A NULL NULL NULL BTREE
+drop table t4, t3, t2, t1;
+CREATE TABLE t1 (
+cont_nr int(11) NOT NULL auto_increment,
+ver_nr int(11) NOT NULL default '0',
+aufnr int(11) NOT NULL default '0',
+username varchar(50) NOT NULL default '',
+hdl_nr int(11) NOT NULL default '0',
+eintrag date NOT NULL default '0000-00-00',
+st_klasse varchar(40) NOT NULL default '',
+st_wert varchar(40) NOT NULL default '',
+st_zusatz varchar(40) NOT NULL default '',
+st_bemerkung varchar(255) NOT NULL default '',
+kunden_art varchar(40) NOT NULL default '',
+mcbs_knr int(11) default NULL,
+mcbs_aufnr int(11) NOT NULL default '0',
+schufa_status char(1) default '?',
+bemerkung text,
+wirknetz text,
+wf_igz int(11) NOT NULL default '0',
+tarifcode varchar(80) default NULL,
+recycle char(1) default NULL,
+sim varchar(30) default NULL,
+mcbs_tpl varchar(30) default NULL,
+emp_nr int(11) NOT NULL default '0',
+laufzeit int(11) default NULL,
+hdl_name varchar(30) default NULL,
+prov_hdl_nr int(11) NOT NULL default '0',
+auto_wirknetz varchar(50) default NULL,
+auto_billing varchar(50) default NULL,
+touch timestamp NOT NULL,
+kategorie varchar(50) default NULL,
+kundentyp varchar(20) NOT NULL default '',
+sammel_rech_msisdn varchar(30) NOT NULL default '',
+p_nr varchar(9) NOT NULL default '',
+suffix char(3) NOT NULL default '',
+PRIMARY KEY (cont_nr),
+KEY idx_aufnr(aufnr),
+KEY idx_hdl_nr(hdl_nr),
+KEY idx_st_klasse(st_klasse),
+KEY ver_nr(ver_nr),
+KEY eintrag_idx(eintrag),
+KEY emp_nr_idx(emp_nr),
+KEY wf_igz(wf_igz),
+KEY touch(touch),
+KEY hdl_tag(eintrag,hdl_nr),
+KEY prov_hdl_nr(prov_hdl_nr),
+KEY mcbs_aufnr(mcbs_aufnr),
+KEY kundentyp(kundentyp),
+KEY p_nr(p_nr,suffix)
+) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359359,468,3359359,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1507831,2143894,'+','','P',1909162,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359360,0,0,'Mustermann Musterfrau',29674907,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1900169997,2414578,'+',NULL,'N',1909148,'',NULL,NULL,'RV99066_2',20,NULL,'POS',29674907,NULL,NULL,20010202105916,'Mobilfunk','','','97317481','007');
+INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag storniert','','(7001-84):Storno, Kd. möchte nicht mehr','privat',NULL,0,'+','','P',1909150,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie;
+Kundentyp kategorie
+Privat (Private Nutzung) Mobilfunk
+Warnings:
+Warning 1052 Column 'kundentyp' in group statement is ambiguous
+drop table t1;
diff --git a/mysql-test/r/ndb_condition_pushdown.result b/mysql-test/r/ndb_condition_pushdown.result
index 6012c9b6969..d49c0cd983e 100644
--- a/mysql-test/r/ndb_condition_pushdown.result
+++ b/mysql-test/r/ndb_condition_pushdown.result
@@ -1888,5 +1888,27 @@ set engine_condition_pushdown = 1;
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
fname lname
Young Foo
+drop table t1;
+create table t1 (a int, b int, c int, d int, primary key using hash(a))
+engine=ndbcluster;
+insert into t1 values (10,1,100,0+0x1111);
+insert into t1 values (20,2,200,0+0x2222);
+insert into t1 values (30,3,300,0+0x3333);
+insert into t1 values (40,4,400,0+0x4444);
+insert into t1 values (50,5,500,0+0x5555);
+set engine_condition_pushdown = on;
+select a,b,d from t1
+where b in (0,1,2,5)
+order by b;
+a b d
+10 1 4369
+20 2 8738
+50 5 21845
+a b d
+10 1 4369
+20 2 8738
+50 5 21845
+Warnings:
+Warning 4294 Scan filter is too large, discarded
set engine_condition_pushdown = @old_ecpd;
DROP TABLE t1,t2,t3,t4,t5;
diff --git a/mysql-test/r/ndb_update.result b/mysql-test/r/ndb_update.result
index d75f82172ae..7848a47bcef 100644
--- a/mysql-test/r/ndb_update.result
+++ b/mysql-test/r/ndb_update.result
@@ -39,4 +39,12 @@ pk1 b c
10 0 0
12 2 2
14 1 1
+create unique index ib on t1(b);
+update t1 set c = 4 where pk1 = 12;
+update ignore t1 set b = 55 where pk1 = 14;
+select * from t1 order by pk1;
+pk1 b c
+10 0 0
+12 2 4
+14 55 1
DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result
index c33adee76b2..090f41baec3 100644
--- a/mysql-test/r/null.result
+++ b/mysql-test/r/null.result
@@ -1,4 +1,4 @@
-drop table if exists t1;
+drop table if exists t1, t2;
select null,\N,isnull(null),isnull(1/0),isnull(1/0 = null),ifnull(null,1),ifnull(null,"TRUE"),ifnull("TRUE","ERROR"),1/0 is null,1 is not null;
NULL NULL isnull(null) isnull(1/0) isnull(1/0 = null) ifnull(null,1) ifnull(null,"TRUE") ifnull("TRUE","ERROR") 1/0 is null 1 is not null
NULL NULL 1 1 1 1 TRUE TRUE 1 1
@@ -320,3 +320,26 @@ bug19145c CREATE TABLE `bug19145c` (
drop table bug19145a;
drop table bug19145b;
drop table bug19145c;
+# End of 4.1 tests
+#
+# Bug #31471: decimal_bin_size: Assertion `scale >= 0 &&
+# precision > 0 && scale <= precision'
+#
+CREATE TABLE t1 (a DECIMAL (1, 0) ZEROFILL, b DECIMAL (1, 0) ZEROFILL);
+INSERT INTO t1 (a, b) VALUES (0, 0);
+CREATE TABLE t2 SELECT IFNULL(a, b) FROM t1;
+DESCRIBE t2;
+Field Type Null Key Default Extra
+IFNULL(a, b) decimal(1,0) unsigned YES NULL
+DROP TABLE t2;
+CREATE TABLE t2 SELECT IFNULL(a, NULL) FROM t1;
+DESCRIBE t2;
+Field Type Null Key Default Extra
+IFNULL(a, NULL) decimal(1,0) YES NULL
+DROP TABLE t2;
+CREATE TABLE t2 SELECT IFNULL(NULL, b) FROM t1;
+DESCRIBE t2;
+Field Type Null Key Default Extra
+IFNULL(NULL, b) decimal(1,0) YES NULL
+DROP TABLE t1, t2;
+# End of 5.0 tests
diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result
index 4a54b17316d..ad04e7304c9 100644
--- a/mysql-test/r/olap.result
+++ b/mysql-test/r/olap.result
@@ -715,3 +715,22 @@ a SUM(a)
4 4
NULL 14
DROP TABLE t1;
+#
+# Bug#31095: Unexpected NULL constant caused server crash.
+#
+create table t1(a int);
+insert into t1 values (1),(2),(3);
+select count(a) from t1 group by null with rollup;
+count(a)
+3
+3
+drop table t1;
+##############################################################
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES(0);
+SELECT 1 FROM t1 GROUP BY (DATE(NULL)) WITH ROLLUP;
+1
+1
+1
+DROP TABLE t1;
+End of 5.0 tests
diff --git a/mysql-test/r/outfile_loaddata.result b/mysql-test/r/outfile_loaddata.result
new file mode 100644
index 00000000000..1bcaf308b7c
--- /dev/null
+++ b/mysql-test/r/outfile_loaddata.result
@@ -0,0 +1,85 @@
+DROP TABLE IF EXISTS t1, t2;
+#
+# Bug#31663 FIELDS TERMINATED BY special character
+#
+CREATE TABLE t1 (i1 int, i2 int, c1 VARCHAR(256), c2 VARCHAR(256));
+INSERT INTO t1 VALUES (101, 202, '-r-', '=raker=');
+# FIELDS TERMINATED BY 'raker', warning:
+SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug31663.txt' FIELDS TERMINATED BY 'raker' FROM t1;
+Warnings:
+Warning 1475 First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BY
+SELECT LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug31663.txt');
+LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug31663.txt')
+101raker202raker-r-raker=raker=
+
+CREATE TABLE t2 SELECT * FROM t1;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 FIELDS TERMINATED BY 'raker';
+Warnings:
+Warning 1262 Row 1 was truncated; it contained more data than there were input columns
+SELECT * FROM t2;
+i1 i2 c1 c2
+101 202 -r- =raker=
+101 202 -r- =
+DROP TABLE t2;
+# Only numeric fields, FIELDS TERMINATED BY 'r', no warnings:
+SELECT i1, i2 INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug31663.txt' FIELDS TERMINATED BY 'r' FROM t1;
+SELECT LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug31663.txt');
+LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug31663.txt')
+101r202
+
+CREATE TABLE t2 SELECT i1, i2 FROM t1;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 FIELDS TERMINATED BY 'r';
+SELECT i1, i2 FROM t2;
+i1 i2
+101 202
+101 202
+DROP TABLE t2;
+# FIELDS TERMINATED BY '0', warning:
+SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug31663.txt' FIELDS TERMINATED BY '0' FROM t1;
+Warnings:
+Warning 1475 First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BY
+SELECT LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug31663.txt');
+LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug31663.txt')
+10102020-r-0=raker=
+
+CREATE TABLE t2 SELECT * FROM t1;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 FIELDS TERMINATED BY '0';
+Warnings:
+Warning 1262 Row 1 was truncated; it contained more data than there were input columns
+SELECT * FROM t2;
+i1 i2 c1 c2
+101 202 -r- =raker=
+1 1 2 2
+DROP TABLE t2;
+# FIELDS OPTIONALLY ENCLOSED BY '"' TERMINATED BY '0', warning:
+SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug31663.txt' FIELDS OPTIONALLY ENCLOSED BY '"' TERMINATED BY '0' FROM t1;
+Warnings:
+Warning 1475 First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BY
+SELECT LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug31663.txt');
+LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug31663.txt')
+10102020"-r-"0"=raker="
+
+CREATE TABLE t2 SELECT * FROM t1;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 FIELDS OPTIONALLY ENCLOSED BY '"' TERMINATED BY '0';
+Warnings:
+Warning 1262 Row 1 was truncated; it contained more data than there were input columns
+SELECT * FROM t2;
+i1 i2 c1 c2
+101 202 -r- =raker=
+1 1 2 2
+DROP TABLE t2;
+# Only string fields, FIELDS OPTIONALLY ENCLOSED BY '"' TERMINATED BY '0', no warnings:
+SELECT c1, c2 INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug31663.txt' FIELDS OPTIONALLY ENCLOSED BY '"' TERMINATED BY '0' FROM t1;
+SELECT LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug31663.txt');
+LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug31663.txt')
+"-r-"0"=raker="
+
+CREATE TABLE t2 SELECT c1, c2 FROM t1;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 FIELDS OPTIONALLY ENCLOSED BY '"' TERMINATED BY '0';
+SELECT c1, c2 FROM t2;
+c1 c2
+-r- =raker=
+-r- =raker=
+DROP TABLE t2;
+DROP TABLE t1;
+# End of 5.0 tests.
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index 4db588e5cac..0682cae5c80 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -1136,6 +1136,11 @@ a
13
DEALLOCATE PREPARE st1;
DROP TABLE t1;
+create table t1 (a int, b tinyint);
+prepare st1 from 'update t1 set b= (str_to_date(a, a))';
+execute st1;
+deallocate prepare st1;
+drop table t1;
End of 4.1 tests.
create table t1 (a varchar(20));
insert into t1 values ('foo');
diff --git a/mysql-test/r/repair.result b/mysql-test/r/repair.result
index bd746711f1f..e0548233b86 100644
--- a/mysql-test/r/repair.result
+++ b/mysql-test/r/repair.result
@@ -88,3 +88,30 @@ test.t1 repair status OK
SET myisam_repair_threads=@@global.myisam_repair_threads;
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
DROP TABLE t1;
+CREATE TABLE t1(a CHAR(255), KEY(a));
+SET myisam_sort_buffer_size=4496;
+INSERT INTO t1 VALUES
+('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'),('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');
+SET myisam_repair_threads=2;
+REPAIR TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+SET myisam_repair_threads=@@global.myisam_repair_threads;
+SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
+DROP TABLE t1;
+End of 4.1 tests
diff --git a/mysql-test/r/rpl_flush_log_loop.result b/mysql-test/r/rpl_flush_log_loop.result
index f9bd42ec26c..3b1db804da9 100644
--- a/mysql-test/r/rpl_flush_log_loop.result
+++ b/mysql-test/r/rpl_flush_log_loop.result
@@ -4,6 +4,13 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+show variables like 'relay_log%';
+Variable_name Value
+relay_log MYSQLTEST_VARDIR/master-data/relay-log
+relay_log_index
+relay_log_info_file relay-log.info
+relay_log_purge ON
+relay_log_space_limit 0
stop slave;
change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=MASTER_PORT;
diff --git a/mysql-test/r/rpl_packet.result b/mysql-test/r/rpl_packet.result
index 894bc81b08d..9425724b434 100644
--- a/mysql-test/r/rpl_packet.result
+++ b/mysql-test/r/rpl_packet.result
@@ -21,6 +21,37 @@ STOP SLAVE;
START SLAVE;
CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
-SHOW STATUS LIKE 'Slave_running';
-Variable_name Value
-Slave_running OFF
+show slave status;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_MYPORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos 2138
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running No
+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 0
+Last_Error
+Skip_Counter 0
+Exec_Master_Log_Pos 2138
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
diff --git a/mysql-test/r/rpl_slave_skip.result b/mysql-test/r/rpl_slave_skip.result
new file mode 100644
index 00000000000..a59ac3eb884
--- /dev/null
+++ b/mysql-test/r/rpl_slave_skip.result
@@ -0,0 +1,144 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+**** On Master ****
+CREATE TABLE t1 (a INT, b SET('master','slave')) ENGINE=INNODB;
+CREATE TABLE t2 (a INT, b SET('master','slave')) ENGINE=MYISAM;
+==== Skipping normal transactions ====
+**** On Slave ****
+STOP SLAVE;
+**** On Master ****
+BEGIN;
+INSERT INTO t1 VALUES (1, 'master');
+INSERT INTO t1 VALUES (2, 'master');
+INSERT INTO t1 VALUES (3, 'master');
+COMMIT;
+BEGIN;
+INSERT INTO t1 VALUES (4, 'master,slave');
+INSERT INTO t1 VALUES (5, 'master,slave');
+INSERT INTO t1 VALUES (6, 'master,slave');
+COMMIT;
+SELECT * FROM t1 ORDER BY a;
+a b
+1 master
+2 master
+3 master
+4 master,slave
+5 master,slave
+6 master,slave
+**** On Slave ****
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+SELECT * FROM t1 ORDER BY a;
+a b
+4 master,slave
+5 master,slave
+6 master,slave
+**** On Master ****
+DELETE FROM t1;
+==== Skipping two normal transactions ====
+**** On Slave ****
+STOP SLAVE;
+**** On Master ****
+BEGIN;
+INSERT INTO t1 VALUES (1, 'master');
+INSERT INTO t1 VALUES (2, 'master');
+INSERT INTO t1 VALUES (3, 'master');
+COMMIT;
+BEGIN;
+INSERT INTO t1 VALUES (4, 'master');
+INSERT INTO t1 VALUES (5, 'master');
+INSERT INTO t1 VALUES (6, 'master');
+COMMIT;
+BEGIN;
+INSERT INTO t1 VALUES (7, 'master,slave');
+INSERT INTO t1 VALUES (8, 'master,slave');
+INSERT INTO t1 VALUES (9, 'master,slave');
+COMMIT;
+SELECT * FROM t1 ORDER BY a;
+a b
+1 master
+2 master
+3 master
+4 master
+5 master
+6 master
+7 master,slave
+8 master,slave
+9 master,slave
+**** On Slave ****
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
+START SLAVE;
+SELECT * FROM t1 ORDER BY a;
+a b
+7 master,slave
+8 master,slave
+9 master,slave
+**** On Master ****
+DELETE FROM t1;
+==== Skipping without autocommit ====
+**** On Slave ****
+STOP SLAVE;
+**** On Master ****
+SET AUTOCOMMIT=0;
+INSERT INTO t1 VALUES (1, 'master');
+INSERT INTO t1 VALUES (2, 'master');
+INSERT INTO t1 VALUES (3, 'master');
+COMMIT;
+INSERT INTO t1 VALUES (4, 'master,slave');
+INSERT INTO t1 VALUES (5, 'master,slave');
+INSERT INTO t1 VALUES (6, 'master,slave');
+COMMIT;
+SELECT * FROM t1 ORDER BY a;
+a b
+1 master
+2 master
+3 master
+4 master,slave
+5 master,slave
+6 master,slave
+**** On Slave ****
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+SELECT * FROM t1 ORDER BY a;
+a b
+4 master,slave
+5 master,slave
+6 master,slave
+==== Rollback of transaction with non-transactional change ====
+**** On Master ****
+DELETE FROM t1;
+SET AUTOCOMMIT=1;
+**** On Slave ****
+STOP SLAVE;
+**** On Master ****
+BEGIN;
+INSERT INTO t1 VALUES (1, '');
+INSERT INTO t2 VALUES (2, 'master');
+INSERT INTO t1 VALUES (3, '');
+ROLLBACK;
+BEGIN;
+INSERT INTO t1 VALUES (4, '');
+INSERT INTO t2 VALUES (5, 'master,slave');
+INSERT INTO t1 VALUES (6, '');
+ROLLBACK;
+SELECT * FROM t1 ORDER BY a;
+a b
+SELECT * FROM t2 ORDER BY a;
+a b
+2 master
+5 master,slave
+**** On Slave ****
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+SELECT * FROM t1 ORDER BY a;
+a b
+SELECT * FROM t2 ORDER BY a;
+a b
+5 master,slave
+==== Cleanup ====
+**** On Master ****
+DROP TABLE t1, t2;
diff --git a/mysql-test/r/rpl_sp_effects.result b/mysql-test/r/rpl_sp_effects.result
index bf8128d9385..70b2338d187 100644
--- a/mysql-test/r/rpl_sp_effects.result
+++ b/mysql-test/r/rpl_sp_effects.result
@@ -213,3 +213,44 @@ drop table t1;
drop function f1;
drop function f2;
drop procedure p1;
+create table t2 (b BIT(7));
+create procedure sp_bug26199(bitvalue BIT(7))
+begin
+insert into t2 set b = bitvalue;
+end //
+create function sf_bug26199(b BIT(7)) returns int
+begin
+insert into t2 values(b);
+return 0;
+end//
+call sp_bug26199(b'1110');
+call sp_bug26199('\0');
+select sf_bug26199(b'1111111');
+sf_bug26199(b'1111111')
+0
+select sf_bug26199(b'101111111');
+sf_bug26199(b'101111111')
+0
+Warnings:
+Warning 1264 Out of range value adjusted for column 'b' at row 1
+select sf_bug26199('\'');
+sf_bug26199('\'')
+0
+select hex(b) from t2;
+hex(b)
+E
+0
+7F
+7F
+27
+select hex(b) from t2;
+hex(b)
+E
+0
+7F
+7F
+27
+drop table t2;
+drop procedure sp_bug26199;
+drop function sf_bug26199;
+end of the tests
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index ed120a1bbb8..a1ba58a536c 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -2827,6 +2827,14 @@ FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
8FFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
drop table t1;
+CREATE TABLE t1 (c0 int);
+CREATE TABLE t2 (c0 int);
+INSERT INTO t1 VALUES(@@connect_timeout);
+INSERT INTO t2 VALUES(@@connect_timeout);
+SELECT * FROM t1 JOIN t2 ON t1.c0 = t2.c0 WHERE (t1.c0 <=> @@connect_timeout);
+c0 c0
+X X
+DROP TABLE t1, t2;
End of 4.1 tests
CREATE TABLE t1 (
K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '',
@@ -3233,40 +3241,40 @@ drop table t1, t2 ,t3;
create table t1(f1 int, f2 date);
insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'),
(4,'2005-10-01'),(5,'2005-12-30');
-select * from t1 where f2 >= 0;
+select * from t1 where f2 >= 0 order by f2;
f1 f2
1 2005-01-01
2 2005-09-01
3 2005-09-30
4 2005-10-01
5 2005-12-30
-select * from t1 where f2 >= '0000-00-00';
+select * from t1 where f2 >= '0000-00-00' order by f2;
f1 f2
1 2005-01-01
2 2005-09-01
3 2005-09-30
4 2005-10-01
5 2005-12-30
-select * from t1 where f2 >= '2005-09-31';
+select * from t1 where f2 >= '2005-09-31' order by f2;
f1 f2
4 2005-10-01
5 2005-12-30
-select * from t1 where f2 >= '2005-09-3a';
+select * from t1 where f2 >= '2005-09-3a' order by f2;
f1 f2
+3 2005-09-30
4 2005-10-01
5 2005-12-30
Warnings:
Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1
-select * from t1 where f2 <= '2005-09-31';
+select * from t1 where f2 <= '2005-09-31' order by f2;
f1 f2
1 2005-01-01
2 2005-09-01
3 2005-09-30
-select * from t1 where f2 <= '2005-09-3a';
+select * from t1 where f2 <= '2005-09-3a' order by f2;
f1 f2
1 2005-01-01
2 2005-09-01
-3 2005-09-30
Warnings:
Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1
drop table t1;
@@ -4077,23 +4085,241 @@ x
1
Warnings:
Warning 1466 Leading spaces are removed from name ' x'
+CREATE VIEW v1 AS SELECT 1 AS ``;
+ERROR 42000: Incorrect column name ''
CREATE VIEW v1 AS SELECT 1 AS ` `;
+ERROR 42000: Incorrect column name ' '
+CREATE VIEW v1 AS SELECT 1 AS ` `;
+ERROR 42000: Incorrect column name ' '
+CREATE VIEW v1 AS SELECT (SELECT 1 AS ` `);
+ERROR 42000: Incorrect column name ' '
+CREATE VIEW v1 AS SELECT 1 AS ` x`;
Warnings:
-Warning 1474 Name ' ' has become ''
-SELECT `` FROM v1;
-
+Warning 1466 Leading spaces are removed from name ' x'
+SELECT `x` FROM v1;
+x
+1
+ALTER VIEW v1 AS SELECT 1 AS ` `;
+ERROR 42000: Incorrect column name ' '
+DROP VIEW v1;
+select str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT'
+ and '2007/10/20 00:00:00 GMT';
+str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT'
+ and '2007/10/20 00:00:00 GMT'
1
-CREATE VIEW v2 AS SELECT 1 AS ` `;
Warnings:
-Warning 1474 Name ' ' has become ''
-SELECT `` FROM v2;
-
+Warning 1292 Truncated incorrect datetime value: '2007/10/01 00:00:00 GMT'
+Warning 1292 Truncated incorrect datetime value: '2007/10/20 00:00:00 GMT'
+select str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6';
+str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6'
1
-CREATE VIEW v3 AS SELECT 1 AS ` x`;
Warnings:
-Warning 1466 Leading spaces are removed from name ' x'
-SELECT `x` FROM v3;
-x
+Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT-6'
+select str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6';
+str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6'
+1
+Warnings:
+Warning 1292 Truncated incorrect date value: '2007/10/2000:00:00 GMT-6'
+select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6';
+str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6'
+1
+Warnings:
+Warning 1292 Truncated incorrect date value: '2007-10-1 00:00:00 GMT-6'
+select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6';
+str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6'
+1
+Warnings:
+Warning 1292 Truncated incorrect date value: '2007-10-01 x00:00:00 GMT-6'
+select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6';
+str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6'
+1
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:00:00 GMT-6'
+select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6';
+str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6'
+1
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:x00:00 GMT-6'
+select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6';
+str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6'
+1
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '2007-10-01 x12:34:56 GMT-6'
+select str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6';
+str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'
1
-DROP VIEW v1, v2, v3;
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6'
+select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6';
+str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'
+0
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6'
+select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56';
+str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56'
+1
+select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00';
+str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00'
+0
+select str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00';
+str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00'
+1
+select str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00';
+str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00'
+1
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34'
+select str_to_date('2007-02-30 12:34','%Y-%m-%d %H:%i') = '2007-02-30 12:34';
+str_to_date('2007-02-30 12:34','%Y-%m-%d %H:%i') = '2007-02-30 12:34'
+1
+select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34';
+str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'
+1
+select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00'
+ and '2007/10/20 00:00:00';
+str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00'
+ and '2007/10/20 00:00:00'
+1
+set SQL_MODE=TRADITIONAL;
+select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34';
+str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'
+0
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '2007-10-00 12:34'
+select str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34';
+str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'
+0
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '2007-10-00 12:34'
+select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34';
+str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34'
+0
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '2007-10-00 12:34:00'
+select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01'
+ and '2007/10/20';
+str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01'
+ and '2007/10/20'
+0
+Warnings:
+Warning 1292 Incorrect datetime value: '2007-10-00' for column '2007/09/01' at row 1
+Warning 1292 Incorrect datetime value: '2007-10-00' for column '2007/10/20' at row 1
+set SQL_MODE=DEFAULT;
+select str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20';
+str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20'
+1
+Warnings:
+Warning 1292 Truncated incorrect datetime value: ''
+select str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20';
+str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20'
+0
+select str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34';
+str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34'
+0
+select str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34';
+str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34'
+NULL
+select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '';
+str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = ''
+0
+Warnings:
+Warning 1292 Truncated incorrect datetime value: ''
+select str_to_date('1','%Y-%m-%d') = '1';
+str_to_date('1','%Y-%m-%d') = '1'
+0
+Warnings:
+Warning 1292 Truncated incorrect date value: '1'
+select str_to_date('1','%Y-%m-%d') = '1';
+str_to_date('1','%Y-%m-%d') = '1'
+0
+Warnings:
+Warning 1292 Truncated incorrect date value: '1'
+select str_to_date('','%Y-%m-%d') = '';
+str_to_date('','%Y-%m-%d') = ''
+0
+Warnings:
+Warning 1292 Truncated incorrect date value: ''
+select str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL;
+str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL
+0
+select str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00';
+str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00'
+0
+select str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL;
+str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL
+0
+CREATE TABLE t1 (c11 INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY);
+CREATE TABLE t2 (c21 INT UNSIGNED NOT NULL,
+c22 INT DEFAULT NULL,
+KEY(c21, c22));
+CREATE TABLE t3 (c31 INT UNSIGNED NOT NULL DEFAULT 0,
+c32 INT DEFAULT NULL,
+c33 INT NOT NULL,
+c34 INT UNSIGNED DEFAULT 0,
+KEY (c33, c34, c32));
+INSERT INTO t1 values (),(),(),(),();
+INSERT INTO t2 SELECT a.c11, b.c11 FROM t1 a, t1 b;
+INSERT INTO t3 VALUES (1, 1, 1, 0),
+(2, 2, 0, 0),
+(3, 3, 1, 0),
+(4, 4, 0, 0),
+(5, 5, 1, 0);
+SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND
+t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND
+t3.c33 = 1 AND t2.c22 in (1, 3)
+ORDER BY c32;
+c32
+1
+1
+3
+3
+5
+5
+SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND
+t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND
+t3.c33 = 1 AND t2.c22 in (1, 3)
+ORDER BY c32 DESC;
+c32
+5
+5
+3
+3
+1
+1
+DROP TABLE t1, t2, t3;
+
+#
+# Bug#30736: Row Size Too Large Error Creating a Table and
+# Inserting Data.
+#
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+
+CREATE TABLE t1(
+c1 DECIMAL(10, 2),
+c2 FLOAT);
+
+INSERT INTO t1 VALUES (0, 1), (2, 3), (4, 5);
+
+CREATE TABLE t2(
+c3 DECIMAL(10, 2))
+SELECT
+c1 * c2 AS c3
+FROM t1;
+
+SELECT * FROM t1;
+c1 c2
+0.00 1
+2.00 3
+4.00 5
+
+SELECT * FROM t2;
+c3
+0.00
+6.00
+20.00
+
+DROP TABLE t1;
+DROP TABLE t2;
+
End of 5.0 tests
diff --git a/mysql-test/r/shm.result b/mysql-test/r/shm.result
new file mode 100644
index 00000000000..09adebad10f
--- /dev/null
+++ b/mysql-test/r/shm.result
@@ -0,0 +1,2155 @@
+drop table if exists t1,t2,t3,t4;
+CREATE TABLE t1 (
+Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
+Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
+);
+INSERT INTO t1 VALUES (9410,9412);
+select period from t1;
+period
+9410
+select * from t1;
+Period Varor_period
+9410 9412
+select t1.* from t1;
+Period Varor_period
+9410 9412
+CREATE TABLE t2 (
+auto int not null auto_increment,
+fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL,
+companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL,
+fld3 char(30) DEFAULT '' NOT NULL,
+fld4 char(35) DEFAULT '' NOT NULL,
+fld5 char(35) DEFAULT '' NOT NULL,
+fld6 char(4) DEFAULT '' NOT NULL,
+UNIQUE fld1 (fld1),
+KEY fld3 (fld3),
+PRIMARY KEY (auto)
+);
+select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%";
+fld3
+imaginable
+select fld3 from t2 where fld3 like "%cultivation" ;
+fld3
+cultivation
+select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3;
+fld3 companynr
+concoct 58
+druggists 58
+engrossing 58
+Eurydice 58
+exclaimers 58
+ferociousness 58
+hopelessness 58
+Huey 58
+imaginable 58
+judges 58
+merging 58
+ostrich 58
+peering 58
+Phelps 58
+presumes 58
+Ruth 58
+sentences 58
+Shylock 58
+straggled 58
+synergy 58
+thanking 58
+tying 58
+unlocks 58
+select fld3,companynr from t2 where companynr = 58 order by fld3;
+fld3 companynr
+concoct 58
+druggists 58
+engrossing 58
+Eurydice 58
+exclaimers 58
+ferociousness 58
+hopelessness 58
+Huey 58
+imaginable 58
+judges 58
+merging 58
+ostrich 58
+peering 58
+Phelps 58
+presumes 58
+Ruth 58
+sentences 58
+Shylock 58
+straggled 58
+synergy 58
+thanking 58
+tying 58
+unlocks 58
+select fld3 from t2 order by fld3 desc limit 10;
+fld3
+youthfulness
+yelped
+Wotan
+workers
+Witt
+witchcraft
+Winsett
+Willy
+willed
+wildcats
+select fld3 from t2 order by fld3 desc limit 5;
+fld3
+youthfulness
+yelped
+Wotan
+workers
+Witt
+select fld3 from t2 order by fld3 desc limit 5,5;
+fld3
+witchcraft
+Winsett
+Willy
+willed
+wildcats
+select t2.fld3 from t2 where fld3 = 'honeysuckle';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'h%le';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_';
+fld3
+select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%';
+fld3
+explain select t2.fld3 from t2 where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
+explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
+explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
+explain select fld3 from t2 ignore index (fld3,not_used);
+ERROR HY000: Key 'not_used' doesn't exist in table 't2'
+explain select fld3 from t2 use index (not_used);
+ERROR HY000: Key 'not_used' doesn't exist in table 't2'
+select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
+fld3
+honeysuckle
+honoring
+explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range fld3 fld3 30 NULL 2 Using where; Using index
+select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3;
+fld1 fld3
+148504 Colombo
+068305 Colombo
+000000 nondecreasing
+select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes';
+fld1 fld3
+232605 appendixes
+1232605 appendixes
+1232606 appendixes
+1232607 appendixes
+1232608 appendixes
+1232609 appendixes
+select fld1 from t2 where fld1=250501 or fld1="250502";
+fld1
+250501
+250502
+explain select fld1 from t2 where fld1=250501 or fld1="250502";
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range fld1 fld1 4 NULL 2 Using where; Using index
+select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502;
+fld1
+250501
+250502
+250505
+250601
+explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range fld1 fld1 4 NULL 4 Using where; Using index
+select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%';
+fld1 fld3
+218401 faithful
+018007 fanatic
+228311 fated
+018017 featherweight
+218022 feed
+088303 feminine
+058004 Fenton
+038017 fetched
+018054 fetters
+208101 fiftieth
+238007 filial
+013606 fingerings
+218008 finishers
+038205 firearm
+188505 fitting
+202301 Fitzpatrick
+238008 fixedly
+012001 flanking
+018103 flint
+018104 flopping
+188007 flurried
+013602 foldout
+226205 foothill
+232102 forgivably
+228306 forthcoming
+186002 freakish
+208113 freest
+231315 freezes
+036002 funereal
+226209 furnishings
+198006 furthermore
+select fld3 from t2 where fld3 like "L%" and fld3 = "ok";
+fld3
+select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly");
+fld3
+Chantilly
+select fld1,fld3 from t2 where fld1 like "25050%";
+fld1 fld3
+250501 poisoning
+250502 Iraqis
+250503 heaving
+250504 population
+250505 bomb
+select fld1,fld3 from t2 where fld1 like "25050_";
+fld1 fld3
+250501 poisoning
+250502 Iraqis
+250503 heaving
+250504 population
+250505 bomb
+select distinct companynr from t2;
+companynr
+00
+37
+36
+50
+58
+29
+40
+53
+65
+41
+34
+68
+select distinct companynr from t2 order by companynr;
+companynr
+00
+29
+34
+36
+37
+40
+41
+50
+53
+58
+65
+68
+select distinct companynr from t2 order by companynr desc;
+companynr
+68
+65
+58
+53
+50
+41
+40
+37
+36
+34
+29
+00
+select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%";
+fld3 period
+obliterates 9410
+offload 9410
+opaquely 9410
+organizer 9410
+overestimating 9410
+overlay 9410
+select distinct fld3 from t2 where companynr = 34 order by fld3;
+fld3
+absentee
+accessed
+ahead
+alphabetic
+Asiaticizations
+attitude
+aye
+bankruptcies
+belays
+Blythe
+bomb
+boulevard
+bulldozes
+cannot
+caressing
+charcoal
+checksumming
+chess
+clubroom
+colorful
+cosy
+creator
+crying
+Darius
+diffusing
+duality
+Eiffel
+Epiphany
+Ernestine
+explorers
+exterminated
+famine
+forked
+Gershwins
+heaving
+Hodges
+Iraqis
+Italianization
+Lagos
+landslide
+libretto
+Majorca
+mastering
+narrowed
+occurred
+offerers
+Palestine
+Peruvianizes
+pharmaceutic
+poisoning
+population
+Pygmalion
+rats
+realest
+recording
+regimented
+retransmitting
+reviver
+rouses
+scars
+sicker
+sleepwalk
+stopped
+sugars
+translatable
+uncles
+unexpected
+uprisings
+versatility
+vest
+select distinct fld3 from t2 limit 10;
+fld3
+abates
+abiding
+Abraham
+abrogating
+absentee
+abut
+accessed
+accruing
+accumulating
+accuracies
+select distinct fld3 from t2 having fld3 like "A%" limit 10;
+fld3
+abates
+abiding
+Abraham
+abrogating
+absentee
+abut
+accessed
+accruing
+accumulating
+accuracies
+select distinct substring(fld3,1,3) from t2 where fld3 like "A%";
+substring(fld3,1,3)
+aba
+abi
+Abr
+abs
+abu
+acc
+acq
+acu
+Ade
+adj
+Adl
+adm
+Ado
+ads
+adv
+aer
+aff
+afi
+afl
+afo
+agi
+ahe
+aim
+air
+Ald
+alg
+ali
+all
+alp
+alr
+ama
+ame
+amm
+ana
+and
+ane
+Ang
+ani
+Ann
+Ant
+api
+app
+aqu
+Ara
+arc
+Arm
+arr
+Art
+Asi
+ask
+asp
+ass
+ast
+att
+aud
+Aug
+aut
+ave
+avo
+awe
+aye
+Azt
+select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10;
+a
+aba
+abi
+Abr
+abs
+abu
+acc
+acq
+acu
+Ade
+adj
+select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10;
+substring(fld3,1,3)
+aba
+abi
+Abr
+abs
+abu
+acc
+acq
+acu
+Ade
+adj
+select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10;
+a
+aba
+abi
+Abr
+abs
+abu
+acc
+acq
+acu
+Ade
+adj
+create table t3 (
+period int not null,
+name char(32) not null,
+companynr int not null,
+price double(11,0),
+price2 double(11,0),
+key (period),
+key (name)
+);
+create temporary table tmp engine = myisam select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+alter table t3 add t2nr int not null auto_increment primary key first;
+drop table tmp;
+SET SQL_BIG_TABLES=1;
+select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10;
+namn
+Abraham Abraham
+abrogating abrogating
+admonishing admonishing
+Adolph Adolph
+afield afield
+aging aging
+ammonium ammonium
+analyzable analyzable
+animals animals
+animized animized
+SET SQL_BIG_TABLES=0;
+select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10;
+concat(fld3," ",fld3)
+Abraham Abraham
+abrogating abrogating
+admonishing admonishing
+Adolph Adolph
+afield afield
+aging aging
+ammonium ammonium
+analyzable analyzable
+animals animals
+animized animized
+select distinct fld5 from t2 limit 10;
+fld5
+neat
+Steinberg
+jarring
+tinily
+balled
+persist
+attainments
+fanatic
+measures
+rightfulness
+select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;
+fld3 count(*)
+affixed 1
+and 1
+annoyers 1
+Anthony 1
+assayed 1
+assurers 1
+attendants 1
+bedlam 1
+bedpost 1
+boasted 1
+SET SQL_BIG_TABLES=1;
+select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;
+fld3 count(*)
+affixed 1
+and 1
+annoyers 1
+Anthony 1
+assayed 1
+assurers 1
+attendants 1
+bedlam 1
+bedpost 1
+boasted 1
+SET SQL_BIG_TABLES=0;
+select distinct fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr,fld3 limit 100,10;
+fld3 repeat("a",length(fld3)) count(*)
+circus aaaaaa 1
+cited aaaaa 1
+Colombo aaaaaaa 1
+congresswoman aaaaaaaaaaaaa 1
+contrition aaaaaaaaaa 1
+corny aaaaa 1
+cultivation aaaaaaaaaaa 1
+definiteness aaaaaaaaaaaa 1
+demultiplex aaaaaaaaaaa 1
+disappointing aaaaaaaaaaaaa 1
+select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2;
+companynr rtrim(space(512+companynr))
+37
+78
+101
+154
+311
+447
+512
+select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3;
+fld3
+explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
+1 SIMPLE t3 ref period period 4 test.t1.period 4181
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t3 index period period 4 NULL 41810
+1 SIMPLE t1 ref period period 4 test.t3.period 4181
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index period period 4 NULL 41810
+1 SIMPLE t3 ref period period 4 test.t1.period 4181
+select period from t1;
+period
+9410
+select period from t1 where period=1900;
+period
+select fld3,period from t1,t2 where fld1 = 011401 order by period;
+fld3 period
+breaking 9410
+select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001;
+fld3 period
+breaking 1001
+explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 const fld1 fld1 4 const 1
+1 SIMPLE t3 const PRIMARY,period PRIMARY 4 const 1
+select fld3,period from t2,t1 where companynr*10 = 37*10;
+fld3 period
+breaking 9410
+Romans 9410
+intercepted 9410
+bewilderingly 9410
+astound 9410
+admonishing 9410
+sumac 9410
+flanking 9410
+combed 9410
+subjective 9410
+scatterbrain 9410
+Eulerian 9410
+Kane 9410
+overlay 9410
+perturb 9410
+goblins 9410
+annihilates 9410
+Wotan 9410
+snatching 9410
+concludes 9410
+laterally 9410
+yelped 9410
+grazing 9410
+Baird 9410
+celery 9410
+misunderstander 9410
+handgun 9410
+foldout 9410
+mystic 9410
+succumbed 9410
+Nabisco 9410
+fingerings 9410
+aging 9410
+afield 9410
+ammonium 9410
+boat 9410
+intelligibility 9410
+Augustine 9410
+teethe 9410
+dreaded 9410
+scholastics 9410
+audiology 9410
+wallet 9410
+parters 9410
+eschew 9410
+quitter 9410
+neat 9410
+Steinberg 9410
+jarring 9410
+tinily 9410
+balled 9410
+persist 9410
+attainments 9410
+fanatic 9410
+measures 9410
+rightfulness 9410
+capably 9410
+impulsive 9410
+starlet 9410
+terminators 9410
+untying 9410
+announces 9410
+featherweight 9410
+pessimist 9410
+daughter 9410
+decliner 9410
+lawgiver 9410
+stated 9410
+readable 9410
+attrition 9410
+cascade 9410
+motors 9410
+interrogate 9410
+pests 9410
+stairway 9410
+dopers 9410
+testicle 9410
+Parsifal 9410
+leavings 9410
+postulation 9410
+squeaking 9410
+contrasted 9410
+leftover 9410
+whiteners 9410
+erases 9410
+Punjab 9410
+Merritt 9410
+Quixotism 9410
+sweetish 9410
+dogging 9410
+scornfully 9410
+bellow 9410
+bills 9410
+cupboard 9410
+sureties 9410
+puddings 9410
+fetters 9410
+bivalves 9410
+incurring 9410
+Adolph 9410
+pithed 9410
+Miles 9410
+trimmings 9410
+tragedies 9410
+skulking 9410
+flint 9410
+flopping 9410
+relaxing 9410
+offload 9410
+suites 9410
+lists 9410
+animized 9410
+multilayer 9410
+standardizes 9410
+Judas 9410
+vacuuming 9410
+dentally 9410
+humanness 9410
+inch 9410
+Weissmuller 9410
+irresponsibly 9410
+luckily 9410
+culled 9410
+medical 9410
+bloodbath 9410
+subschema 9410
+animals 9410
+Micronesia 9410
+repetitions 9410
+Antares 9410
+ventilate 9410
+pityingly 9410
+interdependent 9410
+Graves 9410
+neonatal 9410
+chafe 9410
+honoring 9410
+realtor 9410
+elite 9410
+funereal 9410
+abrogating 9410
+sorters 9410
+Conley 9410
+lectured 9410
+Abraham 9410
+Hawaii 9410
+cage 9410
+hushes 9410
+Simla 9410
+reporters 9410
+Dutchman 9410
+descendants 9410
+groupings 9410
+dissociate 9410
+coexist 9410
+Beebe 9410
+Taoism 9410
+Connally 9410
+fetched 9410
+checkpoints 9410
+rusting 9410
+galling 9410
+obliterates 9410
+traitor 9410
+resumes 9410
+analyzable 9410
+terminator 9410
+gritty 9410
+firearm 9410
+minima 9410
+Selfridge 9410
+disable 9410
+witchcraft 9410
+betroth 9410
+Manhattanize 9410
+imprint 9410
+peeked 9410
+swelling 9410
+interrelationships 9410
+riser 9410
+Gandhian 9410
+peacock 9410
+bee 9410
+kanji 9410
+dental 9410
+scarf 9410
+chasm 9410
+insolence 9410
+syndicate 9410
+alike 9410
+imperial 9410
+convulsion 9410
+railway 9410
+validate 9410
+normalizes 9410
+comprehensive 9410
+chewing 9410
+denizen 9410
+schemer 9410
+chronicle 9410
+Kline 9410
+Anatole 9410
+partridges 9410
+brunch 9410
+recruited 9410
+dimensions 9410
+Chicana 9410
+announced 9410
+praised 9410
+employing 9410
+linear 9410
+quagmire 9410
+western 9410
+relishing 9410
+serving 9410
+scheduling 9410
+lore 9410
+eventful 9410
+arteriole 9410
+disentangle 9410
+cured 9410
+Fenton 9410
+avoidable 9410
+drains 9410
+detectably 9410
+husky 9410
+impelling 9410
+undoes 9410
+evened 9410
+squeezes 9410
+destroyer 9410
+rudeness 9410
+beaner 9410
+boorish 9410
+Everhart 9410
+encompass 9410
+mushrooms 9410
+Alison 9410
+externally 9410
+pellagra 9410
+cult 9410
+creek 9410
+Huffman 9410
+Majorca 9410
+governing 9410
+gadfly 9410
+reassigned 9410
+intentness 9410
+craziness 9410
+psychic 9410
+squabbled 9410
+burlesque 9410
+capped 9410
+extracted 9410
+DiMaggio 9410
+exclamation 9410
+subdirectory 9410
+Gothicism 9410
+feminine 9410
+metaphysically 9410
+sanding 9410
+Miltonism 9410
+freakish 9410
+index 9410
+straight 9410
+flurried 9410
+denotative 9410
+coming 9410
+commencements 9410
+gentleman 9410
+gifted 9410
+Shanghais 9410
+sportswriting 9410
+sloping 9410
+navies 9410
+leaflet 9410
+shooter 9410
+Joplin 9410
+babies 9410
+assails 9410
+admiring 9410
+swaying 9410
+Goldstine 9410
+fitting 9410
+Norwalk 9410
+analogy 9410
+deludes 9410
+cokes 9410
+Clayton 9410
+exhausts 9410
+causality 9410
+sating 9410
+icon 9410
+throttles 9410
+communicants 9410
+dehydrate 9410
+priceless 9410
+publicly 9410
+incidentals 9410
+commonplace 9410
+mumbles 9410
+furthermore 9410
+cautioned 9410
+parametrized 9410
+registration 9410
+sadly 9410
+positioning 9410
+babysitting 9410
+eternal 9410
+hoarder 9410
+congregates 9410
+rains 9410
+workers 9410
+sags 9410
+unplug 9410
+garage 9410
+boulder 9410
+specifics 9410
+Teresa 9410
+Winsett 9410
+convenient 9410
+buckboards 9410
+amenities 9410
+resplendent 9410
+sews 9410
+participated 9410
+Simon 9410
+certificates 9410
+Fitzpatrick 9410
+Evanston 9410
+misted 9410
+textures 9410
+save 9410
+count 9410
+rightful 9410
+chaperone 9410
+Lizzy 9410
+clenched 9410
+effortlessly 9410
+accessed 9410
+beaters 9410
+Hornblower 9410
+vests 9410
+indulgences 9410
+infallibly 9410
+unwilling 9410
+excrete 9410
+spools 9410
+crunches 9410
+overestimating 9410
+ineffective 9410
+humiliation 9410
+sophomore 9410
+star 9410
+rifles 9410
+dialysis 9410
+arriving 9410
+indulge 9410
+clockers 9410
+languages 9410
+Antarctica 9410
+percentage 9410
+ceiling 9410
+specification 9410
+regimented 9410
+ciphers 9410
+pictures 9410
+serpents 9410
+allot 9410
+realized 9410
+mayoral 9410
+opaquely 9410
+hostess 9410
+fiftieth 9410
+incorrectly 9410
+decomposition 9410
+stranglings 9410
+mixture 9410
+electroencephalography 9410
+similarities 9410
+charges 9410
+freest 9410
+Greenberg 9410
+tinting 9410
+expelled 9410
+warm 9410
+smoothed 9410
+deductions 9410
+Romano 9410
+bitterroot 9410
+corset 9410
+securing 9410
+environing 9410
+cute 9410
+Crays 9410
+heiress 9410
+inform 9410
+avenge 9410
+universals 9410
+Kinsey 9410
+ravines 9410
+bestseller 9410
+equilibrium 9410
+extents 9410
+relatively 9410
+pressure 9410
+critiques 9410
+befouled 9410
+rightfully 9410
+mechanizing 9410
+Latinizes 9410
+timesharing 9410
+Aden 9410
+embassies 9410
+males 9410
+shapelessly 9410
+mastering 9410
+Newtonian 9410
+finishers 9410
+abates 9410
+teem 9410
+kiting 9410
+stodgy 9410
+feed 9410
+guitars 9410
+airships 9410
+store 9410
+denounces 9410
+Pyle 9410
+Saxony 9410
+serializations 9410
+Peruvian 9410
+taxonomically 9410
+kingdom 9410
+stint 9410
+Sault 9410
+faithful 9410
+Ganymede 9410
+tidiness 9410
+gainful 9410
+contrary 9410
+Tipperary 9410
+tropics 9410
+theorizers 9410
+renew 9410
+already 9410
+terminal 9410
+Hegelian 9410
+hypothesizer 9410
+warningly 9410
+journalizing 9410
+nested 9410
+Lars 9410
+saplings 9410
+foothill 9410
+labeled 9410
+imperiously 9410
+reporters 9410
+furnishings 9410
+precipitable 9410
+discounts 9410
+excises 9410
+Stalin 9410
+despot 9410
+ripeness 9410
+Arabia 9410
+unruly 9410
+mournfulness 9410
+boom 9410
+slaughter 9410
+Sabine 9410
+handy 9410
+rural 9410
+organizer 9410
+shipyard 9410
+civics 9410
+inaccuracy 9410
+rules 9410
+juveniles 9410
+comprised 9410
+investigations 9410
+stabilizes 9410
+seminaries 9410
+Hunter 9410
+sporty 9410
+test 9410
+weasels 9410
+CERN 9410
+tempering 9410
+afore 9410
+Galatean 9410
+techniques 9410
+error 9410
+veranda 9410
+severely 9410
+Cassites 9410
+forthcoming 9410
+guides 9410
+vanish 9410
+lied 9410
+sawtooth 9410
+fated 9410
+gradually 9410
+widens 9410
+preclude 9410
+evenhandedly 9410
+percentage 9410
+disobedience 9410
+humility 9410
+gleaning 9410
+petted 9410
+bloater 9410
+minion 9410
+marginal 9410
+apiary 9410
+measures 9410
+precaution 9410
+repelled 9410
+primary 9410
+coverings 9410
+Artemia 9410
+navigate 9410
+spatial 9410
+Gurkha 9410
+meanwhile 9410
+Melinda 9410
+Butterfield 9410
+Aldrich 9410
+previewing 9410
+glut 9410
+unaffected 9410
+inmate 9410
+mineral 9410
+impending 9410
+meditation 9410
+ideas 9410
+miniaturizes 9410
+lewdly 9410
+title 9410
+youthfulness 9410
+creak 9410
+Chippewa 9410
+clamored 9410
+freezes 9410
+forgivably 9410
+reduce 9410
+McGovern 9410
+Nazis 9410
+epistle 9410
+socializes 9410
+conceptions 9410
+Kevin 9410
+uncovering 9410
+chews 9410
+appendixes 9410
+appendixes 9410
+appendixes 9410
+appendixes 9410
+appendixes 9410
+appendixes 9410
+raining 9410
+infest 9410
+compartment 9410
+minting 9410
+ducks 9410
+roped 9410
+waltz 9410
+Lillian 9410
+repressions 9410
+chillingly 9410
+noncritical 9410
+lithograph 9410
+spongers 9410
+parenthood 9410
+posed 9410
+instruments 9410
+filial 9410
+fixedly 9410
+relives 9410
+Pandora 9410
+watering 9410
+ungrateful 9410
+secures 9410
+poison 9410
+dusted 9410
+encompasses 9410
+presentation 9410
+Kantian 9410
+select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price;
+fld3 period price price2
+admonishing 1002 28357832 8723648
+analyzable 1002 28357832 8723648
+annihilates 1001 5987435 234724
+Antares 1002 28357832 8723648
+astound 1001 5987435 234724
+audiology 1001 5987435 234724
+Augustine 1002 28357832 8723648
+Baird 1002 28357832 8723648
+bewilderingly 1001 5987435 234724
+breaking 1001 5987435 234724
+Conley 1001 5987435 234724
+dentally 1002 28357832 8723648
+dissociate 1002 28357832 8723648
+elite 1001 5987435 234724
+eschew 1001 5987435 234724
+Eulerian 1001 5987435 234724
+flanking 1001 5987435 234724
+foldout 1002 28357832 8723648
+funereal 1002 28357832 8723648
+galling 1002 28357832 8723648
+Graves 1001 5987435 234724
+grazing 1001 5987435 234724
+groupings 1001 5987435 234724
+handgun 1001 5987435 234724
+humility 1002 28357832 8723648
+impulsive 1002 28357832 8723648
+inch 1001 5987435 234724
+intelligibility 1001 5987435 234724
+jarring 1001 5987435 234724
+lawgiver 1001 5987435 234724
+lectured 1002 28357832 8723648
+Merritt 1002 28357832 8723648
+neonatal 1001 5987435 234724
+offload 1002 28357832 8723648
+parters 1002 28357832 8723648
+pityingly 1002 28357832 8723648
+puddings 1002 28357832 8723648
+Punjab 1001 5987435 234724
+quitter 1002 28357832 8723648
+realtor 1001 5987435 234724
+relaxing 1001 5987435 234724
+repetitions 1001 5987435 234724
+resumes 1001 5987435 234724
+Romans 1002 28357832 8723648
+rusting 1001 5987435 234724
+scholastics 1001 5987435 234724
+skulking 1002 28357832 8723648
+stated 1002 28357832 8723648
+suites 1002 28357832 8723648
+sureties 1001 5987435 234724
+testicle 1002 28357832 8723648
+tinily 1002 28357832 8723648
+tragedies 1001 5987435 234724
+trimmings 1001 5987435 234724
+vacuuming 1001 5987435 234724
+ventilate 1001 5987435 234724
+wallet 1001 5987435 234724
+Weissmuller 1002 28357832 8723648
+Wotan 1002 28357832 8723648
+select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37;
+fld1 fld3 period price price2
+018201 relaxing 1001 5987435 234724
+018601 vacuuming 1001 5987435 234724
+018801 inch 1001 5987435 234724
+018811 repetitions 1001 5987435 234724
+create table t4 (
+companynr tinyint(2) unsigned zerofill NOT NULL default '00',
+companyname char(30) NOT NULL default '',
+PRIMARY KEY (companynr),
+UNIQUE KEY companyname(companyname)
+) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
+select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
+companynr companyname
+00 Unknown
+29 company 1
+34 company 2
+36 company 3
+37 company 4
+40 company 5
+41 company 6
+50 company 11
+53 company 7
+58 company 8
+65 company 9
+68 company 10
+select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
+companynr companyname
+00 Unknown
+29 company 1
+34 company 2
+36 company 3
+37 company 4
+40 company 5
+41 company 6
+50 company 11
+53 company 7
+58 company 8
+65 company 9
+68 company 10
+select * from t1,t1 t12;
+Period Varor_period Period Varor_period
+9410 9412 9410 9412
+select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505;
+fld1 fld1
+250501 250501
+250502 250501
+250503 250501
+250504 250501
+250505 250501
+250501 250502
+250502 250502
+250503 250502
+250504 250502
+250505 250502
+250501 250503
+250502 250503
+250503 250503
+250504 250503
+250505 250503
+250501 250504
+250502 250504
+250503 250504
+250504 250504
+250505 250504
+250501 250505
+250502 250505
+250503 250505
+250504 250505
+250505 250505
+insert into t2 (fld1, companynr) values (999999,99);
+select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null;
+companynr companyname
+99 NULL
+select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null;
+count(*)
+1199
+explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1200
+1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using where; Not exists
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 Using where; Not exists
+select companynr,companyname from t2 left join t4 using (companynr) where companynr is null;
+companynr companyname
+select count(*) from t2 left join t4 using (companynr) where companynr is not null;
+count(*)
+1200
+explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+delete from t2 where fld1=999999;
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
+companynr companynr
+37 36
+41 40
+explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008;
+fld1 companynr fld3 period
+038008 37 reporters 1008
+038208 37 Selfridge 1008
+select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009;
+fld1 companynr fld3 period
+038008 37 reporters 1008
+038208 37 Selfridge 1008
+select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009;
+fld1 companynr fld3 period
+038008 37 reporters 1008
+038208 37 Selfridge 1008
+select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909);
+period
+9410
+select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6)));
+period
+9410
+select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1;
+fld1
+250501
+250502
+250503
+250505
+select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606);
+fld1
+250502
+250503
+select fld1 from t2 where fld1 between 250502 and 250504;
+fld1
+250502
+250503
+250504
+select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ;
+fld3
+label
+labeled
+labeled
+landslide
+laterally
+leaflet
+lewdly
+Lillian
+luckily
+select count(*) from t1;
+count(*)
+1
+select companynr,count(*),sum(fld1) from t2 group by companynr;
+companynr count(*) sum(fld1)
+00 82 10355753
+29 95 14473298
+34 70 17788966
+36 215 22786296
+37 588 83602098
+40 37 6618386
+41 52 12816335
+50 11 1595438
+53 4 793210
+58 23 2254293
+65 10 2284055
+68 12 3097288
+select companynr,count(*) from t2 group by companynr order by companynr desc limit 5;
+companynr count(*)
+68 12
+65 10
+58 23
+53 4
+50 11
+select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>"";
+count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1)
+70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069
+explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>"";
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+Warnings:
+Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> _latin1''))
+select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3;
+companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1)
+00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087
+29 95 abut wetness 14473298 152350.5053 8368.5480 70032594.9026
+34 70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069
+select companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10;
+companynr t2nr count(price) sum(price) min(price) max(price) avg(price)
+37 1 1 5987435 5987435 5987435 5987435.0000
+37 2 1 28357832 28357832 28357832 28357832.0000
+37 3 1 39654943 39654943 39654943 39654943.0000
+37 11 1 5987435 5987435 5987435 5987435.0000
+37 12 1 28357832 28357832 28357832 28357832.0000
+37 13 1 39654943 39654943 39654943 39654943.0000
+37 21 1 5987435 5987435 5987435 5987435.0000
+37 22 1 28357832 28357832 28357832 28357832.0000
+37 23 1 39654943 39654943 39654943 39654943.0000
+37 31 1 5987435 5987435 5987435 5987435.0000
+select /*! SQL_SMALL_RESULT */ companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10;
+companynr t2nr count(price) sum(price) min(price) max(price) avg(price)
+37 1 1 5987435 5987435 5987435 5987435.0000
+37 2 1 28357832 28357832 28357832 28357832.0000
+37 3 1 39654943 39654943 39654943 39654943.0000
+37 11 1 5987435 5987435 5987435 5987435.0000
+37 12 1 28357832 28357832 28357832 28357832.0000
+37 13 1 39654943 39654943 39654943 39654943.0000
+37 21 1 5987435 5987435 5987435 5987435.0000
+37 22 1 28357832 28357832 28357832 28357832.0000
+37 23 1 39654943 39654943 39654943 39654943.0000
+37 31 1 5987435 5987435 5987435 5987435.0000
+select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ;
+companynr count(price) sum(price) min(price) max(price) avg(price)
+37 12543 309394878010 5987435 39654943 24666736.6667
+78 8362 414611089292 726498 98439034 49582766.0000
+101 4181 3489454238 834598 834598 834598.0000
+154 4181 4112197254950 983543950 983543950 983543950.0000
+311 4181 979599938 234298 234298 234298.0000
+447 4181 9929180954 2374834 2374834 2374834.0000
+512 4181 3288532102 786542 786542 786542.0000
+select distinct mod(companynr,10) from t4 group by companynr;
+mod(companynr,10)
+0
+9
+4
+6
+7
+1
+3
+8
+5
+select distinct 1 from t4 group by companynr;
+1
+1
+select count(distinct fld1) from t2;
+count(distinct fld1)
+1199
+select companynr,count(distinct fld1) from t2 group by companynr;
+companynr count(distinct fld1)
+00 82
+29 95
+34 70
+36 215
+37 588
+40 37
+41 52
+50 11
+53 4
+58 23
+65 10
+68 12
+select companynr,count(*) from t2 group by companynr;
+companynr count(*)
+00 82
+29 95
+34 70
+36 215
+37 588
+40 37
+41 52
+50 11
+53 4
+58 23
+65 10
+68 12
+select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr;
+companynr count(distinct concat(fld1,repeat(65,1000)))
+00 82
+29 95
+34 70
+36 215
+37 588
+40 37
+41 52
+50 11
+53 4
+58 23
+65 10
+68 12
+select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr;
+companynr count(distinct concat(fld1,repeat(65,200)))
+00 82
+29 95
+34 70
+36 215
+37 588
+40 37
+41 52
+50 11
+53 4
+58 23
+65 10
+68 12
+select companynr,count(distinct floor(fld1/100)) from t2 group by companynr;
+companynr count(distinct floor(fld1/100))
+00 47
+29 35
+34 14
+36 69
+37 108
+40 16
+41 11
+50 9
+53 1
+58 1
+65 1
+68 1
+select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr;
+companynr count(distinct concat(repeat(65,1000),floor(fld1/100)))
+00 47
+29 35
+34 14
+36 69
+37 108
+40 16
+41 11
+50 9
+53 1
+58 1
+65 1
+68 1
+select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10;
+sum(fld1) fld3
+11402 Romans
+select name,count(*) from t3 where name='cloakroom' group by name;
+name count(*)
+cloakroom 4181
+select name,count(*) from t3 where name='cloakroom' and price>10 group by name;
+name count(*)
+cloakroom 4181
+select count(*) from t3 where name='cloakroom' and price2=823742;
+count(*)
+4181
+select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name;
+name count(*)
+cloakroom 4181
+select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name;
+name count(*)
+extramarital 4181
+gazer 4181
+gems 4181
+Iranizes 4181
+spates 4181
+tucked 4181
+violinist 4181
+select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name;
+fld3 count(*)
+spates 4181
+select companynr|0,companyname from t4 group by 1;
+companynr|0 companyname
+0 Unknown
+29 company 1
+34 company 2
+36 company 3
+37 company 4
+40 company 5
+41 company 6
+50 company 11
+53 company 7
+58 company 8
+65 company 9
+68 company 10
+select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname;
+companynr companyname count(*)
+29 company 1 95
+68 company 10 12
+50 company 11 11
+34 company 2 70
+36 company 3 215
+37 company 4 588
+40 company 5 37
+41 company 6 52
+53 company 7 4
+58 company 8 23
+65 company 9 10
+00 Unknown 82
+select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name;
+fld1 count(*)
+158402 4181
+select sum(Period)/count(*) from t1;
+sum(Period)/count(*)
+9410.0000
+select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr;
+companynr count sum diff func
+37 12543 309394878010 0.0000 464091
+78 8362 414611089292 0.0000 652236
+101 4181 3489454238 0.0000 422281
+154 4181 4112197254950 0.0000 643874
+311 4181 979599938 0.0000 1300291
+447 4181 9929180954 0.0000 1868907
+512 4181 3288532102 0.0000 2140672
+select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg;
+companynr avg
+154 983543950.0000
+select companynr,count(*) from t2 group by companynr order by 2 desc;
+companynr count(*)
+37 588
+36 215
+29 95
+00 82
+34 70
+41 52
+40 37
+58 23
+68 12
+50 11
+65 10
+53 4
+select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc;
+companynr count(*)
+41 52
+58 23
+68 12
+50 11
+65 10
+53 4
+select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4;
+fld4 fld1 count(price) sum(price) min(price) max(price) avg(price)
+teethe 000001 1 5987435 5987435 5987435 5987435.0000
+dreaded 011401 1 5987435 5987435 5987435 5987435.0000
+scholastics 011402 1 28357832 28357832 28357832 28357832.0000
+audiology 011403 1 39654943 39654943 39654943 39654943.0000
+wallet 011501 1 5987435 5987435 5987435 5987435.0000
+parters 011701 1 5987435 5987435 5987435 5987435.0000
+eschew 011702 1 28357832 28357832 28357832 28357832.0000
+quitter 011703 1 39654943 39654943 39654943 39654943.0000
+neat 012001 1 5987435 5987435 5987435 5987435.0000
+Steinberg 012003 1 39654943 39654943 39654943 39654943.0000
+balled 012301 1 5987435 5987435 5987435 5987435.0000
+persist 012302 1 28357832 28357832 28357832 28357832.0000
+attainments 012303 1 39654943 39654943 39654943 39654943.0000
+capably 012501 1 5987435 5987435 5987435 5987435.0000
+impulsive 012602 1 28357832 28357832 28357832 28357832.0000
+starlet 012603 1 39654943 39654943 39654943 39654943.0000
+featherweight 012701 1 5987435 5987435 5987435 5987435.0000
+pessimist 012702 1 28357832 28357832 28357832 28357832.0000
+daughter 012703 1 39654943 39654943 39654943 39654943.0000
+lawgiver 013601 1 5987435 5987435 5987435 5987435.0000
+stated 013602 1 28357832 28357832 28357832 28357832.0000
+readable 013603 1 39654943 39654943 39654943 39654943.0000
+testicle 013801 1 5987435 5987435 5987435 5987435.0000
+Parsifal 013802 1 28357832 28357832 28357832 28357832.0000
+leavings 013803 1 39654943 39654943 39654943 39654943.0000
+squeaking 013901 1 5987435 5987435 5987435 5987435.0000
+contrasted 016001 1 5987435 5987435 5987435 5987435.0000
+leftover 016201 1 5987435 5987435 5987435 5987435.0000
+whiteners 016202 1 28357832 28357832 28357832 28357832.0000
+erases 016301 1 5987435 5987435 5987435 5987435.0000
+Punjab 016302 1 28357832 28357832 28357832 28357832.0000
+Merritt 016303 1 39654943 39654943 39654943 39654943.0000
+sweetish 018001 1 5987435 5987435 5987435 5987435.0000
+dogging 018002 1 28357832 28357832 28357832 28357832.0000
+scornfully 018003 1 39654943 39654943 39654943 39654943.0000
+fetters 018012 1 28357832 28357832 28357832 28357832.0000
+bivalves 018013 1 39654943 39654943 39654943 39654943.0000
+skulking 018021 1 5987435 5987435 5987435 5987435.0000
+flint 018022 1 28357832 28357832 28357832 28357832.0000
+flopping 018023 1 39654943 39654943 39654943 39654943.0000
+Judas 018032 1 28357832 28357832 28357832 28357832.0000
+vacuuming 018033 1 39654943 39654943 39654943 39654943.0000
+medical 018041 1 5987435 5987435 5987435 5987435.0000
+bloodbath 018042 1 28357832 28357832 28357832 28357832.0000
+subschema 018043 1 39654943 39654943 39654943 39654943.0000
+interdependent 018051 1 5987435 5987435 5987435 5987435.0000
+Graves 018052 1 28357832 28357832 28357832 28357832.0000
+neonatal 018053 1 39654943 39654943 39654943 39654943.0000
+sorters 018061 1 5987435 5987435 5987435 5987435.0000
+epistle 018062 1 28357832 28357832 28357832 28357832.0000
+Conley 018101 1 5987435 5987435 5987435 5987435.0000
+lectured 018102 1 28357832 28357832 28357832 28357832.0000
+Abraham 018103 1 39654943 39654943 39654943 39654943.0000
+cage 018201 1 5987435 5987435 5987435 5987435.0000
+hushes 018202 1 28357832 28357832 28357832 28357832.0000
+Simla 018402 1 28357832 28357832 28357832 28357832.0000
+reporters 018403 1 39654943 39654943 39654943 39654943.0000
+coexist 018601 1 5987435 5987435 5987435 5987435.0000
+Beebe 018602 1 28357832 28357832 28357832 28357832.0000
+Taoism 018603 1 39654943 39654943 39654943 39654943.0000
+Connally 018801 1 5987435 5987435 5987435 5987435.0000
+fetched 018802 1 28357832 28357832 28357832 28357832.0000
+checkpoints 018803 1 39654943 39654943 39654943 39654943.0000
+gritty 018811 1 5987435 5987435 5987435 5987435.0000
+firearm 018812 1 28357832 28357832 28357832 28357832.0000
+minima 019101 1 5987435 5987435 5987435 5987435.0000
+Selfridge 019102 1 28357832 28357832 28357832 28357832.0000
+disable 019103 1 39654943 39654943 39654943 39654943.0000
+witchcraft 019201 1 5987435 5987435 5987435 5987435.0000
+betroth 030501 1 5987435 5987435 5987435 5987435.0000
+Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000
+imprint 030503 1 39654943 39654943 39654943 39654943.0000
+swelling 031901 1 5987435 5987435 5987435 5987435.0000
+interrelationships 036001 1 5987435 5987435 5987435 5987435.0000
+riser 036002 1 28357832 28357832 28357832 28357832.0000
+bee 038001 1 5987435 5987435 5987435 5987435.0000
+kanji 038002 1 28357832 28357832 28357832 28357832.0000
+dental 038003 1 39654943 39654943 39654943 39654943.0000
+railway 038011 1 5987435 5987435 5987435 5987435.0000
+validate 038012 1 28357832 28357832 28357832 28357832.0000
+normalizes 038013 1 39654943 39654943 39654943 39654943.0000
+Kline 038101 1 5987435 5987435 5987435 5987435.0000
+Anatole 038102 1 28357832 28357832 28357832 28357832.0000
+partridges 038103 1 39654943 39654943 39654943 39654943.0000
+recruited 038201 1 5987435 5987435 5987435 5987435.0000
+dimensions 038202 1 28357832 28357832 28357832 28357832.0000
+Chicana 038203 1 39654943 39654943 39654943 39654943.0000
+select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3;
+companynr fld3 sum(price)
+512 boat 786542
+512 capably 786542
+512 cupboard 786542
+512 decliner 786542
+512 descendants 786542
+512 dopers 786542
+512 erases 786542
+512 Micronesia 786542
+512 Miles 786542
+512 skies 786542
+select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr;
+companynr count(*) min(fld3) max(fld3) sum(price) avg(price)
+00 1 Omaha Omaha 5987435 5987435.0000
+36 1 dubbed dubbed 28357832 28357832.0000
+37 83 Abraham Wotan 1908978016 22999735.1325
+50 2 scribbled tapestry 68012775 34006387.5000
+select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1;
+t3.companynr+0 t2nr fld3 sum(price)
+37 1 Omaha 5987435
+37 11401 breaking 5987435
+37 11402 Romans 28357832
+37 11403 intercepted 39654943
+37 11501 bewilderingly 5987435
+37 11701 astound 5987435
+37 11702 admonishing 28357832
+37 11703 sumac 39654943
+37 12001 flanking 5987435
+37 12003 combed 39654943
+37 12301 Eulerian 5987435
+37 12302 dubbed 28357832
+37 12303 Kane 39654943
+37 12501 annihilates 5987435
+37 12602 Wotan 28357832
+37 12603 snatching 39654943
+37 12701 grazing 5987435
+37 12702 Baird 28357832
+37 12703 celery 39654943
+37 13601 handgun 5987435
+37 13602 foldout 28357832
+37 13603 mystic 39654943
+37 13801 intelligibility 5987435
+37 13802 Augustine 28357832
+37 13803 teethe 39654943
+37 13901 scholastics 5987435
+37 16001 audiology 5987435
+37 16201 wallet 5987435
+37 16202 parters 28357832
+37 16301 eschew 5987435
+37 16302 quitter 28357832
+37 16303 neat 39654943
+37 18001 jarring 5987435
+37 18002 tinily 28357832
+37 18003 balled 39654943
+37 18012 impulsive 28357832
+37 18013 starlet 39654943
+37 18021 lawgiver 5987435
+37 18022 stated 28357832
+37 18023 readable 39654943
+37 18032 testicle 28357832
+37 18033 Parsifal 39654943
+37 18041 Punjab 5987435
+37 18042 Merritt 28357832
+37 18043 Quixotism 39654943
+37 18051 sureties 5987435
+37 18052 puddings 28357832
+37 18053 tapestry 39654943
+37 18061 trimmings 5987435
+37 18062 humility 28357832
+37 18101 tragedies 5987435
+37 18102 skulking 28357832
+37 18103 flint 39654943
+37 18201 relaxing 5987435
+37 18202 offload 28357832
+37 18402 suites 28357832
+37 18403 lists 39654943
+37 18601 vacuuming 5987435
+37 18602 dentally 28357832
+37 18603 humanness 39654943
+37 18801 inch 5987435
+37 18802 Weissmuller 28357832
+37 18803 irresponsibly 39654943
+37 18811 repetitions 5987435
+37 18812 Antares 28357832
+37 19101 ventilate 5987435
+37 19102 pityingly 28357832
+37 19103 interdependent 39654943
+37 19201 Graves 5987435
+37 30501 neonatal 5987435
+37 30502 scribbled 28357832
+37 30503 chafe 39654943
+37 31901 realtor 5987435
+37 36001 elite 5987435
+37 36002 funereal 28357832
+37 38001 Conley 5987435
+37 38002 lectured 28357832
+37 38003 Abraham 39654943
+37 38011 groupings 5987435
+37 38012 dissociate 28357832
+37 38013 coexist 39654943
+37 38101 rusting 5987435
+37 38102 galling 28357832
+37 38103 obliterates 39654943
+37 38201 resumes 5987435
+37 38202 analyzable 28357832
+37 38203 terminator 39654943
+select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008;
+sum(price)
+234298
+select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1;
+fld1 sum(price)
+038008 234298
+explain select fld3 from t2 where 1>2 or 2>3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+explain select fld3 from t2 where fld1=fld1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502;
+companynr fld1
+34 250501
+34 250502
+select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502;
+companynr fld1
+34 250501
+34 250502
+select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000;
+companynr count sum
+00 82 10355753
+29 95 14473298
+34 70 17788966
+37 588 83602098
+41 52 12816335
+select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ;
+companynr
+00
+29
+34
+37
+41
+select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40;
+companynr companyname count(*)
+68 company 10 12
+50 company 11 11
+40 company 5 37
+41 company 6 52
+53 company 7 4
+58 company 8 23
+65 company 9 10
+select count(*) from t2;
+count(*)
+1199
+select count(*) from t2 where fld1 < 098024;
+count(*)
+387
+select min(fld1) from t2 where fld1>= 098024;
+min(fld1)
+98024
+select max(fld1) from t2 where fld1>= 098024;
+max(fld1)
+1232609
+select count(*) from t3 where price2=76234234;
+count(*)
+4181
+select count(*) from t3 where companynr=512 and price2=76234234;
+count(*)
+4181
+explain select min(fld1),max(fld1),count(*) from t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select min(fld1),max(fld1),count(*) from t2;
+min(fld1) max(fld1) count(*)
+0 1232609 1199
+select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742;
+min(t2nr) max(t2nr)
+2115 2115
+select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78;
+count(*) min(t2nr) max(t2nr)
+4181 4 41804
+select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20;
+t2nr count(*)
+9 1
+19 1
+29 1
+39 1
+49 1
+59 1
+69 1
+79 1
+89 1
+99 1
+109 1
+119 1
+129 1
+139 1
+149 1
+159 1
+169 1
+179 1
+189 1
+199 1
+select max(t2nr) from t3 where price=983543950;
+max(t2nr)
+41807
+select t1.period from t3 = t1 limit 1;
+period
+1001
+select t1.period from t1 as t1 limit 1;
+period
+9410
+select t1.period as "Nuvarande period" from t1 as t1 limit 1;
+Nuvarande period
+9410
+select period as ok_period from t1 limit 1;
+ok_period
+9410
+select period as ok_period from t1 group by ok_period limit 1;
+ok_period
+9410
+select 1+1 as summa from t1 group by summa limit 1;
+summa
+2
+select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1;
+Nuvarande period
+9410
+show tables;
+Tables_in_test
+t1
+t2
+t3
+t4
+show tables from test like "s%";
+Tables_in_test (s%)
+show tables from test like "t?";
+Tables_in_test (t?)
+show full columns from t2;
+Field Type Collation Null Key Default Extra Privileges Comment
+auto int(11) NULL NO PRI NULL auto_increment #
+fld1 int(6) unsigned zerofill NULL NO UNI 000000 #
+companynr tinyint(2) unsigned zerofill NULL NO 00 #
+fld3 char(30) latin1_swedish_ci NO MUL #
+fld4 char(35) latin1_swedish_ci NO #
+fld5 char(35) latin1_swedish_ci NO #
+fld6 char(4) latin1_swedish_ci NO #
+show full columns from t2 from test like 'f%';
+Field Type Collation Null Key Default Extra Privileges Comment
+fld1 int(6) unsigned zerofill NULL NO UNI 000000 #
+fld3 char(30) latin1_swedish_ci NO MUL #
+fld4 char(35) latin1_swedish_ci NO #
+fld5 char(35) latin1_swedish_ci NO #
+fld6 char(4) latin1_swedish_ci NO #
+show full columns from t2 from test like 's%';
+Field Type Collation Null Key Default Extra Privileges Comment
+show keys from t2;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE
+t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE
+t2 1 fld3 1 fld3 A NULL NULL NULL BTREE
+drop table t4, t3, t2, t1;
+CREATE TABLE t1 (
+cont_nr int(11) NOT NULL auto_increment,
+ver_nr int(11) NOT NULL default '0',
+aufnr int(11) NOT NULL default '0',
+username varchar(50) NOT NULL default '',
+hdl_nr int(11) NOT NULL default '0',
+eintrag date NOT NULL default '0000-00-00',
+st_klasse varchar(40) NOT NULL default '',
+st_wert varchar(40) NOT NULL default '',
+st_zusatz varchar(40) NOT NULL default '',
+st_bemerkung varchar(255) NOT NULL default '',
+kunden_art varchar(40) NOT NULL default '',
+mcbs_knr int(11) default NULL,
+mcbs_aufnr int(11) NOT NULL default '0',
+schufa_status char(1) default '?',
+bemerkung text,
+wirknetz text,
+wf_igz int(11) NOT NULL default '0',
+tarifcode varchar(80) default NULL,
+recycle char(1) default NULL,
+sim varchar(30) default NULL,
+mcbs_tpl varchar(30) default NULL,
+emp_nr int(11) NOT NULL default '0',
+laufzeit int(11) default NULL,
+hdl_name varchar(30) default NULL,
+prov_hdl_nr int(11) NOT NULL default '0',
+auto_wirknetz varchar(50) default NULL,
+auto_billing varchar(50) default NULL,
+touch timestamp NOT NULL,
+kategorie varchar(50) default NULL,
+kundentyp varchar(20) NOT NULL default '',
+sammel_rech_msisdn varchar(30) NOT NULL default '',
+p_nr varchar(9) NOT NULL default '',
+suffix char(3) NOT NULL default '',
+PRIMARY KEY (cont_nr),
+KEY idx_aufnr(aufnr),
+KEY idx_hdl_nr(hdl_nr),
+KEY idx_st_klasse(st_klasse),
+KEY ver_nr(ver_nr),
+KEY eintrag_idx(eintrag),
+KEY emp_nr_idx(emp_nr),
+KEY wf_igz(wf_igz),
+KEY touch(touch),
+KEY hdl_tag(eintrag,hdl_nr),
+KEY prov_hdl_nr(prov_hdl_nr),
+KEY mcbs_aufnr(mcbs_aufnr),
+KEY kundentyp(kundentyp),
+KEY p_nr(p_nr,suffix)
+) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359359,468,3359359,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1507831,2143894,'+','','P',1909162,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359360,0,0,'Mustermann Musterfrau',29674907,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1900169997,2414578,'+',NULL,'N',1909148,'',NULL,NULL,'RV99066_2',20,NULL,'POS',29674907,NULL,NULL,20010202105916,'Mobilfunk','','','97317481','007');
+INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag storniert','','(7001-84):Storno, Kd. möchte nicht mehr','privat',NULL,0,'+','','P',1909150,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie;
+Kundentyp kategorie
+Privat (Private Nutzung) Mobilfunk
+Warnings:
+Warning 1052 Column 'kundentyp' in group statement is ambiguous
+drop table t1;
+mysqld is alive
+End of 5.0 tests.
diff --git a/mysql-test/r/skip_grants.result b/mysql-test/r/skip_grants.result
index 3052bae8e97..1ef35b051d6 100644
--- a/mysql-test/r/skip_grants.result
+++ b/mysql-test/r/skip_grants.result
@@ -70,3 +70,8 @@ count(*)
select count(*) from information_schema.USER_PRIVILEGES;
count(*)
0
+CREATE FUNCTION a RETURNS STRING SONAME '';
+ERROR HY000: Can't initialize function 'a'; UDFs are unavailable with the --skip-grant-tables option
+DROP FUNCTION a;
+ERROR 42000: FUNCTION test.a does not exist
+End of 5.0 tests
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index bd0640b2b14..b4bcfbdc7f7 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -1211,7 +1211,7 @@ ERROR 42S02: Unknown table 'c' in field list
drop procedure bug15091;
drop function if exists bug16896;
create aggregate function bug16896() returns int return 1;
-ERROR 42000: AGGREGATE is not supported for stored functions
+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 '() returns int return 1' at line 1
DROP PROCEDURE IF EXISTS bug14702;
CREATE IF NOT EXISTS PROCEDURE bug14702()
BEGIN
@@ -1452,3 +1452,16 @@ end
until true end repeat retry;
end//
ERROR 42000: LEAVE with no matching label: retry
+DROP DATABASE IF EXISTS mysqltest;
+CREATE DATABASE mysqltest;
+USE mysqltest;
+DROP DATABASE mysqltest;
+SELECT inexistent(), 1 + ,;
+ERROR 42000: FUNCTION inexistent does not exist
+SELECT inexistent();
+ERROR 42000: FUNCTION inexistent does not exist
+SELECT .inexistent();
+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 ..inexistent();
+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 '.inexistent()' at line 1
+USE test;
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index b1120a22dfd..061bbafd9a1 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -5667,7 +5667,6 @@ t3_id_1 t3_id_2 t4_id
DROP PROCEDURE p1|
DROP VIEW v1, v2|
DROP TABLE t3, t4|
-End of 5.0 tests
DROP TABLE IF EXISTS bug23760|
DROP TABLE IF EXISTS bug23760_log|
DROP PROCEDURE IF EXISTS bug23760_update_log|
@@ -6145,7 +6144,6 @@ Procedure sql_mode Create Procedure
proc_21513 CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_21513`()
`my_label`:BEGIN END
drop procedure proc_21513|
-End of 5.0 tests.
drop table t1,t2;
CREATE TABLE t1 (a int auto_increment primary key) engine=MyISAM;
CREATE TABLE t2 (a int auto_increment primary key, b int) engine=innodb;
@@ -6565,4 +6563,21 @@ f1()
DROP TABLE t1;
DROP FUNCTION f1;
-End of 5.0 tests
+DROP PROCEDURE IF EXISTS db28318_a.t1;
+DROP PROCEDURE IF EXISTS db28318_b.t2;
+DROP DATABASE IF EXISTS db28318_a;
+DROP DATABASE IF EXISTS db28318_b;
+CREATE DATABASE db28318_a;
+CREATE DATABASE db28318_b;
+CREATE PROCEDURE db28318_a.t1() SELECT "db28318_a.t1";
+CREATE PROCEDURE db28318_b.t2() CALL t1();
+use db28318_a;
+CALL db28318_b.t2();
+ERROR 42000: PROCEDURE db28318_b.t1 does not exist
+DROP PROCEDURE db28318_a.t1;
+DROP PROCEDURE db28318_b.t2;
+DROP DATABASE db28318_a;
+DROP DATABASE db28318_b;
+# ------------------------------------------------------------------
+# -- End of 5.0 tests
+# ------------------------------------------------------------------
diff --git a/mysql-test/r/sp_trans_log.result b/mysql-test/r/sp_trans_log.result
index 96e6f76b23c..9b644798079 100644
--- a/mysql-test/r/sp_trans_log.result
+++ b/mysql-test/r/sp_trans_log.result
@@ -12,8 +12,10 @@ end|
reset master|
insert into t2 values (bug23333(),1)|
ERROR 23000: Duplicate entry '1' for key 1
-show binlog events from 98 /* with fixes for #23333 will show there is the query */|
+show binlog events from 98 /* with fixes for #23333 will show there are 2 queries */|
Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # #
+master-bin.000001 # Query 1 # #
select count(*),@a from t1 /* must be 1,1 */|
count(*) @a
1 1
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index be99bdb1afc..1c450269809 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -4139,4 +4139,64 @@ SELECT (SELECT SUM(t1.a) FROM t2 WHERE a=1) FROM t1;
(SELECT SUM(t1.a) FROM t2 WHERE a=1)
3
DROP TABLE t1,t2;
+CREATE TABLE t1 (a1 INT, a2 INT);
+CREATE TABLE t2 (b1 INT, b2 INT);
+INSERT INTO t1 VALUES (100, 200);
+INSERT INTO t1 VALUES (101, 201);
+INSERT INTO t2 VALUES (101, 201);
+INSERT INTO t2 VALUES (103, 203);
+SELECT ((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL FROM t1;
+((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL
+0
+0
+DROP TABLE t1, t2;
+CREATE TABLE t1 (s1 BINARY(5), s2 VARBINARY(5));
+INSERT INTO t1 VALUES (0x41,0x41), (0x42,0x42), (0x43,0x43);
+SELECT s1, s2 FROM t1 WHERE s2 IN (SELECT s1 FROM t1);
+s1 s2
+SELECT s1, s2 FROM t1 WHERE (s2, 10) IN (SELECT s1, 10 FROM t1);
+s1 s2
+CREATE INDEX I1 ON t1 (s1);
+CREATE INDEX I2 ON t1 (s2);
+SELECT s1, s2 FROM t1 WHERE s2 IN (SELECT s1 FROM t1);
+s1 s2
+SELECT s1, s2 FROM t1 WHERE (s2, 10) IN (SELECT s1, 10 FROM t1);
+s1 s2
+TRUNCATE t1;
+INSERT INTO t1 VALUES (0x41,0x41);
+SELECT * FROM t1 WHERE s1 = (SELECT s2 FROM t1);
+s1 s2
+DROP TABLE t1;
+CREATE TABLE t1 (a1 VARBINARY(2) NOT NULL DEFAULT '0', PRIMARY KEY (a1));
+CREATE TABLE t2 (a2 BINARY(2) default '0', INDEX (a2));
+CREATE TABLE t3 (a3 BINARY(2) default '0');
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+INSERT INTO t2 VALUES (1),(2),(3);
+INSERT INTO t3 VALUES (1),(2),(3);
+SELECT LEFT(t2.a2, 1) FROM t2,t3 WHERE t3.a3=t2.a2;
+LEFT(t2.a2, 1)
+1
+2
+3
+SELECT t1.a1, t1.a1 in (SELECT t2.a2 FROM t2,t3 WHERE t3.a3=t2.a2) FROM t1;
+a1 t1.a1 in (SELECT t2.a2 FROM t2,t3 WHERE t3.a3=t2.a2)
+1 0
+2 0
+3 0
+4 0
+DROP TABLE t1,t2,t3;
+CREATE TABLE t1 (a1 BINARY(3) PRIMARY KEY, b1 VARBINARY(3));
+CREATE TABLE t2 (a2 VARBINARY(3) PRIMARY KEY);
+CREATE TABLE t3 (a3 VARBINARY(3) PRIMARY KEY);
+INSERT INTO t1 VALUES (1,10), (2,20), (3,30), (4,40);
+INSERT INTO t2 VALUES (2), (3), (4), (5);
+INSERT INTO t3 VALUES (10), (20), (30);
+SELECT LEFT(t1.a1,1) FROM t1,t3 WHERE t1.b1=t3.a3;
+LEFT(t1.a1,1)
+1
+2
+3
+SELECT a2 FROM t2 WHERE t2.a2 IN (SELECT t1.a1 FROM t1,t3 WHERE t1.b1=t3.a3);
+a2
+DROP TABLE t1, t2, t3;
End of 5.0 tests.
diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result
index 92809e1e25b..bd2a43569dd 100644
--- a/mysql-test/r/type_date.result
+++ b/mysql-test/r/type_date.result
@@ -136,6 +136,16 @@ d dt ts
0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00
2001-11-11 2001-11-11 00:00:00 2001-11-11 00:00:00
drop table t1;
+CREATE TABLE t1 (
+a INT
+);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (NULL);
+SELECT str_to_date( '', a ) FROM t1;
+str_to_date( '', a )
+0000-00-00 00:00:00
+NULL
+DROP TABLE t1;
CREATE TABLE t1 (a DATE, b int, PRIMARY KEY (a,b));
INSERT INTO t1 VALUES (DATE(NOW()), 1);
SELECT COUNT(*) FROM t1 WHERE a = NOW();
@@ -165,4 +175,43 @@ EXPLAIN SELECT COUNT(*) FROM t1 WHERE a = NOW();
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
DROP TABLE t1;
+CREATE TABLE t1 (a DATE);
+CREATE TABLE t2 (a DATE);
+CREATE INDEX i ON t1 (a);
+INSERT INTO t1 VALUES ('0000-00-00'),('0000-00-00');
+INSERT INTO t2 VALUES ('0000-00-00'),('0000-00-00');
+SELECT * FROM t1 WHERE a = '0000-00-00';
+a
+0000-00-00
+0000-00-00
+SELECT * FROM t2 WHERE a = '0000-00-00';
+a
+0000-00-00
+0000-00-00
+SET SQL_MODE=TRADITIONAL;
+EXPLAIN SELECT * FROM t1 WHERE a = '0000-00-00';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref i i 4 const 1 Using where; Using index
+Warnings:
+Warning 1292 Incorrect date value: '0000-00-00' for column 'a' at row 1
+Warning 1292 Incorrect date value: '0000-00-00' for column 'a' at row 1
+SELECT * FROM t1 WHERE a = '0000-00-00';
+a
+0000-00-00
+0000-00-00
+Warnings:
+Warning 1292 Incorrect date value: '0000-00-00' for column 'a' at row 1
+Warning 1292 Incorrect date value: '0000-00-00' for column 'a' at row 1
+Warning 1292 Incorrect date value: '0000-00-00' for column 'a' at row 1
+SELECT * FROM t2 WHERE a = '0000-00-00';
+a
+0000-00-00
+0000-00-00
+Warnings:
+Warning 1292 Incorrect date value: '0000-00-00' for column 'a' at row 1
+Warning 1292 Incorrect date value: '0000-00-00' for column 'a' at row 1
+INSERT INTO t1 VALUES ('0000-00-00');
+ERROR 22007: Incorrect date value: '0000-00-00' for column 'a' at row 1
+SET SQL_MODE=DEFAULT;
+DROP TABLE t1,t2;
End of 5.0 tests
diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result
index ceab71f2cfb..73edfb75ff6 100644
--- a/mysql-test/r/type_datetime.result
+++ b/mysql-test/r/type_datetime.result
@@ -429,3 +429,80 @@ f1
Warnings:
Warning 1292 Incorrect datetime value: '2007010100000' for column 'f1' at row 1
drop table t1;
+#
+# Bug#27216: functions with parameters of different date types may
+# return wrong type of the result.
+#
+create table t1 (f1 date, f2 datetime, f3 varchar(20));
+create table t2 as select coalesce(f1,f1) as f4 from t1;
+desc t2;
+Field Type Null Key Default Extra
+f4 date YES NULL
+create table t3 as select coalesce(f1,f2) as f4 from t1;
+desc t3;
+Field Type Null Key Default Extra
+f4 datetime YES NULL
+create table t4 as select coalesce(f2,f2) as f4 from t1;
+desc t4;
+Field Type Null Key Default Extra
+f4 datetime YES NULL
+create table t5 as select coalesce(f1,f3) as f4 from t1;
+desc t5;
+Field Type Null Key Default Extra
+f4 varbinary(20) YES NULL
+create table t6 as select coalesce(f2,f3) as f4 from t1;
+desc t6;
+Field Type Null Key Default Extra
+f4 varbinary(20) YES NULL
+create table t7 as select coalesce(makedate(1997,1),f2) as f4 from t1;
+desc t7;
+Field Type Null Key Default Extra
+f4 datetime YES NULL
+create table t8 as select coalesce(cast('01-01-01' as datetime),f2) as f4
+from t1;
+desc t8;
+Field Type Null Key Default Extra
+f4 datetime YES NULL
+create table t9 as select case when 1 then cast('01-01-01' as date)
+when 0 then cast('01-01-01' as date) end as f4 from t1;
+desc t9;
+Field Type Null Key Default Extra
+f4 date YES NULL
+create table t10 as select case when 1 then cast('01-01-01' as datetime)
+when 0 then cast('01-01-01' as datetime) end as f4 from t1;
+desc t10;
+Field Type Null Key Default Extra
+f4 datetime YES NULL
+create table t11 as select if(1, cast('01-01-01' as datetime),
+cast('01-01-01' as date)) as f4 from t1;
+desc t11;
+Field Type Null Key Default Extra
+f4 datetime YES NULL
+create table t12 as select least(cast('01-01-01' as datetime),
+cast('01-01-01' as date)) as f4 from t1;
+desc t12;
+Field Type Null Key Default Extra
+f4 datetime YES NULL
+create table t13 as select ifnull(cast('01-01-01' as datetime),
+cast('01-01-01' as date)) as f4 from t1;
+desc t13;
+Field Type Null Key Default Extra
+f4 datetime YES NULL
+drop tables t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13;
+###################################################################
+create table t1 (f1 time);
+insert into t1 set f1 = '45:44:44';
+insert into t1 set f1 = '15:44:44';
+select * from t1 where (convert(f1,datetime)) != 1;
+f1
+15:44:44
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '0000-00-00 45:44:44'
+drop table t1;
+create table t1 (a tinyint);
+insert into t1 values (), (), ();
+select sum(a) from t1 group by convert(a, datetime);
+sum(a)
+NULL
+drop table t1;
+End of 5.0 tests
diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result
index 3cf24529421..a438755ce6b 100644
--- a/mysql-test/r/type_decimal.result
+++ b/mysql-test/r/type_decimal.result
@@ -683,6 +683,7 @@ select * from t1;
a b
123.12345 123.1
drop table t1;
+End of 4.1 tests
CREATE TABLE t1
(EMPNUM CHAR(3) NOT NULL,
HOURS DECIMAL(5));
@@ -799,3 +800,93 @@ SELECT ROUND(qty,3), dps, ROUND(qty,dps) FROM t1;
ROUND(qty,3) dps ROUND(qty,dps)
1.133 3 1.133
DROP TABLE t1;
+SELECT 1 % .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS '%';
+%
+0.012345687012345687012345687012345687012345687012345687012345687012345687000000000
+SELECT MOD(1, .123456789123456789123456789123456789123456789123456789123456789123456789123456789) AS 'MOD()';
+MOD()
+0.012345687012345687012345687012345687012345687012345687012345687012345687000000000
+create table t1 (f1 decimal(6,6),f2 decimal(6,6) zerofill);
+insert into t1 values (-0.123456,0.123456);
+select group_concat(f1),group_concat(f2) from t1;
+group_concat(f1) group_concat(f2)
+-0.123456 0.123456
+drop table t1;
+create table t1 (
+ua_id decimal(22,0) not null,
+ua_invited_by_id decimal(22,0) default NULL,
+primary key(ua_id)
+);
+insert into t1 values (123, NULL), (456, NULL);
+this must not produce error 1048:
+select * from t1 where ua_invited_by_id not in (select ua_id from t1);
+ua_id ua_invited_by_id
+drop table t1;
+DROP TABLE IF EXISTS t3;
+DROP TABLE IF EXISTS t4;
+CREATE TABLE t1( a NUMERIC, b INT );
+INSERT INTO t1 VALUES (123456, 40), (123456, 40);
+SELECT TRUNCATE( a, b ) AS c FROM t1 ORDER BY c;
+c
+123456
+123456
+SELECT ROUND( a, b ) AS c FROM t1 ORDER BY c;
+c
+123456
+123456
+SELECT ROUND( a, 100 ) AS c FROM t1 ORDER BY c;
+c
+123456.000000000000000000000000000000
+123456.000000000000000000000000000000
+CREATE TABLE t2( a NUMERIC, b INT );
+INSERT INTO t2 VALUES (123456, 100);
+SELECT TRUNCATE( a, b ) AS c FROM t2 ORDER BY c;
+c
+123456
+SELECT ROUND( a, b ) AS c FROM t2 ORDER BY c;
+c
+123456
+CREATE TABLE t3( a DECIMAL, b INT );
+INSERT INTO t3 VALUES (123456, 40), (123456, 40);
+SELECT TRUNCATE( a, b ) AS c FROM t3 ORDER BY c;
+c
+123456
+123456
+SELECT ROUND( a, b ) AS c FROM t3 ORDER BY c;
+c
+123456
+123456
+SELECT ROUND( a, 100 ) AS c FROM t3 ORDER BY c;
+c
+123456.000000000000000000000000000000
+123456.000000000000000000000000000000
+CREATE TABLE t4( a DECIMAL, b INT );
+INSERT INTO t4 VALUES (123456, 40), (123456, 40);
+SELECT TRUNCATE( a, b ) AS c FROM t4 ORDER BY c;
+c
+123456
+123456
+SELECT ROUND( a, b ) AS c FROM t4 ORDER BY c;
+c
+123456
+123456
+SELECT ROUND( a, 100 ) AS c FROM t4 ORDER BY c;
+c
+123456.000000000000000000000000000000
+123456.000000000000000000000000000000
+delete from t1;
+INSERT INTO t1 VALUES (1234567890, 20), (999.99, 5);
+Warnings:
+Note 1265 Data truncated for column 'a' at row 2
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` decimal(10,0) default NULL,
+ `b` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select round(a,b) as c from t1 order by c;
+c
+1000
+1234567890
+DROP TABLE t1, t2, t3, t4;
+End of 5.0 tests
diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result
index 53844d2cfe2..f1075604ca9 100644
--- a/mysql-test/r/type_float.result
+++ b/mysql-test/r/type_float.result
@@ -344,6 +344,22 @@ create table t1 (s1 float(0,2));
ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1').
create table t1 (s1 float(1,2));
ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1').
+CREATE TABLE t1 (
+f1 real zerofill,
+f2 double zerofill,
+f3 float zerofill);
+INSERT INTO t1 VALUES ( 0.314152e+1, 0.314152e+1, 0.314152e+1);
+PREPARE stmt1 FROM 'select f1, f2, f3 FROM t1';
+select f1, f2, f3 FROM t1;
+f1 f2 f3
+0000000000000003.14152 0000000000000003.14152 000003.14152
+select f1, f2, f3 FROM t1;
+f1 f2 f3
+0000000000000003.14152 0000000000000003.14152 000003.14152
+EXECUTE stmt1;
+f1 f2 f3
+0000000000000003.14152 0000000000000003.14152 000003.14152
+DROP TABLE t1;
create table t1 (f1 double(200, 0));
insert into t1 values (1e199), (-1e199);
insert into t1 values (1e200), (-1e200);
diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result
index 75d9582a23c..b53b49bd0dd 100644
--- a/mysql-test/r/type_newdecimal.result
+++ b/mysql-test/r/type_newdecimal.result
@@ -1499,4 +1499,24 @@ SELECT 1 FROM t1 GROUP BY @b := @a, @b;
1
1
DROP TABLE t1;
+CREATE TABLE t1 SELECT 0.123456789012345678901234567890123456 AS f1;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+DESC t1;
+Field Type Null Key Default Extra
+f1 decimal(31,30) NO 0.000000000000000000000000000000
+SELECT f1 FROM t1;
+f1
+0.123456789012345678901234567890
+DROP TABLE t1;
+CREATE TABLE t1 SELECT 123451234512345123451234512345123451234512345.678906789067890678906789067890678906789067890 AS f1;
+Warnings:
+Warning 1264 Out of range value adjusted for column 'f1' at row 1
+DESC t1;
+Field Type Null Key Default Extra
+f1 decimal(59,30) NO 0.000000000000000000000000000000
+SELECT f1 FROM t1;
+f1
+99999999999999999999999999999.999999999999999999999999999999
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/udf.result b/mysql-test/r/udf.result
index 2e9cf217ed6..e6797796ea0 100644
--- a/mysql-test/r/udf.result
+++ b/mysql-test/r/udf.result
@@ -95,10 +95,10 @@ FR
DROP TABLE bug19904;
CREATE DEFINER=CURRENT_USER() FUNCTION should_not_parse
RETURNS STRING SONAME "should_not_parse.so";
-ERROR HY000: Incorrect usage of SONAME and DEFINER
+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 'RETURNS STRING SONAME "should_not_parse.so"' at line 2
CREATE DEFINER=someone@somewhere FUNCTION should_not_parse
RETURNS STRING SONAME "should_not_parse.so";
-ERROR HY000: Incorrect usage of SONAME and DEFINER
+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 'RETURNS STRING SONAME "should_not_parse.so"' at line 2
create table t1(f1 int);
insert into t1 values(1),(2);
explain select myfunc_int(f1) from t1 order by 1;
@@ -296,4 +296,35 @@ Qcache_queries_in_cache 0
drop table t1;
drop function metaphon;
set GLOBAL query_cache_size=default;
+DROP DATABASE IF EXISTS mysqltest;
+CREATE DATABASE mysqltest;
+USE mysqltest;
+DROP DATABASE mysqltest;
+CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
+DROP FUNCTION metaphon;
+USE test;
+CREATE TABLE const_len_bug (
+str_const varchar(4000),
+result1 varchar(4000),
+result2 varchar(4000)
+);
+CREATE TRIGGER check_const_len_trigger BEFORE INSERT ON const_len_bug FOR EACH ROW BEGIN
+set NEW.str_const = 'bar';
+set NEW.result2 = check_const_len(NEW.str_const);
+END |
+CREATE PROCEDURE check_const_len_sp (IN str_const VARCHAR(4000))
+BEGIN
+DECLARE result VARCHAR(4000);
+SET result = check_const_len(str_const);
+insert into const_len_bug values(str_const, result, "");
+END |
+CREATE FUNCTION check_const_len RETURNS string SONAME "UDF_EXAMPLE_LIB";
+CALL check_const_len_sp("foo");
+SELECT * from const_len_bug;
+str_const result1 result2
+bar Correct length Correct length
+DROP FUNCTION check_const_len;
+DROP PROCEDURE check_const_len_sp;
+DROP TRIGGER check_const_len_trigger;
+DROP TABLE const_len_bug;
End of 5.0 tests.
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index 3d76f8e4a90..47cd96b90b7 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -218,6 +218,8 @@ show variables like 'net_buffer_length';
Variable_name Value
net_buffer_length 1024
set net_buffer_length=2000000000;
+Warnings:
+Warning 1292 Truncated incorrect net_buffer_length value: '2000000000'
show variables like 'net_buffer_length';
Variable_name Value
net_buffer_length 1048576
@@ -673,6 +675,9 @@ set @@query_prealloc_size = @test;
select @@query_prealloc_size = @test;
@@query_prealloc_size = @test
1
+set global sql_mode=repeat('a',80);
+ERROR 42000: Variable 'sql_mode' can't be set to the value of 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+End of 4.1 tests
create table t1 (a int);
select a into @x from t1;
Warnings:
@@ -791,6 +796,22 @@ ERROR HY000: Variable 'hostname' is a read only variable
show variables like 'hostname';
Variable_name Value
hostname #
+SHOW VARIABLES LIKE 'log';
+Variable_name Value
+log ON
+SELECT @@log;
+@@log
+1
+SET GLOBAL log=0;
+ERROR HY000: Variable 'log' is a read only variable
+SHOW VARIABLES LIKE 'log_slow_queries';
+Variable_name Value
+log_slow_queries ON
+SELECT @@log_slow_queries;
+@@log_slow_queries
+1
+SET GLOBAL log_slow_queries=0;
+ERROR HY000: Variable 'log_slow_queries' is a read only variable
End of 5.0 tests
set global binlog_cache_size =@my_binlog_cache_size;
set global connect_timeout =@my_connect_timeout;
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index c5c6b675146..0e3d650c571 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -625,7 +625,7 @@ drop table t1;
create table t1 (a int, b int);
create view v1 as select a, sum(b) from t1 group by a;
select b from v1 use index (some_index) where b=1;
-ERROR HY000: Key 'some_index' doesn't exist in table 'v1'
+ERROR HY000: Incorrect usage of USE INDEX and VIEW
drop view v1;
drop table t1;
create table t1 (col1 char(5),col2 char(5));
@@ -2706,18 +2706,19 @@ CREATE TABLE t1(
fName varchar(25) NOT NULL,
lName varchar(25) NOT NULL,
DOB date NOT NULL,
+test_date date NOT NULL,
uID int unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY);
-INSERT INTO t1(fName, lName, DOB) VALUES
-('Hank', 'Hill', '1964-09-29'),
-('Tom', 'Adams', '1908-02-14'),
-('Homer', 'Simpson', '1968-03-05');
+INSERT INTO t1(fName, lName, DOB, test_date) VALUES
+('Hank', 'Hill', '1964-09-29', '2007-01-01'),
+('Tom', 'Adams', '1908-02-14', '2007-01-01'),
+('Homer', 'Simpson', '1968-03-05', '2007-01-01');
CREATE VIEW v1 AS
-SELECT (year(now())-year(DOB)) AS Age
+SELECT (year(test_date)-year(DOB)) AS Age
FROM t1 HAVING Age < 75;
SHOW CREATE VIEW v1;
View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (year(now()) - year(`t1`.`DOB`)) AS `Age` from `t1` having (`Age` < 75)
-SELECT (year(now())-year(DOB)) AS Age FROM t1 HAVING Age < 75;
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (year(`t1`.`test_date`) - year(`t1`.`DOB`)) AS `Age` from `t1` having (`Age` < 75)
+SELECT (year(test_date)-year(DOB)) AS Age FROM t1 HAVING Age < 75;
Age
43
39
@@ -3562,4 +3563,43 @@ table_name is_updatable
v1 NO
drop view v1;
drop table t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE VIEW v1 AS SELECT * FROM t1;
+SELECT * FROM v1 USE KEY(non_existant);
+ERROR HY000: Incorrect usage of USE INDEX and VIEW
+SELECT * FROM v1 FORCE KEY(non_existant);
+ERROR HY000: Incorrect usage of FORCE INDEX and VIEW
+SELECT * FROM v1 IGNORE KEY(non_existant);
+ERROR HY000: Incorrect usage of IGNORE INDEX and VIEW
+DROP VIEW v1;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b INT NOT NULL DEFAULT 0,
+PRIMARY KEY(a), KEY (b));
+INSERT INTO t1 VALUES (),(),(),(),(),(),(),(),(),(),(),(),(),(),();
+CREATE VIEW v1 AS SELECT * FROM t1 FORCE KEY (PRIMARY,b) ORDER BY a;
+SHOW CREATE VIEW v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` FORCE INDEX (PRIMARY,`b`) order by `t1`.`a`
+EXPLAIN SELECT * FROM v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 15
+CREATE VIEW v2 AS SELECT * FROM t1 USE KEY () ORDER BY a;
+SHOW CREATE VIEW v2;
+View Create View
+v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` USE INDEX () order by `t1`.`a`
+EXPLAIN SELECT * FROM v2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 15 Using filesort
+CREATE VIEW v3 AS SELECT * FROM t1 IGNORE KEY (b) ORDER BY a;
+SHOW CREATE VIEW v3;
+View Create View
+v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` IGNORE INDEX (`b`) order by `t1`.`a`
+EXPLAIN SELECT * FROM v3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 15 Using filesort
+DROP VIEW v1;
+DROP VIEW v2;
+DROP VIEW v3;
+DROP TABLE t1;
End of 5.0 tests.
diff --git a/mysql-test/r/view_grant.result b/mysql-test/r/view_grant.result
index 0f9ce47dec6..eef61c65fb8 100644
--- a/mysql-test/r/view_grant.result
+++ b/mysql-test/r/view_grant.result
@@ -776,15 +776,60 @@ GRANT CREATE VIEW ON db26813.v2 TO u26813@localhost;
GRANT DROP, CREATE VIEW ON db26813.v3 TO u26813@localhost;
GRANT SELECT ON db26813.t1 TO u26813@localhost;
ALTER VIEW v1 AS SELECT f2 FROM t1;
-ERROR 42000: CREATE VIEW command denied to user 'u26813'@'localhost' for table 'v1'
+ERROR 42000: Access denied; you need the SUPER privilege for this operation
ALTER VIEW v2 AS SELECT f2 FROM t1;
-ERROR 42000: DROP command denied to user 'u26813'@'localhost' for table 'v2'
+ERROR 42000: Access denied; you need the SUPER privilege for this operation
ALTER VIEW v3 AS SELECT f2 FROM t1;
+ERROR 42000: Access denied; you need the SUPER privilege for this operation
SHOW CREATE VIEW v3;
View Create View
-v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`f2` AS `f2` from `t1`
+v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`f1` AS `f1` from `t1`
DROP USER u26813@localhost;
DROP DATABASE db26813;
+#
+# Bug#29908: A user can gain additional access through the ALTER VIEW.
+#
+CREATE DATABASE mysqltest_29908;
+USE mysqltest_29908;
+CREATE TABLE t1(f1 INT, f2 INT);
+CREATE USER u29908_1@localhost;
+CREATE DEFINER = u29908_1@localhost VIEW v1 AS SELECT f1 FROM t1;
+CREATE DEFINER = u29908_1@localhost SQL SECURITY INVOKER VIEW v2 AS
+SELECT f1 FROM t1;
+GRANT DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v1 TO u29908_1@localhost;
+GRANT DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_1@localhost;
+GRANT SELECT ON mysqltest_29908.t1 TO u29908_1@localhost;
+CREATE USER u29908_2@localhost;
+GRANT DROP, CREATE VIEW ON mysqltest_29908.v1 TO u29908_2@localhost;
+GRANT DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_2@localhost;
+GRANT SELECT ON mysqltest_29908.t1 TO u29908_2@localhost;
+ALTER VIEW v1 AS SELECT f2 FROM t1;
+ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ALTER VIEW v2 AS SELECT f2 FROM t1;
+ERROR 42000: Access denied; you need the SUPER privilege for this operation
+SHOW CREATE VIEW v2;
+View Create View
+v2 CREATE ALGORITHM=UNDEFINED DEFINER=`u29908_1`@`localhost` SQL SECURITY INVOKER VIEW `v2` AS select `t1`.`f1` AS `f1` from `t1`
+ALTER VIEW v1 AS SELECT f2 FROM t1;
+SHOW CREATE VIEW v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`u29908_1`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f2` AS `f2` from `t1`
+ALTER VIEW v2 AS SELECT f2 FROM t1;
+SHOW CREATE VIEW v2;
+View Create View
+v2 CREATE ALGORITHM=UNDEFINED DEFINER=`u29908_1`@`localhost` SQL SECURITY INVOKER VIEW `v2` AS select `t1`.`f2` AS `f2` from `t1`
+ALTER VIEW v1 AS SELECT f1 FROM t1;
+SHOW CREATE VIEW v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`u29908_1`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
+ALTER VIEW v2 AS SELECT f1 FROM t1;
+SHOW CREATE VIEW v2;
+View Create View
+v2 CREATE ALGORITHM=UNDEFINED DEFINER=`u29908_1`@`localhost` SQL SECURITY INVOKER VIEW `v2` AS select `t1`.`f1` AS `f1` from `t1`
+DROP USER u29908_1@localhost;
+DROP USER u29908_2@localhost;
+DROP DATABASE mysqltest_29908;
+#######################################################################
DROP DATABASE IF EXISTS mysqltest1;
DROP DATABASE IF EXISTS mysqltest2;
CREATE DATABASE mysqltest1;
diff --git a/mysql-test/r/windows_shm.result b/mysql-test/r/windows_shm.result
deleted file mode 100644
index c60049bece8..00000000000
--- a/mysql-test/r/windows_shm.result
+++ /dev/null
@@ -1,2 +0,0 @@
-mysqld is alive
-End of 5.0 tests.
diff --git a/mysql-test/std_data/corrupt-relay-bin.000624 b/mysql-test/std_data/corrupt-relay-bin.000624
new file mode 100644
index 00000000000..21b4901211c
--- /dev/null
+++ b/mysql-test/std_data/corrupt-relay-bin.000624
Binary files differ
diff --git a/mysql-test/suite/funcs_1/datadict/datadict_master.inc b/mysql-test/suite/funcs_1/datadict/datadict_master.inc
index 3992f6325eb..0499d3945e2 100644
--- a/mysql-test/suite/funcs_1/datadict/datadict_master.inc
+++ b/mysql-test/suite/funcs_1/datadict/datadict_master.inc
@@ -188,7 +188,7 @@ select s.catalog_name, s.schema_name, s.default_character_set_name,
--source suite/funcs_1/datadict/datadict_bug_12777.inc
select * from columns;
select * from character_sets;
-select sum(id) from collations;
+select sum(id) from collations where collation_name <> 'utf8_general_cs';
select collation_name, character_set_name into @x,@y
from collation_character_set_applicability limit 1;
select @x, @y;
@@ -1649,13 +1649,14 @@ connect (u_6_401017, localhost, u_6_401017, , test);
use information_schema;
-select * from collation_character_set_applicability;
+select * from collation_character_set_applicability
+where collation_name <> 'utf8_general_cs';
select * from schemata;
select table_name from tables;
--source suite/funcs_1/datadict/datadict_bug_12777.inc
select table_name, column_name, column_type from columns;
select character_set_name from character_sets;
-select collation_name from collations;
+select collation_name from collations where collation_name <> 'utf8_general_cs';
select routine_name, routine_type from routines;
select table_name, index_name from statistics;
select table_name from views;
@@ -1915,7 +1916,7 @@ let $message= Testcase 3.2.3.2:;
# the USAGE privilege.
################################################################################
-SELECT * FROM collations;
+SELECT * FROM collations where collation_name <> 'utf8_general_cs';
# -------------------------------------------------------------------------------------------------------
let $message= Testcase 3.2.3.3:;
@@ -1962,7 +1963,8 @@ let $message= Testcase 3.2.4.2:;
# and update with expected results afterwards.
################################################################################
-SELECT * FROM collation_character_set_applicability;
+SELECT * FROM collation_character_set_applicability
+where collation_name <> 'utf8_general_cs';
# -------------------------------------------------------------------------------------------------------
let $message= Testcase 3.2.4.3:;
diff --git a/mysql-test/suite/funcs_1/datadict/datadict_show_schema.inc b/mysql-test/suite/funcs_1/datadict/datadict_show_schema.inc
index 260119f030f..35060cefbf8 100644
--- a/mysql-test/suite/funcs_1/datadict/datadict_show_schema.inc
+++ b/mysql-test/suite/funcs_1/datadict/datadict_show_schema.inc
@@ -35,8 +35,9 @@ eval select table_name, index_schema, index_name, index_type
where table_schema like '$dbname%';
--replace_result $SERVER_NAME <SERVER_NAME>
+--sorted_result
eval select *
- from information_schema.user_privileges order by grantee, privilege_type;
+ from information_schema.user_privileges;
# where grantee="'u_6_401013'@'%'";
eval select *
diff --git a/mysql-test/suite/funcs_1/datadict/datadict_tables.inc b/mysql-test/suite/funcs_1/datadict/datadict_tables.inc
index ea6e7c5d534..00ec93095ea 100644
--- a/mysql-test/suite/funcs_1/datadict/datadict_tables.inc
+++ b/mysql-test/suite/funcs_1/datadict/datadict_tables.inc
@@ -28,8 +28,8 @@ eval $dd_part1 tables $dd_part2;
--source suite/funcs_1/datadict/datadict_bug_12777.inc
eval $dd_part1 columns $dd_part2;
eval $dd_part1 character_sets $dd_part2;
-eval $dd_part1 collations $dd_part2;
-eval $dd_part1 collation_character_set_applicability $dd_part2;
+eval $dd_part1 collations where collation_name <> 'utf8_general_cs' $dd_part2;
+eval $dd_part1 collation_character_set_applicability where collation_name <> 'utf8_general_cs' $dd_part2;
--replace_column 16 <Created> 17 <Last_Altered>
eval $dd_part1 routines $dd_part2;
eval $dd_part1 statistics $dd_part2;
diff --git a/mysql-test/suite/funcs_1/r/innodb__datadict.result b/mysql-test/suite/funcs_1/r/innodb__datadict.result
index ff6de471cb0..9fa268b37e3 100644
--- a/mysql-test/suite/funcs_1/r/innodb__datadict.result
+++ b/mysql-test/suite/funcs_1/r/innodb__datadict.result
@@ -1786,7 +1786,7 @@ NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 1
NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLUMN_TYPE 15 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema COLUMNS EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
@@ -1827,7 +1827,7 @@ NULL information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL u
NULL information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) select
NULL information_schema ROUTINES CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema ROUTINES SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema ROUTINES ROUTINE_COMMENT 19 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema ROUTINES DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
@@ -1897,7 +1897,7 @@ NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL N
NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
NULL information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS ACTION_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) select
NULL information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -1905,8 +1905,8 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS DEFINER 19 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
NULL information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -1914,7 +1914,7 @@ NULL information_schema USER_PRIVILEGES IS_GRANTABLE 4 NO varchar 3 9 NULL NULL
NULL information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema VIEWS VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
@@ -2455,9 +2455,9 @@ binary binary Binary pseudo charset 1
geostd8 geostd8_general_ci GEOSTD8 Georgian 1
cp932 cp932_japanese_ci SJIS for Windows Japanese 2
eucjpms eucjpms_japanese_ci UJIS for Windows Japanese 3
-select sum(id) from collations;
+select sum(id) from collations where collation_name <> 'utf8_general_cs';
sum(id)
-10995
+10741
select collation_name, character_set_name into @x,@y
from collation_character_set_applicability limit 1;
select @x, @y;
@@ -2860,10 +2860,10 @@ NULL information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 64 192 N
SELECT * FROM character_sets LIMIT 1;
CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN
big5 big5_chinese_ci Big5 Traditional Chinese 2
-SELECT * FROM collations LIMIT 1;
+SELECT * FROM collations where collation_name <> 'utf8_general_cs' LIMIT 1;
COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN
big5_chinese_ci big5 1 Yes Yes 1
-SELECT * FROM collation_character_set_applicability LIMIT 1;
+SELECT * FROM collation_character_set_applicability where collation_name <> 'utf8_general_cs' LIMIT 1;
COLLATION_NAME CHARACTER_SET_NAME
big5_chinese_ci big5
SELECT * FROM routines LIMIT 1;
@@ -4379,12 +4379,12 @@ COUNT(*)
SELECT COUNT(*) FROM information_schema. character_sets ;
COUNT(*)
36
-SELECT COUNT(*) FROM information_schema. collations ;
+SELECT COUNT(*) FROM information_schema. collations where collation_name <> 'utf8_general_cs' ;
COUNT(*)
-127
-SELECT COUNT(*) FROM information_schema. collation_character_set_applicability ;
+126
+SELECT COUNT(*) FROM information_schema. collation_character_set_applicability where collation_name <> 'utf8_general_cs' ;
COUNT(*)
-127
+126
SELECT COUNT(*) FROM information_schema. routines ;
COUNT(*)
1
@@ -6113,7 +6113,7 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges order by grantee, privilege_type;
+from information_schema.user_privileges;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
'root'@'127.0.0.1' NULL ALTER ROUTINE YES
@@ -6258,7 +6258,7 @@ where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
res_t_401013 db_datadict i_6_401013 BTREE
select *
-from information_schema.user_privileges order by grantee, privilege_type;
+from information_schema.user_privileges;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
'root'@'127.0.0.1' NULL ALTER ROUTINE YES
@@ -6389,7 +6389,7 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges order by grantee, privilege_type;
+from information_schema.user_privileges;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
'root'@'127.0.0.1' NULL ALTER ROUTINE YES
@@ -6532,7 +6532,7 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges order by grantee, privilege_type;
+from information_schema.user_privileges;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
'root'@'127.0.0.1' NULL ALTER ROUTINE YES
@@ -6671,7 +6671,7 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges order by grantee, privilege_type;
+from information_schema.user_privileges;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
'root'@'127.0.0.1' NULL ALTER ROUTINE YES
@@ -6823,7 +6823,7 @@ where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
res_t_401015 db_datadict i_6_401015 BTREE
select *
-from information_schema.user_privileges order by grantee, privilege_type;
+from information_schema.user_privileges;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
'root'@'127.0.0.1' NULL ALTER ROUTINE YES
@@ -6953,7 +6953,7 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges order by grantee, privilege_type;
+from information_schema.user_privileges;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
'root'@'127.0.0.1' NULL ALTER ROUTINE YES
@@ -7164,7 +7164,8 @@ ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_
FLUSH PRIVILEGES;
connect(localhost,u_6_401017,,test,MYSQL_PORT,MYSQL_SOCK);
use information_schema;
-select * from collation_character_set_applicability;
+select * from collation_character_set_applicability
+where collation_name <> 'utf8_general_cs';
COLLATION_NAME CHARACTER_SET_NAME
big5_chinese_ci big5
big5_bin big5
@@ -7240,7 +7241,6 @@ utf8_roman_ci utf8
utf8_persian_ci utf8
utf8_esperanto_ci utf8
utf8_hungarian_ci utf8
-utf8_general_cs utf8
ucs2_general_ci ucs2
ucs2_bin ucs2
ucs2_unicode_ci ucs2
@@ -7796,7 +7796,7 @@ binary
geostd8
cp932
eucjpms
-select collation_name from collations;
+select collation_name from collations where collation_name <> 'utf8_general_cs';
collation_name
big5_chinese_ci
big5_bin
@@ -7872,7 +7872,6 @@ utf8_roman_ci
utf8_persian_ci
utf8_esperanto_ci
utf8_hungarian_ci
-utf8_general_cs
ucs2_general_ci
ucs2_bin
ucs2_unicode_ci
@@ -8161,7 +8160,7 @@ NULL information_schema COLLATIONS SORTLEN 6 0 NO bigint NULL NULL 19 0 NULL NUL
Testcase 3.2.3.2:
--------------------------------------------------------------------------------
-SELECT * FROM collations;
+SELECT * FROM collations where collation_name <> 'utf8_general_cs';
COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN
big5_chinese_ci big5 1 Yes Yes 1
big5_bin big5 84 Yes 1
@@ -8237,7 +8236,6 @@ utf8_roman_ci utf8 207 Yes 8
utf8_persian_ci utf8 208 Yes 8
utf8_esperanto_ci utf8 209 Yes 8
utf8_hungarian_ci utf8 210 Yes 8
-utf8_general_cs utf8 254 Yes 1
ucs2_general_ci ucs2 35 Yes Yes 1
ucs2_bin ucs2 90 Yes 1
ucs2_unicode_ci ucs2 128 Yes 8
@@ -8323,7 +8321,8 @@ NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME
Testcase 3.2.4.2:
--------------------------------------------------------------------------------
-SELECT * FROM collation_character_set_applicability;
+SELECT * FROM collation_character_set_applicability
+where collation_name <> 'utf8_general_cs';
COLLATION_NAME CHARACTER_SET_NAME
big5_chinese_ci big5
big5_bin big5
@@ -8399,7 +8398,6 @@ utf8_roman_ci utf8
utf8_persian_ci utf8
utf8_esperanto_ci utf8
utf8_hungarian_ci utf8
-utf8_general_cs utf8
ucs2_general_ci ucs2
ucs2_bin ucs2
ucs2_unicode_ci ucs2
@@ -8633,7 +8631,7 @@ NUMERIC_PRECISION bigint(21) YES NULL
NUMERIC_SCALE bigint(21) YES NULL
CHARACTER_SET_NAME varchar(64) YES NULL
COLLATION_NAME varchar(64) YES NULL
-COLUMN_TYPE longtext NO
+COLUMN_TYPE longtext NO NULL
COLUMN_KEY varchar(3) NO
EXTRA varchar(20) NO
PRIVILEGES varchar(80) NO
@@ -8686,7 +8684,7 @@ NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 1
NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLUMN_TYPE 15 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema COLUMNS EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
@@ -8741,7 +8739,7 @@ NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 1
NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLUMN_TYPE 15 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema COLUMNS EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
@@ -8782,7 +8780,7 @@ NULL information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL u
NULL information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) select
NULL information_schema ROUTINES CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema ROUTINES SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema ROUTINES ROUTINE_COMMENT 19 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema ROUTINES DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
@@ -8852,7 +8850,7 @@ NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL N
NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
NULL information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS ACTION_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) select
NULL information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -8860,8 +8858,8 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS DEFINER 19 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
NULL information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -8869,7 +8867,7 @@ NULL information_schema USER_PRIVILEGES IS_GRANTABLE 4 NO varchar 3 9 NULL NULL
NULL information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema VIEWS VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
@@ -9379,7 +9377,7 @@ NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 1
NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLUMN_TYPE 15 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema COLUMNS EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
@@ -9420,7 +9418,7 @@ NULL information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL u
NULL information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) select
NULL information_schema ROUTINES CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema ROUTINES SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema ROUTINES ROUTINE_COMMENT 19 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema ROUTINES DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
@@ -9490,7 +9488,7 @@ NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL N
NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
NULL information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS ACTION_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) select
NULL information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -9498,8 +9496,8 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS DEFINER 19 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
NULL information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -9507,7 +9505,7 @@ NULL information_schema USER_PRIVILEGES IS_GRANTABLE 4 NO varchar 3 9 NULL NULL
NULL information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema VIEWS VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
@@ -9813,7 +9811,7 @@ NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 1
NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLUMN_TYPE 15 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema COLUMNS EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
@@ -9854,7 +9852,7 @@ NULL information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL u
NULL information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) select
NULL information_schema ROUTINES CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema ROUTINES SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema ROUTINES ROUTINE_COMMENT 19 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema ROUTINES DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
@@ -9924,7 +9922,7 @@ NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL N
NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
NULL information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS ACTION_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) select
NULL information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -9932,8 +9930,8 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS DEFINER 19 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
NULL information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -9941,7 +9939,7 @@ NULL information_schema USER_PRIVILEGES IS_GRANTABLE 4 NO varchar 3 9 NULL NULL
NULL information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema VIEWS VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
@@ -11118,7 +11116,7 @@ SQL_PATH varchar(64) YES NULL
SECURITY_TYPE varchar(7) NO
CREATED datetime NO 0000-00-00 00:00:00
LAST_ALTERED datetime NO 0000-00-00 00:00:00
-SQL_MODE longtext NO
+SQL_MODE longtext NO NULL
ROUTINE_COMMENT varchar(64) NO
DEFINER varchar(77) NO
SHOW CREATE TABLE routines;
@@ -11173,7 +11171,7 @@ NULL information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL u
NULL information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) select
NULL information_schema ROUTINES CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema ROUTINES SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema ROUTINES ROUTINE_COMMENT 19 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema ROUTINES DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
@@ -12024,7 +12022,7 @@ Field Type Null Key Default Extra
TABLE_CATALOG varchar(4096) YES NULL
TABLE_SCHEMA varchar(64) NO
TABLE_NAME varchar(64) NO
-VIEW_DEFINITION longtext NO
+VIEW_DEFINITION longtext NO NULL
CHECK_OPTION varchar(8) NO
IS_UPDATABLE varchar(3) NO
DEFINER varchar(77) NO
@@ -12055,7 +12053,7 @@ TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAUL
NULL information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema VIEWS VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
@@ -12813,7 +12811,7 @@ EVENT_OBJECT_SCHEMA varchar(64) NO
EVENT_OBJECT_TABLE varchar(64) NO
ACTION_ORDER bigint(4) NO 0
ACTION_CONDITION longtext YES NULL
-ACTION_STATEMENT longtext NO
+ACTION_STATEMENT longtext NO NULL
ACTION_ORIENTATION varchar(9) NO
ACTION_TIMING varchar(6) NO
ACTION_REFERENCE_OLD_TABLE varchar(64) YES NULL
@@ -12821,8 +12819,8 @@ ACTION_REFERENCE_NEW_TABLE varchar(64) YES NULL
ACTION_REFERENCE_OLD_ROW varchar(3) NO
ACTION_REFERENCE_NEW_ROW varchar(3) NO
CREATED datetime YES NULL
-SQL_MODE longtext NO
-DEFINER longtext NO
+SQL_MODE longtext NO NULL
+DEFINER longtext NO NULL
SHOW CREATE TABLE triggers;
Table Create Table
TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` (
@@ -12866,7 +12864,7 @@ NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL N
NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
NULL information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS ACTION_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) select
NULL information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -12874,8 +12872,8 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS DEFINER 19 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
Testcase 3.2.18.2 + 3.2.18.3:
--------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/memory__datadict.result b/mysql-test/suite/funcs_1/r/memory__datadict.result
index b2972796d44..22385d98737 100644
--- a/mysql-test/suite/funcs_1/r/memory__datadict.result
+++ b/mysql-test/suite/funcs_1/r/memory__datadict.result
@@ -1784,7 +1784,7 @@ NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 1
NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLUMN_TYPE 15 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema COLUMNS EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
@@ -1825,7 +1825,7 @@ NULL information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL u
NULL information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) select
NULL information_schema ROUTINES CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema ROUTINES SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema ROUTINES ROUTINE_COMMENT 19 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema ROUTINES DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
@@ -1895,7 +1895,7 @@ NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL N
NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
NULL information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS ACTION_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) select
NULL information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -1903,8 +1903,8 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS DEFINER 19 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
NULL information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -1912,7 +1912,7 @@ NULL information_schema USER_PRIVILEGES IS_GRANTABLE 4 NO varchar 3 9 NULL NULL
NULL information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema VIEWS VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
@@ -2438,9 +2438,9 @@ binary binary Binary pseudo charset 1
geostd8 geostd8_general_ci GEOSTD8 Georgian 1
cp932 cp932_japanese_ci SJIS for Windows Japanese 2
eucjpms eucjpms_japanese_ci UJIS for Windows Japanese 3
-select sum(id) from collations;
+select sum(id) from collations where collation_name <> 'utf8_general_cs';
sum(id)
-10995
+10741
select collation_name, character_set_name into @x,@y
from collation_character_set_applicability limit 1;
select @x, @y;
@@ -2843,10 +2843,10 @@ NULL information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 64 192 N
SELECT * FROM character_sets LIMIT 1;
CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN
big5 big5_chinese_ci Big5 Traditional Chinese 2
-SELECT * FROM collations LIMIT 1;
+SELECT * FROM collations where collation_name <> 'utf8_general_cs' LIMIT 1;
COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN
big5_chinese_ci big5 1 Yes Yes 1
-SELECT * FROM collation_character_set_applicability LIMIT 1;
+SELECT * FROM collation_character_set_applicability where collation_name <> 'utf8_general_cs' LIMIT 1;
COLLATION_NAME CHARACTER_SET_NAME
big5_chinese_ci big5
SELECT * FROM routines LIMIT 1;
@@ -4362,12 +4362,12 @@ COUNT(*)
SELECT COUNT(*) FROM information_schema. character_sets ;
COUNT(*)
36
-SELECT COUNT(*) FROM information_schema. collations ;
+SELECT COUNT(*) FROM information_schema. collations where collation_name <> 'utf8_general_cs' ;
COUNT(*)
-127
-SELECT COUNT(*) FROM information_schema. collation_character_set_applicability ;
+126
+SELECT COUNT(*) FROM information_schema. collation_character_set_applicability where collation_name <> 'utf8_general_cs' ;
COUNT(*)
-127
+126
SELECT COUNT(*) FROM information_schema. routines ;
COUNT(*)
1
@@ -6096,7 +6096,7 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges order by grantee, privilege_type;
+from information_schema.user_privileges;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
'root'@'127.0.0.1' NULL ALTER ROUTINE YES
@@ -6241,7 +6241,7 @@ where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
res_t_401013 db_datadict i_6_401013 HASH
select *
-from information_schema.user_privileges order by grantee, privilege_type;
+from information_schema.user_privileges;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
'root'@'127.0.0.1' NULL ALTER ROUTINE YES
@@ -6372,7 +6372,7 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges order by grantee, privilege_type;
+from information_schema.user_privileges;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
'root'@'127.0.0.1' NULL ALTER ROUTINE YES
@@ -6515,7 +6515,7 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges order by grantee, privilege_type;
+from information_schema.user_privileges;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
'root'@'127.0.0.1' NULL ALTER ROUTINE YES
@@ -6654,7 +6654,7 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges order by grantee, privilege_type;
+from information_schema.user_privileges;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
'root'@'127.0.0.1' NULL ALTER ROUTINE YES
@@ -6806,7 +6806,7 @@ where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
res_t_401015 db_datadict i_6_401015 BTREE
select *
-from information_schema.user_privileges order by grantee, privilege_type;
+from information_schema.user_privileges;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
'root'@'127.0.0.1' NULL ALTER ROUTINE YES
@@ -6936,7 +6936,7 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges order by grantee, privilege_type;
+from information_schema.user_privileges;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
'root'@'127.0.0.1' NULL ALTER ROUTINE YES
@@ -7147,7 +7147,8 @@ ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_
FLUSH PRIVILEGES;
connect(localhost,u_6_401017,,test,MYSQL_PORT,MYSQL_SOCK);
use information_schema;
-select * from collation_character_set_applicability;
+select * from collation_character_set_applicability
+where collation_name <> 'utf8_general_cs';
COLLATION_NAME CHARACTER_SET_NAME
big5_chinese_ci big5
big5_bin big5
@@ -7223,7 +7224,6 @@ utf8_roman_ci utf8
utf8_persian_ci utf8
utf8_esperanto_ci utf8
utf8_hungarian_ci utf8
-utf8_general_cs utf8
ucs2_general_ci ucs2
ucs2_bin ucs2
ucs2_unicode_ci ucs2
@@ -7764,7 +7764,7 @@ binary
geostd8
cp932
eucjpms
-select collation_name from collations;
+select collation_name from collations where collation_name <> 'utf8_general_cs';
collation_name
big5_chinese_ci
big5_bin
@@ -7840,7 +7840,6 @@ utf8_roman_ci
utf8_persian_ci
utf8_esperanto_ci
utf8_hungarian_ci
-utf8_general_cs
ucs2_general_ci
ucs2_bin
ucs2_unicode_ci
@@ -8129,7 +8128,7 @@ NULL information_schema COLLATIONS SORTLEN 6 0 NO bigint NULL NULL 19 0 NULL NUL
Testcase 3.2.3.2:
--------------------------------------------------------------------------------
-SELECT * FROM collations;
+SELECT * FROM collations where collation_name <> 'utf8_general_cs';
COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN
big5_chinese_ci big5 1 Yes Yes 1
big5_bin big5 84 Yes 1
@@ -8205,7 +8204,6 @@ utf8_roman_ci utf8 207 Yes 8
utf8_persian_ci utf8 208 Yes 8
utf8_esperanto_ci utf8 209 Yes 8
utf8_hungarian_ci utf8 210 Yes 8
-utf8_general_cs utf8 254 Yes 1
ucs2_general_ci ucs2 35 Yes Yes 1
ucs2_bin ucs2 90 Yes 1
ucs2_unicode_ci ucs2 128 Yes 8
@@ -8291,7 +8289,8 @@ NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME
Testcase 3.2.4.2:
--------------------------------------------------------------------------------
-SELECT * FROM collation_character_set_applicability;
+SELECT * FROM collation_character_set_applicability
+where collation_name <> 'utf8_general_cs';
COLLATION_NAME CHARACTER_SET_NAME
big5_chinese_ci big5
big5_bin big5
@@ -8367,7 +8366,6 @@ utf8_roman_ci utf8
utf8_persian_ci utf8
utf8_esperanto_ci utf8
utf8_hungarian_ci utf8
-utf8_general_cs utf8
ucs2_general_ci ucs2
ucs2_bin ucs2
ucs2_unicode_ci ucs2
@@ -8601,7 +8599,7 @@ NUMERIC_PRECISION bigint(21) YES NULL
NUMERIC_SCALE bigint(21) YES NULL
CHARACTER_SET_NAME varchar(64) YES NULL
COLLATION_NAME varchar(64) YES NULL
-COLUMN_TYPE longtext NO
+COLUMN_TYPE longtext NO NULL
COLUMN_KEY varchar(3) NO
EXTRA varchar(20) NO
PRIVILEGES varchar(80) NO
@@ -8654,7 +8652,7 @@ NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 1
NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLUMN_TYPE 15 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema COLUMNS EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
@@ -8709,7 +8707,7 @@ NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 1
NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLUMN_TYPE 15 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema COLUMNS EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
@@ -8750,7 +8748,7 @@ NULL information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL u
NULL information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) select
NULL information_schema ROUTINES CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema ROUTINES SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema ROUTINES ROUTINE_COMMENT 19 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema ROUTINES DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
@@ -8820,7 +8818,7 @@ NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL N
NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
NULL information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS ACTION_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) select
NULL information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -8828,8 +8826,8 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS DEFINER 19 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
NULL information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -8837,7 +8835,7 @@ NULL information_schema USER_PRIVILEGES IS_GRANTABLE 4 NO varchar 3 9 NULL NULL
NULL information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema VIEWS VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
@@ -9332,7 +9330,7 @@ NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 1
NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLUMN_TYPE 15 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema COLUMNS EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
@@ -9373,7 +9371,7 @@ NULL information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL u
NULL information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) select
NULL information_schema ROUTINES CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema ROUTINES SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema ROUTINES ROUTINE_COMMENT 19 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema ROUTINES DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
@@ -9443,7 +9441,7 @@ NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL N
NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
NULL information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS ACTION_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) select
NULL information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -9451,8 +9449,8 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS DEFINER 19 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
NULL information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -9460,7 +9458,7 @@ NULL information_schema USER_PRIVILEGES IS_GRANTABLE 4 NO varchar 3 9 NULL NULL
NULL information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema VIEWS VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
@@ -9751,7 +9749,7 @@ NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 1
NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLUMN_TYPE 15 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema COLUMNS EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
@@ -9792,7 +9790,7 @@ NULL information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL u
NULL information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) select
NULL information_schema ROUTINES CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema ROUTINES SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema ROUTINES ROUTINE_COMMENT 19 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema ROUTINES DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
@@ -9862,7 +9860,7 @@ NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL N
NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
NULL information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS ACTION_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) select
NULL information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -9870,8 +9868,8 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS DEFINER 19 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
NULL information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -9879,7 +9877,7 @@ NULL information_schema USER_PRIVILEGES IS_GRANTABLE 4 NO varchar 3 9 NULL NULL
NULL information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema VIEWS VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
@@ -11016,7 +11014,7 @@ SQL_PATH varchar(64) YES NULL
SECURITY_TYPE varchar(7) NO
CREATED datetime NO 0000-00-00 00:00:00
LAST_ALTERED datetime NO 0000-00-00 00:00:00
-SQL_MODE longtext NO
+SQL_MODE longtext NO NULL
ROUTINE_COMMENT varchar(64) NO
DEFINER varchar(77) NO
SHOW CREATE TABLE routines;
@@ -11071,7 +11069,7 @@ NULL information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL u
NULL information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) select
NULL information_schema ROUTINES CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema ROUTINES SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema ROUTINES ROUTINE_COMMENT 19 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema ROUTINES DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
@@ -11922,7 +11920,7 @@ Field Type Null Key Default Extra
TABLE_CATALOG varchar(4096) YES NULL
TABLE_SCHEMA varchar(64) NO
TABLE_NAME varchar(64) NO
-VIEW_DEFINITION longtext NO
+VIEW_DEFINITION longtext NO NULL
CHECK_OPTION varchar(8) NO
IS_UPDATABLE varchar(3) NO
DEFINER varchar(77) NO
@@ -11953,7 +11951,7 @@ TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAUL
NULL information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema VIEWS VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
@@ -12711,7 +12709,7 @@ EVENT_OBJECT_SCHEMA varchar(64) NO
EVENT_OBJECT_TABLE varchar(64) NO
ACTION_ORDER bigint(4) NO 0
ACTION_CONDITION longtext YES NULL
-ACTION_STATEMENT longtext NO
+ACTION_STATEMENT longtext NO NULL
ACTION_ORIENTATION varchar(9) NO
ACTION_TIMING varchar(6) NO
ACTION_REFERENCE_OLD_TABLE varchar(64) YES NULL
@@ -12719,8 +12717,8 @@ ACTION_REFERENCE_NEW_TABLE varchar(64) YES NULL
ACTION_REFERENCE_OLD_ROW varchar(3) NO
ACTION_REFERENCE_NEW_ROW varchar(3) NO
CREATED datetime YES NULL
-SQL_MODE longtext NO
-DEFINER longtext NO
+SQL_MODE longtext NO NULL
+DEFINER longtext NO NULL
SHOW CREATE TABLE triggers;
Table Create Table
TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` (
@@ -12764,7 +12762,7 @@ NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL N
NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
NULL information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS ACTION_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) select
NULL information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -12772,8 +12770,8 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS DEFINER 19 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
Testcase 3.2.18.2 + 3.2.18.3:
--------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/myisam__datadict.result b/mysql-test/suite/funcs_1/r/myisam__datadict.result
index 518c7d277de..fd194de46d6 100644
--- a/mysql-test/suite/funcs_1/r/myisam__datadict.result
+++ b/mysql-test/suite/funcs_1/r/myisam__datadict.result
@@ -1814,7 +1814,7 @@ NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 1
NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLUMN_TYPE 15 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema COLUMNS EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
@@ -1855,7 +1855,7 @@ NULL information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL u
NULL information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) select
NULL information_schema ROUTINES CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema ROUTINES SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema ROUTINES ROUTINE_COMMENT 19 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema ROUTINES DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
@@ -1925,7 +1925,7 @@ NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL N
NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
NULL information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS ACTION_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) select
NULL information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -1933,8 +1933,8 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS DEFINER 19 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
NULL information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -1942,7 +1942,7 @@ NULL information_schema USER_PRIVILEGES IS_GRANTABLE 4 NO varchar 3 9 NULL NULL
NULL information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema VIEWS VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
@@ -2508,9 +2508,9 @@ binary binary Binary pseudo charset 1
geostd8 geostd8_general_ci GEOSTD8 Georgian 1
cp932 cp932_japanese_ci SJIS for Windows Japanese 2
eucjpms eucjpms_japanese_ci UJIS for Windows Japanese 3
-select sum(id) from collations;
+select sum(id) from collations where collation_name <> 'utf8_general_cs';
sum(id)
-10995
+10741
select collation_name, character_set_name into @x,@y
from collation_character_set_applicability limit 1;
select @x, @y;
@@ -2913,10 +2913,10 @@ NULL information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 64 192 N
SELECT * FROM character_sets LIMIT 1;
CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN
big5 big5_chinese_ci Big5 Traditional Chinese 2
-SELECT * FROM collations LIMIT 1;
+SELECT * FROM collations where collation_name <> 'utf8_general_cs' LIMIT 1;
COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN
big5_chinese_ci big5 1 Yes Yes 1
-SELECT * FROM collation_character_set_applicability LIMIT 1;
+SELECT * FROM collation_character_set_applicability where collation_name <> 'utf8_general_cs' LIMIT 1;
COLLATION_NAME CHARACTER_SET_NAME
big5_chinese_ci big5
SELECT * FROM routines LIMIT 1;
@@ -4432,12 +4432,12 @@ COUNT(*)
SELECT COUNT(*) FROM information_schema. character_sets ;
COUNT(*)
36
-SELECT COUNT(*) FROM information_schema. collations ;
+SELECT COUNT(*) FROM information_schema. collations where collation_name <> 'utf8_general_cs' ;
COUNT(*)
-127
-SELECT COUNT(*) FROM information_schema. collation_character_set_applicability ;
+126
+SELECT COUNT(*) FROM information_schema. collation_character_set_applicability where collation_name <> 'utf8_general_cs' ;
COUNT(*)
-127
+126
SELECT COUNT(*) FROM information_schema. routines ;
COUNT(*)
1
@@ -6166,7 +6166,7 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges order by grantee, privilege_type;
+from information_schema.user_privileges;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
'root'@'127.0.0.1' NULL ALTER ROUTINE YES
@@ -6311,7 +6311,7 @@ where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
res_t_401013 db_datadict i_6_401013 BTREE
select *
-from information_schema.user_privileges order by grantee, privilege_type;
+from information_schema.user_privileges;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
'root'@'127.0.0.1' NULL ALTER ROUTINE YES
@@ -6442,7 +6442,7 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges order by grantee, privilege_type;
+from information_schema.user_privileges;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
'root'@'127.0.0.1' NULL ALTER ROUTINE YES
@@ -6585,7 +6585,7 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges order by grantee, privilege_type;
+from information_schema.user_privileges;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
'root'@'127.0.0.1' NULL ALTER ROUTINE YES
@@ -6724,7 +6724,7 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges order by grantee, privilege_type;
+from information_schema.user_privileges;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
'root'@'127.0.0.1' NULL ALTER ROUTINE YES
@@ -6876,7 +6876,7 @@ where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
res_t_401015 db_datadict i_6_401015 BTREE
select *
-from information_schema.user_privileges order by grantee, privilege_type;
+from information_schema.user_privileges;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
'root'@'127.0.0.1' NULL ALTER ROUTINE YES
@@ -7006,7 +7006,7 @@ from information_schema.statistics
where table_schema like 'db_datadict%';
table_name index_schema index_name index_type
select *
-from information_schema.user_privileges order by grantee, privilege_type;
+from information_schema.user_privileges;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
'root'@'127.0.0.1' NULL ALTER ROUTINE YES
@@ -7217,7 +7217,8 @@ ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_
FLUSH PRIVILEGES;
connect(localhost,u_6_401017,,test,MYSQL_PORT,MYSQL_SOCK);
use information_schema;
-select * from collation_character_set_applicability;
+select * from collation_character_set_applicability
+where collation_name <> 'utf8_general_cs';
COLLATION_NAME CHARACTER_SET_NAME
big5_chinese_ci big5
big5_bin big5
@@ -7293,7 +7294,6 @@ utf8_roman_ci utf8
utf8_persian_ci utf8
utf8_esperanto_ci utf8
utf8_hungarian_ci utf8
-utf8_general_cs utf8
ucs2_general_ci ucs2
ucs2_bin ucs2
ucs2_unicode_ci ucs2
@@ -7866,7 +7866,7 @@ binary
geostd8
cp932
eucjpms
-select collation_name from collations;
+select collation_name from collations where collation_name <> 'utf8_general_cs';
collation_name
big5_chinese_ci
big5_bin
@@ -7942,7 +7942,6 @@ utf8_roman_ci
utf8_persian_ci
utf8_esperanto_ci
utf8_hungarian_ci
-utf8_general_cs
ucs2_general_ci
ucs2_bin
ucs2_unicode_ci
@@ -8231,7 +8230,7 @@ NULL information_schema COLLATIONS SORTLEN 6 0 NO bigint NULL NULL 19 0 NULL NUL
Testcase 3.2.3.2:
--------------------------------------------------------------------------------
-SELECT * FROM collations;
+SELECT * FROM collations where collation_name <> 'utf8_general_cs';
COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN
big5_chinese_ci big5 1 Yes Yes 1
big5_bin big5 84 Yes 1
@@ -8307,7 +8306,6 @@ utf8_roman_ci utf8 207 Yes 8
utf8_persian_ci utf8 208 Yes 8
utf8_esperanto_ci utf8 209 Yes 8
utf8_hungarian_ci utf8 210 Yes 8
-utf8_general_cs utf8 254 Yes 1
ucs2_general_ci ucs2 35 Yes Yes 1
ucs2_bin ucs2 90 Yes 1
ucs2_unicode_ci ucs2 128 Yes 8
@@ -8393,7 +8391,8 @@ NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME
Testcase 3.2.4.2:
--------------------------------------------------------------------------------
-SELECT * FROM collation_character_set_applicability;
+SELECT * FROM collation_character_set_applicability
+where collation_name <> 'utf8_general_cs';
COLLATION_NAME CHARACTER_SET_NAME
big5_chinese_ci big5
big5_bin big5
@@ -8469,7 +8468,6 @@ utf8_roman_ci utf8
utf8_persian_ci utf8
utf8_esperanto_ci utf8
utf8_hungarian_ci utf8
-utf8_general_cs utf8
ucs2_general_ci ucs2
ucs2_bin ucs2
ucs2_unicode_ci ucs2
@@ -8703,7 +8701,7 @@ NUMERIC_PRECISION bigint(21) YES NULL
NUMERIC_SCALE bigint(21) YES NULL
CHARACTER_SET_NAME varchar(64) YES NULL
COLLATION_NAME varchar(64) YES NULL
-COLUMN_TYPE longtext NO
+COLUMN_TYPE longtext NO NULL
COLUMN_KEY varchar(3) NO
EXTRA varchar(20) NO
PRIVILEGES varchar(80) NO
@@ -8756,7 +8754,7 @@ NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 1
NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLUMN_TYPE 15 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema COLUMNS EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
@@ -8811,7 +8809,7 @@ NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 1
NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLUMN_TYPE 15 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema COLUMNS EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
@@ -8852,7 +8850,7 @@ NULL information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL u
NULL information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) select
NULL information_schema ROUTINES CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema ROUTINES SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema ROUTINES ROUTINE_COMMENT 19 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema ROUTINES DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
@@ -8922,7 +8920,7 @@ NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL N
NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
NULL information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS ACTION_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) select
NULL information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -8930,8 +8928,8 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS DEFINER 19 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
NULL information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -8939,7 +8937,7 @@ NULL information_schema USER_PRIVILEGES IS_GRANTABLE 4 NO varchar 3 9 NULL NULL
NULL information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema VIEWS VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
@@ -9474,7 +9472,7 @@ NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 1
NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLUMN_TYPE 15 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema COLUMNS EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
@@ -9515,7 +9513,7 @@ NULL information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL u
NULL information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) select
NULL information_schema ROUTINES CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema ROUTINES SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema ROUTINES ROUTINE_COMMENT 19 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema ROUTINES DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
@@ -9585,7 +9583,7 @@ NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL N
NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
NULL information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS ACTION_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) select
NULL information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -9593,8 +9591,8 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS DEFINER 19 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
NULL information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -9602,7 +9600,7 @@ NULL information_schema USER_PRIVILEGES IS_GRANTABLE 4 NO varchar 3 9 NULL NULL
NULL information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema VIEWS VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
@@ -9925,7 +9923,7 @@ NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 1
NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLUMN_TYPE 15 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema COLUMNS EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
@@ -9966,7 +9964,7 @@ NULL information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL u
NULL information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) select
NULL information_schema ROUTINES CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema ROUTINES SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema ROUTINES ROUTINE_COMMENT 19 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema ROUTINES DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
@@ -10036,7 +10034,7 @@ NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL N
NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
NULL information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS ACTION_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) select
NULL information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -10044,8 +10042,8 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS DEFINER 19 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
NULL information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -10053,7 +10051,7 @@ NULL information_schema USER_PRIVILEGES IS_GRANTABLE 4 NO varchar 3 9 NULL NULL
NULL information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema VIEWS VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
@@ -11270,7 +11268,7 @@ SQL_PATH varchar(64) YES NULL
SECURITY_TYPE varchar(7) NO
CREATED datetime NO 0000-00-00 00:00:00
LAST_ALTERED datetime NO 0000-00-00 00:00:00
-SQL_MODE longtext NO
+SQL_MODE longtext NO NULL
ROUTINE_COMMENT varchar(64) NO
DEFINER varchar(77) NO
SHOW CREATE TABLE routines;
@@ -11325,7 +11323,7 @@ NULL information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL u
NULL information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) select
NULL information_schema ROUTINES CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema ROUTINES SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema ROUTINES ROUTINE_COMMENT 19 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema ROUTINES DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
@@ -12176,7 +12174,7 @@ Field Type Null Key Default Extra
TABLE_CATALOG varchar(4096) YES NULL
TABLE_SCHEMA varchar(64) NO
TABLE_NAME varchar(64) NO
-VIEW_DEFINITION longtext NO
+VIEW_DEFINITION longtext NO NULL
CHECK_OPTION varchar(8) NO
IS_UPDATABLE varchar(3) NO
DEFINER varchar(77) NO
@@ -12207,7 +12205,7 @@ TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAUL
NULL information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema VIEWS VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
@@ -12965,7 +12963,7 @@ EVENT_OBJECT_SCHEMA varchar(64) NO
EVENT_OBJECT_TABLE varchar(64) NO
ACTION_ORDER bigint(4) NO 0
ACTION_CONDITION longtext YES NULL
-ACTION_STATEMENT longtext NO
+ACTION_STATEMENT longtext NO NULL
ACTION_ORIENTATION varchar(9) NO
ACTION_TIMING varchar(6) NO
ACTION_REFERENCE_OLD_TABLE varchar(64) YES NULL
@@ -12973,8 +12971,8 @@ ACTION_REFERENCE_NEW_TABLE varchar(64) YES NULL
ACTION_REFERENCE_OLD_ROW varchar(3) NO
ACTION_REFERENCE_NEW_ROW varchar(3) NO
CREATED datetime YES NULL
-SQL_MODE longtext NO
-DEFINER longtext NO
+SQL_MODE longtext NO NULL
+DEFINER longtext NO NULL
SHOW CREATE TABLE triggers;
Table Create Table
TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` (
@@ -13018,7 +13016,7 @@ NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL N
NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
NULL information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS ACTION_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) select
NULL information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -13026,8 +13024,8 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema TRIGGERS DEFINER 19 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
Testcase 3.2.18.2 + 3.2.18.3:
--------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_2/r/innodb_charset.result b/mysql-test/suite/funcs_2/r/innodb_charset.result
index 25b720af1da..09076145c44 100644
--- a/mysql-test/suite/funcs_2/r/innodb_charset.result
+++ b/mysql-test/suite/funcs_2/r/innodb_charset.result
@@ -737,7 +737,6 @@ a_ascii a_len
44 1
64 1
45 1
-60 1
65 1
46 1
66 1
@@ -779,17 +778,18 @@ a_ascii a_len
78 1
59 1
79 1
-7E 1
5A 1
7A 1
-5D 1
5B 1
5C 1
+5D 1
5E 1
5F 1
+60 1
7B 1
7C 1
7D 1
+7E 1
7F 1
80 1
81 1
diff --git a/mysql-test/suite/funcs_2/r/memory_charset.result b/mysql-test/suite/funcs_2/r/memory_charset.result
index 073b057d733..8536ac4a9b2 100644
--- a/mysql-test/suite/funcs_2/r/memory_charset.result
+++ b/mysql-test/suite/funcs_2/r/memory_charset.result
@@ -737,7 +737,6 @@ a_ascii a_len
44 1
64 1
45 1
-60 1
65 1
46 1
66 1
@@ -779,17 +778,18 @@ a_ascii a_len
78 1
59 1
79 1
-7E 1
5A 1
7A 1
-5D 1
5B 1
5C 1
+5D 1
5E 1
5F 1
+60 1
7B 1
7C 1
7D 1
+7E 1
7F 1
80 1
81 1
diff --git a/mysql-test/suite/funcs_2/r/myisam_charset.result b/mysql-test/suite/funcs_2/r/myisam_charset.result
index 50ed8aca2cc..698cce1be37 100644
--- a/mysql-test/suite/funcs_2/r/myisam_charset.result
+++ b/mysql-test/suite/funcs_2/r/myisam_charset.result
@@ -737,7 +737,6 @@ a_ascii a_len
44 1
64 1
45 1
-60 1
65 1
46 1
66 1
@@ -779,17 +778,18 @@ a_ascii a_len
78 1
59 1
79 1
-7E 1
5A 1
7A 1
-5D 1
5B 1
5C 1
+5D 1
5E 1
5F 1
+60 1
7B 1
7C 1
7D 1
+7E 1
7F 1
80 1
81 1
diff --git a/mysql-test/suite/funcs_2/r/ndb_charset.result b/mysql-test/suite/funcs_2/r/ndb_charset.result
index 7a5c63f71d6..0a4dba2e302 100644
--- a/mysql-test/suite/funcs_2/r/ndb_charset.result
+++ b/mysql-test/suite/funcs_2/r/ndb_charset.result
@@ -737,7 +737,6 @@ a_ascii a_len
44 1
64 1
45 1
-60 1
65 1
46 1
66 1
@@ -779,17 +778,18 @@ a_ascii a_len
78 1
59 1
79 1
-7E 1
5A 1
7A 1
-5D 1
5B 1
5C 1
+5D 1
5E 1
5F 1
+60 1
7B 1
7C 1
7D 1
+7E 1
7F 1
80 1
81 1
diff --git a/mysql-test/suite/manual/r/rpl_replication_delay.result b/mysql-test/suite/manual/r/rpl_replication_delay.result
new file mode 100644
index 00000000000..22447a30cba
--- /dev/null
+++ b/mysql-test/suite/manual/r/rpl_replication_delay.result
@@ -0,0 +1,121 @@
+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;
+show slave status /* Second_behind reports 0 */;;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port 9306
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos 98
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running Yes
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 0
+Last_Error
+Skip_Counter 0
+Exec_Master_Log_Pos 98
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master 0
+drop table if exists t1;
+Warnings:
+Note 1051 Unknown table 't1'
+create table t1 (f1 int);
+flush logs /* contaminate rli->last_master_timestamp */;
+lock table t1 write;
+insert into t1 values (1);
+show slave status /* bug emulated: reports slave threads starting time about 3*3 not 3 secs */;;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port 9306
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos 359
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running Yes
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 0
+Last_Error
+Skip_Counter 0
+Exec_Master_Log_Pos 271
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master 10
+unlock tables;
+flush logs /* this time rli->last_master_timestamp is not affected */;
+lock table t1 write;
+insert into t1 values (2);
+show slave status /* reports the correct diff with master query time about 3+3 secs */;;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port 9306
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos 447
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running Yes
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 0
+Last_Error
+Skip_Counter 0
+Exec_Master_Log_Pos 359
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master 6
+unlock tables;
+drop table t1;
diff --git a/mysql-test/suite/manual/t/rpl_replication_delay-slave.opt b/mysql-test/suite/manual/t/rpl_replication_delay-slave.opt
new file mode 100644
index 00000000000..24a4c5952fe
--- /dev/null
+++ b/mysql-test/suite/manual/t/rpl_replication_delay-slave.opt
@@ -0,0 +1 @@
+--loose-debug=d,let_first_flush_log_change_timestamp
diff --git a/mysql-test/suite/manual/t/rpl_replication_delay.test b/mysql-test/suite/manual/t/rpl_replication_delay.test
new file mode 100644
index 00000000000..8230698c8f9
--- /dev/null
+++ b/mysql-test/suite/manual/t/rpl_replication_delay.test
@@ -0,0 +1,71 @@
+#
+# Testing replication delay reporting (bug#29309)
+# there is an unavoidable non-determinism in the test
+# please compare the results with the comments
+#
+
+
+source include/master-slave.inc;
+
+connection master;
+#connection slave;
+sync_slave_with_master;
+--replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT
+--replace_column 1 # 8 # 9 # 23 #
+--query_vertical show slave status /* Second_behind reports 0 */;
+sleep 3;
+
+### bug emulation
+
+connection master;
+drop table if exists t1;
+create table t1 (f1 int);
+sleep 3;
+
+#connection slave;
+sync_slave_with_master;
+flush logs /* contaminate rli->last_master_timestamp */;
+
+connection slave;
+lock table t1 write;
+
+connection master;
+insert into t1 values (1);
+
+sleep 3;
+
+connection slave;
+--replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT
+--replace_column 1 # 8 # 9 # 23 #
+--query_vertical show slave status /* bug emulated: reports slave threads starting time about 3*3 not 3 secs */;
+unlock tables;
+
+connection master;
+sync_slave_with_master;
+
+### bugfix
+
+
+connection slave;
+flush logs /* this time rli->last_master_timestamp is not affected */;
+lock table t1 write;
+
+connection master;
+insert into t1 values (2);
+sleep 3;
+
+connection slave;
+--replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT
+--replace_column 1 # 8 # 9 # 23 #
+--query_vertical show slave status /* reports the correct diff with master query time about 3+3 secs */;
+unlock tables;
+
+connection master;
+drop table t1;
+
+#connection slave;
+sync_slave_with_master;
+
+
+# End of tests
+
diff --git a/mysql-test/t/almost_full.test b/mysql-test/t/almost_full.test
new file mode 100644
index 00000000000..5c67ab3c088
--- /dev/null
+++ b/mysql-test/t/almost_full.test
@@ -0,0 +1,41 @@
+#
+# Some special cases with empty tables
+#
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+set global myisam_data_pointer_size=2;
+CREATE TABLE t1 (a int auto_increment primary key not null, b longtext) ENGINE=MyISAM;
+
+--disable_query_log
+let $1= 303;
+while ($1)
+{
+ INSERT INTO t1 SET b=repeat('a',200);
+ dec $1;
+}
+--enable_query_log
+
+DELETE FROM t1 WHERE a=1 or a=5;
+
+--error 1114
+INSERT INTO t1 SET b=repeat('a',600);
+CHECK TABLE t1 EXTENDED;
+
+--error 1114
+UPDATE t1 SET b=repeat('a', 800) where a=10;
+CHECK TABLE t1 EXTENDED;
+
+INSERT INTO t1 SET b=repeat('a',400);
+CHECK TABLE t1 EXTENDED;
+
+DELETE FROM t1 WHERE a=2 or a=6;
+UPDATE t1 SET b=repeat('a', 600) where a=11;
+CHECK TABLE t1 EXTENDED;
+drop table t1;
+
+set global myisam_data_pointer_size=default;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/analyze.test b/mysql-test/t/analyze.test
index 7c9830bb468..0903db1eca4 100644
--- a/mysql-test/t/analyze.test
+++ b/mysql-test/t/analyze.test
@@ -72,4 +72,16 @@ analyze table t1;
show index from t1;
drop table t1;
-# End of 4.1 tests
+--echo End of 4.1 tests
+
+#
+# Bug #30495: optimize table t1,t2,t3 extended errors
+#
+create table t1(a int);
+--error 1064
+analyze table t1 extended;
+--error 1064
+optimize table t1 extended;
+drop table t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test
index 61033fca3f7..14a124a96bc 100644
--- a/mysql-test/t/archive.test
+++ b/mysql-test/t/archive.test
@@ -1317,7 +1317,7 @@ SELECT * FROM t2;
INSERT INTO t2 VALUES (2,011401,37,'breaking','dreaded','Steinberg','W');
INSERT INTO t2 VALUES (3,011402,37,'Romans','scholastics','jarring','');
INSERT INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily','');
-OPTIMIZE TABLE t2 EXTENDED;
+OPTIMIZE TABLE t2;
SELECT * FROM t2;
REPAIR TABLE t2;
SELECT * FROM t2;
@@ -1347,8 +1347,16 @@ SELECT * FROM t2;
# Test INSERT DELAYED and wait until the table has one more record
SELECT COUNT(auto) FROM t2;
-INSERT DELAYED INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily','');
-while (`SELECT COUNT(auto)!=1214 FROM t2`)
+INSERT DELAYED INTO t2 VALUES (99999,011403,37,'the','delayed','insert','');
+
+# Insert another record since in Archive delayed values are only
+# guaranteed to materialize based on either:
+# 1) A new row showing up from a normal insert
+# 2) A flush table has occurred.
+INSERT INTO t2 VALUES (100000,000001,00,'after','delayed','insert','');
+
+# Wait for the delayed insert to appear
+while (`SELECT COUNT(auto)!=1215 FROM t2`)
{
sleep 0.1;
}
@@ -1357,7 +1365,7 @@ SELECT COUNT(auto) FROM t2;
# Adding test for alter table
ALTER TABLE t2 DROP COLUMN fld6;
SHOW CREATE TABLE t2;
-SELECT * from t2;
+SELECT * from t2 WHERE auto != 100000;
#
# Cleanup, test is over
#
diff --git a/mysql-test/t/bdb_gis.test b/mysql-test/t/bdb_gis.test
index 88dcbb7cbe9..cb6d0683874 100644
--- a/mysql-test/t/bdb_gis.test
+++ b/mysql-test/t/bdb_gis.test
@@ -1,3 +1,4 @@
-- source include/have_bdb.inc
SET storage_engine=bdb;
--source include/gis_generic.inc
+--source include/gis_keys.inc
diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test
index 002dfad9981..f96350686af 100644
--- a/mysql-test/t/bigint.test
+++ b/mysql-test/t/bigint.test
@@ -113,6 +113,15 @@ t2.value64=t1.value64;
drop table t1, t2;
+# Test for BUG#30069, can't handle bigint -9223372036854775808 on
+# x86_64, with some GCC versions and optimizations.
+
+create table t1 (sint64 bigint not null);
+insert into t1 values (-9223372036854775808);
+select * from t1;
+
+drop table t1;
+
# End of 4.1 tests
#
diff --git a/mysql-test/t/binlog_killed.test b/mysql-test/t/binlog_killed.test
index 034895f17cb..af78adf0abc 100644
--- a/mysql-test/t/binlog_killed.test
+++ b/mysql-test/t/binlog_killed.test
@@ -55,194 +55,162 @@ enable_result_log;
select @result /* must be zero either way */;
-# the functions are either *insensitive* to killing or killing can cause
-# strange problmes with the error propagation out of SF's stack
-# Bug#27563, Bug#27565, BUG#24971
-#
-# TODO: use if's block as regression test for the bugs or remove
-#
-if (0)
-{
-delimiter |;
-create function bug27563()
-RETURNS int(11)
-DETERMINISTIC
-begin
- select get_lock("a", 10) into @a;
- return 1;
-end|
-delimiter ;|
-
-# the function is sensitive to killing requiring innodb though with wrong client error
-# TO FIX in BUG#27565; TODO: remove --error 1105 afterwards
-delimiter |;
-create function bug27565()
-RETURNS int(11)
-DETERMINISTIC
-begin
- select a from t1 where a=1 into @a for update;
- return 1;
-end|
-delimiter ;|
-
-reset master;
+--remove_file $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog
+connection con1;
+select RELEASE_LOCK("a");
-### ta table case: killing causes rollback
+#
+# bug#27571 asynchronous setting mysql_`query`::error and Query_log_e::error_code
+#
-# A. autocommit ON
-connection con1;
-select get_lock("a", 20);
+# checking that killing inside of select loops is safe as before
+# killing after the loop can be only simulated - another test
-connection con2;
-let $ID= `select connection_id()`;
-send insert into t1 values (bug27563(),1);
+delete from t1;
+delete from t2;
+insert into t1 values (1,1),(2,2);
+#
+# simple update
+#
connection con1;
-eval kill query $ID;
+begin; update t1 set b=11 where a=2;
connection con2;
-# todo (re-record test): after bugs 27563,27565 got fixed affected rows will report zero
---enable_info
-# todo: remove 0 return after fixing Bug#27563
---error 0,ER_QUERY_INTERRUPTED
-reap; ### pb: wrong error
---disable_info
-###--replace_column 2 # 5 #
-### show binlog events from 98 /* nothing in binlog unless Bug#27563 */;
-show master status /* must be only FD event unless Bug#27563 */;
-select count(*) from t1 /* must be zero unless Bug#27563 */;
-
-# M. multi-statement-ta
-connection con2;
let $ID= `select connection_id()`;
begin;
-send insert into t1 values (bug27563(),1);
+send update t1 set b=b+10;
connection con1;
+--replace_result $ID ID
eval kill query $ID;
+rollback;
+
+# Bug #32148 killi query may be ineffective
+# forced to comment out the test's outcome
+# and mask out ineffective ER_QUERY_INTERRUPTED
+# todo1: revert back upon fixing bug#32148
+# todo2: the tests need refining in that
+# killing should wait till the victim requested
+# its lock (wait_condition available in 5.1 tests)
+
connection con2;
-# todo (re-record test): after bugs 27563,27565 got fixed affected rows will report zero
---enable_info
-# todo: remove 0 return after fixing Bug#27563
--error 0,ER_QUERY_INTERRUPTED
reap;
---disable_info
-select count(*) from t1 /* must be zero unless Bug#27563 */;
-commit;
+rollback;
+select * from t1 order by a /* must be the same as before (1,1),(2,2) */;
+#
+# multi update
+# commented out as Bug #31807 multi-update,delete killing does not report with ER_QUERY_INTERRUPTED
+# in the way
+#
+# connection con1;
+# begin; update t1 set b=b+10;
-### non-ta table case: killing must be recorded in binlog
+# connection con2;
+# send update t1 as t_1,t1 as t_2 set t_1.b=11 where t_2.a=2;
-reset master;
+# connection con1;
+# --replace_result $ID ID
+# eval kill query $ID;
+# rollback;
+
+# disable_abort_on_error;
+
+# connection con2;
+# --error HY000,ER_QUERY_INTERRUPTED
+# reap;
+# select * from t1 /* must be the same as before (1,1),(2,2) */;
+
+# enable_abort_on_error;
+#
+# simple delete
+#
+connection con1;
+begin; delete from t1 where a=2;
connection con2;
let $ID= `select connection_id()`;
-send insert into t2 values (bug27563(),1);
+begin;
+send delete from t1 where a=2;
connection con1;
+--replace_result $ID ID
eval kill query $ID;
+rollback;
connection con2;
-# todo: remove 0 return after fixing Bug#27563
--error 0,ER_QUERY_INTERRUPTED
reap;
-select count(*) from t2 /* must be one */;
-#show binlog events from 98 /* must have the insert on non-ta table */;
-show master status /* must have the insert event more to FD */;
-# the value of the error flag of KILLED_QUERY is tested further
-
-connection con1;
-select RELEASE_LOCK("a");
-
-### test with effective killing of SF()
-
-delete from t1;
-delete from t2;
-insert into t1 values (1,1);
-insert into t2 values (1,1);
+rollback;
+# todo1,2 above
+select * from t1 order by a /* must be the same as before (1,1),(2,2) */;
-#
-# Bug#27565
-# test where KILL is propagated as error to the top level
-# still another bug with the error message to the user
-# todo: fix reexecute the result file after fixing
-#
-begin; update t1 set b=0 where a=1;
-connection con2;
-let $ID= `select connection_id()`;
-send update t2 set b=bug27565()-1 where a=1;
+#
+# multi delete
+# the same as for multi-update
+#
+# connection con1;
+# begin; delete from t1 where a=2;
-connection con1;
-eval kill query $ID;
-commit;
+# connection con2;
+# send delete t1 from t1 where t1.a=2;
-connection con2;
-# todo: fix Bug #27565 killed query of SF() is not reported correctly and
-# remove 1105 (wrong)
-#--error ER_QUERY_INTERRUPTED
---error 1105,ER_QUERY_INTERRUPTED
-reap; ### pb: wrong error
-select * from t1 /* must be: (1,0) */;
-select * from t2 /* must be as before: (1,1) */;
+# connection con1;
+# --replace_result $ID ID
+# eval kill query $ID;
+# rollback;
-## bug#22725 with effective and propagating killing
+# connection con2;
+# --error 0,ER_QUERY_INTERRUPTED
+# reap;
+# select * from t1 /* must be the same as before (1,1),(2,2) */;
+#
+# insert select
#
-# top-level ta-table
connection con1;
-delete from t3;
-reset master;
-begin; update t1 set b=0 where a=1;
+--disable_warnings
+drop table if exists t4;
+--enable_warnings
+create table t4 (a int, b int) engine=innodb;
+insert into t4 values (3, 3);
+begin; insert into t1 values (3, 3);
connection con2;
let $ID= `select connection_id()`;
-# the query won't perform completely since the function gets interrupted
-send insert into t3 values (0,0),(1,bug27565());
+begin;
+send insert into t1 select * from t4 for update;
connection con1;
+--replace_result $ID ID
eval kill query $ID;
rollback;
connection con2;
-# todo: fix Bug #27565 killed query of SF() is not reported correctly and
-# remove 1105 (wrong)
-#--error ER_QUERY_INTERRUPTED
---error 1105,ER_QUERY_INTERRUPTED
-reap; ### pb: wrong error
-select count(*) from t3 /* must be zero */;
-show master status /* nothing in binlog */;
-
-# top-level non-ta-table
-connection con1;
-delete from t2;
-reset master;
-begin; update t1 set b=0 where a=1;
-
-connection con2;
-let $ID= `select connection_id()`;
-# the query won't perform completely since the function gets intrurrupted
-send insert into t2 values (0,0),(1,bug27565()) /* non-ta t2 */;
-
-connection con1;
-eval kill query $ID;
+--error 0,ER_QUERY_INTERRUPTED
+reap;
+# todo 1,2 above
rollback;
+select * from t1 /* must be the same as before (1,1),(2,2) */;
-connection con2;
-# todo: fix Bug #27565 killed query of SF() is not reported correctly and
-# remove 1105 (wrong)
-#--error ER_QUERY_INTERRUPTED
---error 1105,ER_QUERY_INTERRUPTED
-reap; ### pb: wrong error
+drop table t4; # cleanup for the sub-case
+
+###
+## non-ta table case: killing must be recorded in binlog
+###
-select count(*) from t2 /* count must be one */;
-show master status /* insert into non-ta must be in binlog */;
+# In order to be deterministic the test needs INFORMATION_SCHEMA.PROCESSLIST
+# which is not available on 5.0 at this time.
+# Therefore, skip this part on 5.0.
-drop function bug27563;
-drop function bug27565;
-}
-system rm $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog ;
+#
+# common cleanup
+#
drop table t1,t2,t3;
+--echo end of the tests
diff --git a/mysql-test/t/binlog_killed_simulate-master.opt b/mysql-test/t/binlog_killed_simulate-master.opt
new file mode 100644
index 00000000000..90c70ecee29
--- /dev/null
+++ b/mysql-test/t/binlog_killed_simulate-master.opt
@@ -0,0 +1 @@
+--loose-debug=d,simulate_kill_bug27571
diff --git a/mysql-test/t/binlog_killed_simulate.test b/mysql-test/t/binlog_killed_simulate.test
new file mode 100644
index 00000000000..670cd756803
--- /dev/null
+++ b/mysql-test/t/binlog_killed_simulate.test
@@ -0,0 +1,66 @@
+-- source include/have_debug.inc
+#
+# bug#27571 asynchronous setting mysql_$query()'s local error and
+# Query_log_event::error_code
+#
+
+--disable_warnings
+drop table if exists t1,t2;
+--enable_warnings
+
+#
+# Checking that killing upon successful row-loop does not affect binlogging
+#
+
+create table t1 (a int) engine=MyISAM;
+insert into t1 set a=1;
+reset master;
+
+update t1 set a=2 /* will be "killed" after work has been done */;
+
+# a proof the query is binlogged with no error
+
+--exec $MYSQL_BINLOG --start-position=98 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval select
+(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
+is not null;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+let $error_code= `select @a like "%#%error_code=0%" /* must return 1 */`;
+eval select $error_code /* must return 1 as query completed before got killed*/;
+
+# cleanup for the sub-case
+system rm $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog;
+
+
+#
+# Checking that killing inside of row-loop for LOAD DATA into
+# non-transactional table affects binlogging
+#
+
+create table t2 (a int, b int) ENGINE=MyISAM;
+reset master;
+--error ER_QUERY_INTERRUPTED
+load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */;
+
+
+# a proof the query is binlogged with an error
+
+source include/show_binlog_events.inc;
+
+--exec $MYSQL_BINLOG --start-position=98 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval select
+(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
+is not null;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+let $error_code= `select @a like "%#%error_code=0%" /* must return 0*/`;
+eval select $error_code /* must return 0 to mean the killed query is in */;
+
+# cleanup for the sub-case
+system rm $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog;
+
+
+drop table t1,t2;
+
+--echo end of the tests
diff --git a/mysql-test/t/case.test b/mysql-test/t/case.test
index 0e9e141f6d8..b6654df4ecb 100644
--- a/mysql-test/t/case.test
+++ b/mysql-test/t/case.test
@@ -3,7 +3,7 @@
#
--disable_warnings
-drop table if exists t1;
+drop table if exists t1, t2;
--enable_warnings
select CASE "b" when "a" then 1 when "b" then 2 END;
@@ -152,4 +152,21 @@ SELECT IFNULL(t2.EMPNUM,t1.EMPNUM) AS CEMPNUM,
FROM t1 LEFT JOIN t2 ON t1.EMPNUM=t2.EMPNUM;
DROP TABLE t1,t2;
-# End of 4.1 tests
+
+--echo End of 4.1 tests
+
+#
+# #30782: Truncated UNSIGNED BIGINT columns
+#
+create table t1 (a int, b bigint unsigned);
+create table t2 (c int);
+insert into t1 (a, b) values (1,4572794622775114594), (2,18196094287899841997),
+ (3,11120436154190595086);
+insert into t2 (c) values (1), (2), (3);
+select t1.a, (case t1.a when 0 then 0 else t1.b end) d from t1
+ join t2 on t1.a=t2.c order by d;
+select t1.a, (case t1.a when 0 then 0 else t1.b end) d from t1
+ join t2 on t1.a=t2.c where b=11120436154190595086 order by d;
+drop table t1, t2;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test
index 316b79efe4d..df475b49746 100644
--- a/mysql-test/t/cast.test
+++ b/mysql-test/t/cast.test
@@ -246,4 +246,26 @@ INSERT INTO t1(d1) VALUES ('2007-07-19 08:30:00'), (NULL),
SELECT cast(date(d1) as signed) FROM t1;
drop table t1;
+#
+# Bug #31990: MINUTE() and SECOND() return bogus results when used on a DATE
+#
+
+# Show that HH:MM:SS of a DATE are 0, and that it's the same for columns
+# and typecasts (NULL in, NULL out).
+CREATE TABLE t1 (f1 DATE);
+INSERT INTO t1 VALUES ('2007-07-19'), (NULL);
+SELECT HOUR(f1),
+ MINUTE(f1),
+ SECOND(f1) FROM t1;
+SELECT HOUR(CAST('2007-07-19' AS DATE)),
+ MINUTE(CAST('2007-07-19' AS DATE)),
+ SECOND(CAST('2007-07-19' AS DATE));
+SELECT HOUR(CAST(NULL AS DATE)),
+ MINUTE(CAST(NULL AS DATE)),
+ SECOND(CAST(NULL AS DATE));
+SELECT HOUR(NULL),
+ MINUTE(NULL),
+ SECOND(NULL);
+DROP TABLE t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test
index b724b4ce47c..db5cb92c3e6 100644
--- a/mysql-test/t/csv.test
+++ b/mysql-test/t/csv.test
@@ -1427,4 +1427,37 @@ insert into t1 values (0xFF,'LATIN SMALL LETTER Y WITH DIAERESIS');
select hex(c), c, name from t1 order by 1;
drop table t1;
+#
+# Bug #31473: does not work with NULL value in datetime field
+# This bug is a 5.1 but is here to prevent 5.0 regression.
+#
+create table t1(a datetime) engine=csv;
+insert into t1 values();
+select * from t1;
+drop table t1;
+create table t1(a set('foo','bar')) engine=csv;
+insert into t1 values();
+select * from t1;
+drop table t1;
+create table t1(a varchar(32)) engine=csv;
+insert into t1 values();
+select * from t1;
+drop table t1;
+create table t1(a int) engine=csv;
+insert into t1 values();
+select * from t1;
+drop table t1;
+create table t1(a blob) engine=csv;
+insert into t1 values();
+select * from t1;
+drop table t1;
+create table t1(a bit(1)) engine=csv;
+insert into t1 values();
+select BIN(a) from t1;
+drop table t1;
+create table t1(a enum('foo','bar') default 'foo') engine=csv;
+insert into t1 values();
+select * from t1;
+drop table t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/ctype_euckr.test b/mysql-test/t/ctype_euckr.test
index 56939817b2f..05e4b04eded 100644
--- a/mysql-test/t/ctype_euckr.test
+++ b/mysql-test/t/ctype_euckr.test
@@ -31,3 +31,26 @@ SELECT hex(a) FROM t1 ORDER BY a;
DROP TABLE t1;
# End of 4.1 tests
+
+#
+#Bug #30315 Character sets: insertion of euckr code value 0xa141 fails
+#
+create table t1 (s1 varchar(5) character set euckr);
+# Insert some valid characters
+insert into t1 values (0xA141);
+insert into t1 values (0xA15A);
+insert into t1 values (0xA161);
+insert into t1 values (0xA17A);
+insert into t1 values (0xA181);
+insert into t1 values (0xA1FE);
+# Insert some invalid characters
+insert into t1 values (0xA140);
+insert into t1 values (0xA15B);
+insert into t1 values (0xA160);
+insert into t1 values (0xA17B);
+insert into t1 values (0xA180);
+insert into t1 values (0xA1FF);
+select hex(s1), hex(convert(s1 using utf8)) from t1 order by binary s1;
+drop table t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test
index 17632e7c8fc..0d917428efb 100644
--- a/mysql-test/t/ctype_uca.test
+++ b/mysql-test/t/ctype_uca.test
@@ -530,7 +530,7 @@ create table t1 (
a varchar(255),
key a(a)
) character set utf8 collate utf8_czech_ci;
--- In Czech 'ch' is a single letter between 'h' and 'i'
+# In Czech 'ch' is a single letter between 'h' and 'i'
insert into t1 values
('b'),('c'),('d'),('e'),('f'),('g'),('h'),('ch'),('i'),('j');
select * from t1 where a like 'c%';
@@ -538,4 +538,8 @@ alter table t1 convert to character set ucs2 collate ucs2_czech_ci;
select * from t1 where a like 'c%';
drop table t1;
+set collation_connection=ucs2_unicode_ci;
+--source include/ctype_regex.inc
+set names utf8;
+
-- echo End for 5.0 tests
diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test
index bca3a9c3a96..3af5bfa54f9 100644
--- a/mysql-test/t/ctype_ucs.test
+++ b/mysql-test/t/ctype_ucs.test
@@ -547,6 +547,26 @@ select quote(name) from bug20536;
drop table bug20536;
+#
+# Bug #31615: crash after set names ucs2 collate xxx
+#
+--error 1231
+set names ucs2;
+--error 1231
+set names ucs2 collate ucs2_bin;
+--error 1231
+set character_set_client= ucs2;
+--error 1231
+set character_set_client= concat('ucs', substr('2', 1));
+
+#
+# BUG#31159 - fulltext search on ucs2 column crashes server
+#
+CREATE TABLE t1(a TEXT CHARSET ucs2 COLLATE ucs2_unicode_ci);
+INSERT INTO t1 VALUES('abcd');
+SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abcd' IN BOOLEAN MODE);
+DROP TABLE t1;
+
--echo End of 4.1 tests
#
@@ -651,4 +671,12 @@ select * from t1 where a=if(b<10,_ucs2 0x00C0,_ucs2 0x0062);
select * from t1 where a=if(b<10,_ucs2 0x0062,_ucs2 0x00C0);
drop table t1;
+set collation_connection=ucs2_general_ci;
+--source include/ctype_regex.inc
+set names latin1;
+#
+# Bug#30981 CHAR(0x41 USING ucs2) doesn't add leading zero
+#
+select hex(char(0x41 using ucs2));
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index f8eed0bae9a..d184200ad5a 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -186,6 +186,13 @@ select * from t1 where a = 'b' and a != 'b';
drop table t1;
#
+# Testing regexp
+#
+set collation_connection=utf8_general_ci;
+--source include/ctype_regex.inc
+set names utf8;
+
+#
# Bug #3928 regexp [[:>:]] and UTF-8
#
set names utf8;
@@ -1403,3 +1410,30 @@ SELECT b FROM t2 UNION SELECT c FROM t1;
SELECT i FROM t2 UNION SELECT c FROM t1;
DROP TABLE t1, t2;
+
+#
+# Bug#30982: CHAR(..USING..) can return a not-well-formed string
+# Bug #30986: Character set introducer followed by a HEX string can return bad result
+#
+set sql_mode=traditional;
+select hex(char(0xFF using utf8));
+select hex(convert(0xFF using utf8));
+--error ER_INVALID_CHARACTER_STRING
+select hex(_utf8 0x616263FF);
+--error ER_INVALID_CHARACTER_STRING
+select hex(_utf8 X'616263FF');
+--error ER_INVALID_CHARACTER_STRING
+select hex(_utf8 B'001111111111');
+--error ER_INVALID_CHARACTER_STRING
+select (_utf8 X'616263FF');
+set sql_mode=default;
+select hex(char(0xFF using utf8));
+select hex(convert(0xFF using utf8));
+--error ER_INVALID_CHARACTER_STRING
+select hex(_utf8 0x616263FF);
+--error ER_INVALID_CHARACTER_STRING
+select hex(_utf8 X'616263FF');
+--error ER_INVALID_CHARACTER_STRING
+select hex(_utf8 B'001111111111');
+--error ER_INVALID_CHARACTER_STRING
+select (_utf8 X'616263FF');
diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test
index 13615c8c269..b09472d3485 100644
--- a/mysql-test/t/delayed.test
+++ b/mysql-test/t/delayed.test
@@ -103,13 +103,13 @@ DROP TABLE t1;
# Bug#20627 - INSERT DELAYED does not honour auto_increment_* variables
#
SET @bug20627_old_auto_increment_offset=
- @@auto_increment_offset= 2;
+ @@auto_increment_offset;
SET @bug20627_old_auto_increment_increment=
- @@auto_increment_increment= 3;
+ @@auto_increment_increment;
SET @bug20627_old_session_auto_increment_offset=
- @@session.auto_increment_offset= 4;
+ @@session.auto_increment_offset;
SET @bug20627_old_session_auto_increment_increment=
- @@session.auto_increment_increment= 5;
+ @@session.auto_increment_increment;
SET @@auto_increment_offset= 2;
SET @@auto_increment_increment= 3;
SET @@session.auto_increment_offset= 4;
@@ -151,13 +151,13 @@ SET @@session.auto_increment_increment=
# Bug#20830 - INSERT DELAYED does not honour SET INSERT_ID
#
SET @bug20830_old_auto_increment_offset=
- @@auto_increment_offset= 2;
+ @@auto_increment_offset;
SET @bug20830_old_auto_increment_increment=
- @@auto_increment_increment= 3;
+ @@auto_increment_increment;
SET @bug20830_old_session_auto_increment_offset=
- @@session.auto_increment_offset= 4;
+ @@session.auto_increment_offset;
SET @bug20830_old_session_auto_increment_increment=
- @@session.auto_increment_increment= 5;
+ @@session.auto_increment_increment;
SET @@auto_increment_offset= 2;
SET @@auto_increment_increment= 3;
SET @@session.auto_increment_offset= 4;
diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test
index 8a03cb6c715..602e30687c8 100644
--- a/mysql-test/t/delete.test
+++ b/mysql-test/t/delete.test
@@ -277,3 +277,18 @@ SELECT * FROM t1;
DROP TABLE t1, t2;
DROP DATABASE db1;
DROP DATABASE db2;
+
+#
+# Bug 31742: delete from ... order by function call that causes an error,
+# asserts server
+#
+
+CREATE FUNCTION f1() RETURNS INT RETURN 1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (0);
+--error 1318
+DELETE FROM t1 ORDER BY (f1(10)) LIMIT 1;
+DROP TABLE t1;
+DROP FUNCTION f1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 9d6a9b57e9a..297b6e70f39 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -16,3 +16,9 @@ im_daemon_life_cycle : Bug#20294: Instance manager tests fail randomly
im_options_set : Bug#20294: Instance manager tests fail randomly
im_options_unset : Bug#20294: Instance manager tests fail randomly
im_utils : Bug#20294: Instance manager tests fail randomly
+grant_cache : Bug#32651: grant_cache.test fails
+rpl_log : Bug#32653: rpl_log.test fails randomly
+rpl_view : Bug#32654: rpl_view.test fails randomly
+ndb_backup_print : Bug#32357: ndb_backup_print test fails sometimes in pushbuild
+rpl_log_pos : Bug#8693 Test 'rpl_log_pos' fails sometimes
+kill : Bug#29149 Test "kill" fails on Windows
diff --git a/mysql-test/t/flush.test b/mysql-test/t/flush.test
index 3a4f2f2f5f2..72efa8a2ee6 100644
--- a/mysql-test/t/flush.test
+++ b/mysql-test/t/flush.test
@@ -133,4 +133,35 @@ disconnect con3;
connection default;
drop table t1, t2;
+#
+# Bug#32528 Global read lock with a low priority write lock causes a server crash
+#
+
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+
+set session low_priority_updates=1;
+
+create table t1 (a int);
+create table t2 (b int);
+
+lock tables t1 write;
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
+flush tables with read lock;
+unlock tables;
+
+lock tables t1 read, t2 write;
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
+flush tables with read lock;
+unlock tables;
+
+lock tables t1 read;
+flush tables with read lock;
+unlock tables;
+
+drop table t1, t2;
+
+set session low_priority_updates=default;
+
# End of 5.0 tests
diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test
index 44375562307..e5f1db14b7f 100644
--- a/mysql-test/t/fulltext.test
+++ b/mysql-test/t/fulltext.test
@@ -387,4 +387,12 @@ ALTER TABLE t1 DISABLE KEYS;
SELECT * FROM t1 WHERE MATCH(a) AGAINST('test');
DROP TABLE t1;
+#
+# BUG#11392 - fulltext search bug
+#
+CREATE TABLE t1(a TEXT);
+INSERT INTO t1 VALUES(' aaaaa aaaa');
+SELECT * FROM t1 WHERE MATCH(a) AGAINST ('"aaaa"' IN BOOLEAN MODE);
+DROP TABLE t1;
+
# End of 4.1 tests
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index ff3ba951870..df8199a5bc7 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -562,4 +562,41 @@ insert into t1 (id, name) values (2, "óra");
select b.id, group_concat(b.name) from t1 a, t1 b group by b.id;
drop table t1;
+#
+# Bug #31154: group_concat() and bit fields;
+#
+create table t1(a bit not null);
+insert into t1 values (), (), ();
+select group_concat(distinct a) from t1;
+select group_concat(distinct a order by a) from t1;
+drop table t1;
+
+create table t1(a bit(2) not null);
+insert into t1 values (1), (0), (0), (3), (1);
+select group_concat(distinct a) from t1;
+select group_concat(distinct a order by a) from t1;
+select group_concat(distinct a order by a desc) from t1;
+drop table t1;
+
+create table t1(a bit(2), b varchar(10), c bit);
+insert into t1 values (1, 'a', 0), (0, 'b', 1), (0, 'c', 0), (3, 'd', 1),
+(1, 'e', 1), (3, 'f', 1), (0, 'g', 1);
+select group_concat(distinct a, c) from t1;
+select group_concat(distinct a, c order by a) from t1;
+select group_concat(distinct a, c) from t1;
+select group_concat(distinct a, c order by a, c) from t1;
+select group_concat(distinct a, c order by a desc, c desc) from t1;
+
+drop table t1;
+
+
+#
+# Bug#30897 GROUP_CONCAT returns extra comma on empty fields
+#
+create table t1 (f1 char(20));
+insert into t1 values (''),('');
+select group_concat(distinct f1) from t1;
+select group_concat(f1) from t1;
+drop table t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index 2293ac71454..25cb13a2f75 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -860,5 +860,46 @@ SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1 and b > 1;
DROP TABLE t1, t2, t3, t4, t5;
+#
+# Bug #31156: mysqld: item_sum.cc:918:
+# virtual bool Item_sum_distinct::setup(THD*): Assertion
+#
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 values (),(),();
+SELECT (SELECT SLEEP(0) FROM t1 ORDER BY AVG(DISTINCT a) ) as x FROM t1
+ GROUP BY x;
+SELECT 1 FROM t1 GROUP BY (SELECT SLEEP(0) FROM t1 ORDER BY AVG(DISTINCT a) );
+
+DROP TABLE t1;
+
+#
+# Bug #30715: Assertion failed: item_field->field->real_maybe_null(), file
+# .\opt_sum.cc, line
+#
+
+CREATE TABLE t1 (a int, b date NOT NULL, KEY k1 (a,b));
+SELECT MIN(b) FROM t1 WHERE a=1 AND b>'2007-08-01';
+DROP TABLE t1;
+
+#
+# Bug #31794: no syntax error on SELECT id FROM t HAVING count(*)>2;
+#
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+
+SET SQL_MODE=ONLY_FULL_GROUP_BY;
+--error ER_MIX_OF_GROUP_FUNC_AND_FIELDS
+SELECT a FROM t1 HAVING COUNT(*)>2;
+--error ER_MIX_OF_GROUP_FUNC_AND_FIELDS
+SELECT COUNT(*), a FROM t1;
+
+SET SQL_MODE=DEFAULT;
+SELECT a FROM t1 HAVING COUNT(*)>2;
+SELECT COUNT(*), a FROM t1;
+
+DROP TABLE t1;
+
###
--echo End of 5.0 tests
diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test
index 2ba07dfc581..9f12fdd696e 100644
--- a/mysql-test/t/func_math.test
+++ b/mysql-test/t/func_math.test
@@ -205,4 +205,29 @@ select mod(cast(-2 as unsigned), 3), mod(18446744073709551614, 3), mod(-2, 3);
select mod(5, cast(-2 as unsigned)), mod(5, 18446744073709551614), mod(5, -2);
select pow(cast(-2 as unsigned), 5), pow(18446744073709551614, 5), pow(-2, 5);
+#
+# Bug #30587: mysql crashes when trying to group by TIME div NUMBER
+#
+
+CREATE TABLE t1 (a timestamp, b varchar(20), c bit(1));
+INSERT INTO t1 VALUES('1998-09-23', 'str1', 1), ('2003-03-25', 'str2', 0);
+SELECT a DIV 900 y FROM t1 GROUP BY y;
+SELECT DISTINCT a DIV 900 y FROM t1;
+SELECT b DIV 900 y FROM t1 GROUP BY y;
+SELECT c DIV 900 y FROM t1 GROUP BY y;
+DROP TABLE t1;
+
+CREATE TABLE t1(a LONGBLOB);
+INSERT INTO t1 VALUES('1'),('2'),('3');
+SELECT DISTINCT (a DIV 254576881) FROM t1;
+SELECT (a DIV 254576881) FROM t1 UNION ALL
+ SELECT (a DIV 254576881) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1(a SET('a','b','c'));
+INSERT INTO t1 VALUES ('a');
+SELECT a DIV 2 FROM t1 UNION SELECT a DIV 2 FROM t1;
+DROP TABLE t1;
+
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index 8ff62f68e45..c8b8f8f2a69 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -189,4 +189,28 @@ drop table table_26093;
drop function func_26093_a;
drop function func_26093_b;
+#
+# Bug #30832: Assertion + crash with select name_const('test',now());
+#
+--error ER_WRONG_ARGUMENTS
+SELECT NAME_CONST('test', NOW());
+--error ER_WRONG_ARGUMENTS
+SELECT NAME_CONST('test', UPPER('test'));
+
+SELECT NAME_CONST('test', NULL);
+SELECT NAME_CONST('test', 1);
+SELECT NAME_CONST('test', -1);
+SELECT NAME_CONST('test', 1.0);
+SELECT NAME_CONST('test', -1.0);
+SELECT NAME_CONST('test', 'test');
+
+#
+# Bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key'
+#
+create table t1 (a int not null);
+insert into t1 values (-1), (-2);
+select min(a) from t1 group by inet_ntoa(a);
+drop table t1;
+
--echo End of 5.0 tests
+
diff --git a/mysql-test/t/func_regexp.test b/mysql-test/t/func_regexp.test
index 23070c71fe9..1b35fab9d54 100644
--- a/mysql-test/t/func_regexp.test
+++ b/mysql-test/t/func_regexp.test
@@ -6,28 +6,9 @@
drop table if exists t1;
--enable_warnings
-create table t1 (s1 char(64),s2 char(64));
+set names latin1;
+--source include/ctype_regex.inc
-insert into t1 values('aaa','aaa');
-insert into t1 values('aaa|qqq','qqq');
-insert into t1 values('gheis','^[^a-dXYZ]+$');
-insert into t1 values('aab','^aa?b');
-insert into t1 values('Baaan','^Ba*n');
-insert into t1 values('aaa','qqq|aaa');
-insert into t1 values('qqq','qqq|aaa');
-
-insert into t1 values('bbb','qqq|aaa');
-insert into t1 values('bbb','qqq');
-insert into t1 values('aaa','aba');
-
-insert into t1 values(null,'abc');
-insert into t1 values('def',null);
-insert into t1 values(null,null);
-insert into t1 values('ghi','ghi[');
-
-select HIGH_PRIORITY s1 regexp s2 from t1;
-
-drop table t1;
#
# This test a bug in regexp on Alpha
@@ -74,4 +55,13 @@ execute stmt1 using @a;
deallocate prepare stmt1;
drop table t1;
-# End of 4.1 tests
+--echo End of 4.1 tests
+
+
+#
+# Bug #31440: 'select 1 regex null' asserts debug server
+#
+
+SELECT 1 REGEXP NULL;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test
index bb65cbaa774..5db6db70e8f 100644
--- a/mysql-test/t/func_sapdb.test
+++ b/mysql-test/t/func_sapdb.test
@@ -47,6 +47,7 @@ select makedate(1997,1);
select makedate(1997,0);
select makedate(9999,365);
select makedate(9999,366);
+select makedate(100,1);
#Time functions
diff --git a/mysql-test/t/func_set.test b/mysql-test/t/func_set.test
index 710b9b90a05..e4fde6e0e0e 100644
--- a/mysql-test/t/func_set.test
+++ b/mysql-test/t/func_set.test
@@ -54,4 +54,21 @@ select find_in_set(binary 'a', 'A,B,C');
#
select find_in_set('1','3,1,');
-# End of 4.1 tests
+--echo End of 4.1 tests
+
+#
+# Bug #32560: crash with interval function and count(*)
+#
+SELECT INTERVAL(0.0, NULL);
+SELECT INTERVAL(0.0, CAST(NULL AS DECIMAL));
+SELECT INTERVAL(0.0, CAST(DATE(NULL) AS DECIMAL));
+SELECT INTERVAL(0.0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+SELECT INTERVAL(0.0, CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL),
+ CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL),
+ CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL));
+SELECT INTERVAL(0.0, CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL),
+ CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL),
+ CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL),
+ CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL));
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 1a32580aa0f..1ca2bbfaf4c 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -738,6 +738,19 @@ explain extended select encode(f1,'zxcv') as 'enc' from t1;
explain extended select decode(f1,'zxcv') as 'enc' from t1;
drop table t1;
+#
+# Bug #31758 inet_ntoa, oct, crashes server with null + filesort
+#
+create table t1 (a bigint not null)engine=myisam;
+insert into t1 set a = 1024*1024*1024*4;
+delete from t1 order by (inet_ntoa(a)) desc limit 10;
+drop table t1;
+create table t1 (a char(36) not null)engine=myisam;
+insert ignore into t1 set a = ' ';
+insert ignore into t1 set a = ' ';
+select * from t1 order by (oct(a));
+drop table t1;
+
--echo End of 4.1 tests
#
@@ -1124,4 +1137,16 @@ SELECT SUBSTR(a,1,len) FROM t1;
DROP TABLE t1;
+#
+# Bug #28850: Potential bugs related to the return type of the CHAR function
+#
+
+CREATE TABLE t1 AS SELECT CHAR(0x414243) as c1;
+SELECT HEX(c1) from t1;
+DROP TABLE t1;
+
+CREATE VIEW v1 AS SELECT CHAR(0x414243) as c1;
+SELECT HEX(c1) from v1;
+DROP VIEW v1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 86c848983fa..c0a449ac3f4 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -545,6 +545,16 @@ DROP TABLE testBug8868;
SET NAMES DEFAULT;
+#
+# Bug #31160: MAKETIME() crashes server when returning NULL in ORDER BY using
+# filesort
+#
+CREATE TABLE t1 (
+ a TIMESTAMP
+);
+INSERT INTO t1 VALUES (now()), (now());
+SELECT 1 FROM t1 ORDER BY MAKETIME(1, 1, a);
+DROP TABLE t1;
#
# Bug #19844 time_format in Union truncates values
diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test
index 74b12caca41..e68e5039adf 100644
--- a/mysql-test/t/gis-rtree.test
+++ b/mysql-test/t/gis-rtree.test
@@ -797,6 +797,42 @@ UPDATE t1 set spatial_point=GeomFromText('POINT(41 46)') where c1 like 'f%';
CHECK TABLE t1 EXTENDED;
DROP TABLE t1;
+#
+# Bug #30286 spatial index cause corruption and server crash!
+#
+
+create table t1 (a geometry not null, spatial index(a));
+insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 131072)));
+insert into t1 values (PointFromWKB(POINT(9.1248812352444e+192, 2.9740338169556e+284)));
+insert into t1 values (PointFromWKB(POINT(4.7783097267365e-299, -0)));
+insert into t1 values (PointFromWKB(POINT(1.49166814624e-154, 2.0880974297595e-53)));
+insert into t1 values (PointFromWKB(POINT(4.0917382598702e+149, 1.2024538023802e+111)));
+insert into t1 values (PointFromWKB(POINT(2.0349165139404e+236, 2.9993936277913e-241)));
+insert into t1 values (PointFromWKB(POINT(2.5243548967072e-29, 1.2024538023802e+111)));
+insert into t1 values (PointFromWKB(POINT(0, 6.9835074892995e-251)));
+insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 3.1050361846014e+231)));
+insert into t1 values (PointFromWKB(POINT(2.8728483499323e-188, 2.4600631144627e+260)));
+insert into t1 values (PointFromWKB(POINT(3.0517578125e-05, 2.0349165139404e+236)));
+insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 1.1818212630766e-125)));
+insert into t1 values (PointFromWKB(POINT(2.481040258324e-265, 5.7766220027675e-275)));
+insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 2.5243548967072e-29)));
+insert into t1 values (PointFromWKB(POINT(5.7766220027675e-275, 9.9464647281957e+86)));
+insert into t1 values (PointFromWKB(POINT(2.2181357552967e+130, 3.7857669957337e-270)));
+insert into t1 values (PointFromWKB(POINT(4.5767114681874e-246, 3.6893488147419e+19)));
+insert into t1 values (PointFromWKB(POINT(4.5767114681874e-246, 3.7537584144024e+255)));
+insert into t1 values (PointFromWKB(POINT(3.7857669957337e-270, 1.8033161362863e-130)));
+insert into t1 values (PointFromWKB(POINT(0, 5.8774717541114e-39)));
+insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 2.2761049594727e-159)));
+insert into t1 values (PointFromWKB(POINT(6.243497100632e+144, 3.7857669957337e-270)));
+insert into t1 values (PointFromWKB(POINT(3.7857669957337e-270, 2.6355494858076e-82)));
+insert into t1 values (PointFromWKB(POINT(2.0349165139404e+236, 3.8518598887745e-34)));
+insert into t1 values (PointFromWKB(POINT(4.6566128730774e-10, 2.0880974297595e-53)));
+insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 1.8827498946116e-183)));
+insert into t1 values (PointFromWKB(POINT(1.8033161362863e-130, 9.1248812352444e+192)));
+insert into t1 values (PointFromWKB(POINT(4.7783097267365e-299, 2.2761049594727e-159)));
+insert into t1 values (PointFromWKB(POINT(1.94906280228e+289, 1.2338789709327e-178)));
+drop table t1;
+
# End of 4.1 tests
#
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index 79743a0b8f4..b7da7db1d76 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -431,6 +431,14 @@ INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1;
DROP TABLE t1;
+#
+# Bug #30955 geomfromtext() crasher
+#
+CREATE TABLE `t1` ( `col9` set('a'), `col89` date);
+INSERT INTO `t1` VALUES ('','0000-00-00');
+select geomfromtext(col9,col89) as a from t1;
+DROP TABLE t1;
+
--echo End of 4.1 tests
#
@@ -590,4 +598,6 @@ SELECT AsText(GeometryFromText(CONCAT(
--enable_query_log
SELECT 1;
+-- source include/gis_keys.inc
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index 32eb262fd51..ed95d90c8f8 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -1122,6 +1122,7 @@ DROP DATABASE mysqltest1;
DROP DATABASE mysqltest2;
DROP USER mysqltest_1@localhost;
+DROP USER mysqltest_2@localhost;
#
# Bug#27878: Unchecked privileges on a view referring to a table from another
@@ -1144,6 +1145,10 @@ UPDATE v1 SET f2 = 4;
SELECT * FROM test.t1;
disconnect user1;
connection default;
+REVOKE UPDATE (f1) ON `test`.`t1` FROM 'mysqltest_1'@'localhost';
+REVOKE SELECT ON `test`.* FROM 'mysqltest_1'@'localhost';
+REVOKE ALL ON db27878.* FROM 'mysqltest_1'@'localhost';
+DROP USER mysqltest_1@localhost;
DROP DATABASE db27878;
use test;
DROP TABLE t1;
diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test
index a3a8e2d5d53..e2d92ee58d4 100644
--- a/mysql-test/t/grant2.test
+++ b/mysql-test/t/grant2.test
@@ -585,5 +585,37 @@ drop user mysqltest_1@localhost;
drop user mysqltest_2@localhost;
+#
+# Bug #30468: column level privileges not respected when joining tables
+#
+CREATE DATABASE db1;
+
+USE db1;
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (1,1),(2,2);
+
+CREATE TABLE t2 (b INT, c INT);
+INSERT INTO t2 VALUES (1,100),(2,200);
+
+GRANT SELECT ON t1 TO mysqltest1@localhost;
+GRANT SELECT (b) ON t2 TO mysqltest1@localhost;
+
+connect (conn1,localhost,mysqltest1,,);
+connection conn1;
+USE db1;
+--error ER_COLUMNACCESS_DENIED_ERROR
+SELECT c FROM t2;
+--error ER_COLUMNACCESS_DENIED_ERROR
+SELECT * FROM t2;
+--error ER_COLUMNACCESS_DENIED_ERROR
+SELECT * FROM t1 JOIN t2 USING (b);
+
+connection default;
+disconnect conn1;
+DROP TABLE db1.t1, db1.t2;
+DROP USER mysqltest1@localhost;
+DROP DATABASE db1;
+
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/grant3.test b/mysql-test/t/grant3.test
index 115586e807d..fac577ef0ff 100644
--- a/mysql-test/t/grant3.test
+++ b/mysql-test/t/grant3.test
@@ -34,3 +34,103 @@ delete from mysql.db where user like 'mysqltest\_%';
delete from mysql.tables_priv where user like 'mysqltest\_%';
delete from mysql.columns_priv where user like 'mysqltest\_%';
flush privileges;
+
+#
+# Bug: #19828 Case sensitivity in Grant/Revoke
+#
+
+grant select on test.* to CUser@localhost;
+grant select on test.* to CUser@LOCALHOST;
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2;
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST';
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2;
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost';
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2;
+
+DROP USER CUser@localhost;
+DROP USER CUser@LOCALHOST;
+
+#### table grants
+create table t1 (a int);
+grant select on test.t1 to CUser@localhost;
+grant select on test.t1 to CUser@LOCALHOST;
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST';
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost';
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
+
+DROP USER CUser@localhost;
+DROP USER CUser@LOCALHOST;
+
+### column grants
+
+grant select(a) on test.t1 to CUser@localhost;
+grant select(a) on test.t1 to CUser@LOCALHOST;
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST';
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost';
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
+
+DROP USER CUser@localhost;
+DROP USER CUser@LOCALHOST;
+
+drop table t1;
+
+# revoke on a specific DB only
+
+grant select on test.* to CUser2@localhost;
+grant select on test.* to CUser2@LOCALHOST;
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2;
+SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2;
+
+REVOKE SELECT ON test.* FROM 'CUser2'@'LOCALHOST';
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2;
+SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2;
+
+REVOKE SELECT ON test.* FROM 'CUser2'@'localhost';
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2;
+SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2;
+
+DROP USER CUser2@localhost;
+DROP USER CUser2@LOCALHOST;
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index b7c28cada46..b150db6dafe 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -815,3 +815,38 @@ EXPLAIN SELECT c,b FROM t1 GROUP BY c,b;
SELECT c,b FROM t1 GROUP BY c,b;
DROP TABLE t1;
+
+#
+# Bug #32202: ORDER BY not working with GROUP BY
+#
+
+CREATE TABLE t1(
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ c1 INT NOT NULL,
+ c2 INT NOT NULL,
+ UNIQUE KEY (c2,c1));
+
+INSERT INTO t1(c1,c2) VALUES (5,1), (4,1), (3,5), (2,3), (1,3);
+
+# Show that the test cases from the bug report pass
+SELECT * FROM t1 ORDER BY c1;
+SELECT * FROM t1 GROUP BY id ORDER BY c1;
+
+# Show that DESC is handled correctly
+SELECT * FROM t1 GROUP BY id ORDER BY id DESC;
+
+# Show that results are correctly ordered when ORDER BY fields
+# are a subset of GROUP BY ones
+SELECT * FROM t1 GROUP BY c2 ,c1, id ORDER BY c2, c1;
+SELECT * FROM t1 GROUP BY c2, c1, id ORDER BY c2 DESC, c1;
+SELECT * FROM t1 GROUP BY c2, c1, id ORDER BY c2 DESC, c1 DESC;
+
+# Show that results are correctly ordered when GROUP BY fields
+# are a subset of ORDER BY ones
+SELECT * FROM t1 GROUP BY c2 ORDER BY c2, c1;
+SELECT * FROM t1 GROUP BY c2 ORDER BY c2 DESC, c1;
+SELECT * FROM t1 GROUP BY c2 ORDER BY c2 DESC, c1 DESC;
+
+DROP TABLE t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/heap_btree.test b/mysql-test/t/heap_btree.test
index d5a4fb7a734..76c319c0bc1 100644
--- a/mysql-test/t/heap_btree.test
+++ b/mysql-test/t/heap_btree.test
@@ -213,6 +213,15 @@ CREATE TABLE t1 (
INSERT INTO t1 VALUES('1'), ('2');
DROP TABLE t1;
+#
+# BUG#30590 - delete from memory table with composite btree primary key
+#
+CREATE TABLE t1 (a INT, KEY USING BTREE(a)) ENGINE=MEMORY;
+INSERT INTO t1 VALUES(1),(2),(2);
+DELETE FROM t1 WHERE a=2;
+SELECT * FROM t1;
+DROP TABLE t1;
+
--echo End of 4.1 tests
#
@@ -235,5 +244,14 @@ CREATE TABLE t1 (a INT, UNIQUE USING BTREE(a)) ENGINE=MEMORY;
INSERT INTO t1 VALUES(NULL),(NULL);
DROP TABLE t1;
+#
+# Bug #30885: MEMORY returns incorrect data if BTREE index is used for NULL lookup
+#
+create table t1(a varchar(255), b varchar(255),
+ key using btree (a,b)) engine=memory;
+insert into t1 values (1, 1), (3, 3), (2, 2), (NULL, 1), (NULL, NULL), (0, 0);
+select * from t1 where a is null;
+drop table t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index cb12f88555f..b0ebc340e6e 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -1093,4 +1093,33 @@ select column_default from information_schema.columns where table_name= 't1';
show columns from t1;
drop table t1;
+#
+# Bug#31633 Information schema = NULL queries crash the server
+#
+select * from information_schema.columns where table_schema = NULL;
+select * from `information_schema`.`COLUMNS` where `TABLE_NAME` = NULL;
+select * from `information_schema`.`KEY_COLUMN_USAGE` where `TABLE_SCHEMA` = NULL;
+select * from `information_schema`.`KEY_COLUMN_USAGE` where `TABLE_NAME` = NULL;
+select * from information_schema.schemata where schema_name = NULL;
+select * from `information_schema`.`STATISTICS` where `TABLE_SCHEMA` = NULL;
+select * from `information_schema`.`STATISTICS` where `TABLE_NAME` = NULL;
+select * from information_schema.tables where table_schema = NULL;
+select * from information_schema.tables where table_catalog = NULL;
+select * from information_schema.tables where table_name = NULL;
+select * from `information_schema`.`TABLE_CONSTRAINTS` where `TABLE_SCHEMA` = NULL;
+select * from `information_schema`.`TABLE_CONSTRAINTS` where `TABLE_NAME` = NULL;
+select * from `information_schema`.`TRIGGERS` where `EVENT_OBJECT_SCHEMA` = NULL;
+select * from `information_schema`.`TRIGGERS` where `EVENT_OBJECT_TABLE` = NULL;
+select * from `information_schema`.`VIEWS` where `TABLE_SCHEMA` = NULL;
+select * from `information_schema`.`VIEWS` where `TABLE_NAME` = NULL;
+
--echo End of 5.0 tests.
+
+#
+# Bug#30079 A check for "hidden" I_S tables is flawed
+#
+--error 1109
+show fields from information_schema.table_names;
+--error 1109
+show keys from information_schema.table_names;
+
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index 04dfa1d0836..d045bad39f7 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -793,6 +793,38 @@ show master status /* there must be no UPDATE query event */;
drop table t1, t2;
#
+# Bug #29136 erred multi-delete on trans table does not rollback
+#
+
+# prepare
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+CREATE TABLE t1 (a int, PRIMARY KEY (a));
+CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
+create trigger trg_del_t2 after delete on t2 for each row
+ insert into t1 values (1);
+insert into t1 values (1);
+insert into t2 values (1),(2);
+
+
+# exec cases A, B - see multi_update.test
+
+# A. send_error() w/o send_eof() branch
+
+--error ER_DUP_ENTRY
+delete t2 from t2;
+
+# check
+
+select count(*) from t2 /* must be 2 as restored after rollback caused by the error */;
+
+# cleanup bug#29136
+
+drop table t1, t2;
+
+
+#
# Testing of IFNULL
#
create table t1 (a int, b int) engine=innodb;
diff --git a/mysql-test/t/innodb_gis.test b/mysql-test/t/innodb_gis.test
index 142b526af92..024d17c5363 100644
--- a/mysql-test/t/innodb_gis.test
+++ b/mysql-test/t/innodb_gis.test
@@ -1,3 +1,4 @@
--source include/have_innodb.inc
SET storage_engine=innodb;
--source include/gis_generic.inc
+--source include/gis_keys.inc
diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test
index f64efd600c5..13aa6afd701 100644
--- a/mysql-test/t/innodb_mysql.test
+++ b/mysql-test/t/innodb_mysql.test
@@ -960,4 +960,13 @@ SELECT * FROM t1 ORDER BY b DESC, a ASC;
DROP TABLE t1;
+#
+# Bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0
+#
+create table t1(a char(10) not null, unique key aa(a(1)),
+ b char(4) not null, unique key bb(b(4))) engine=innodb;
+desc t1;
+show create table t1;
+drop table t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test
index 76177403bd0..0b5a12fa523 100644
--- a/mysql-test/t/insert.test
+++ b/mysql-test/t/insert.test
@@ -353,5 +353,106 @@ SELECT * FROM t2;
DROP TABLE t1, t2;
+#
+# Bug #26788: mysqld (debug) aborts when inserting specific numbers into char
+# fields
+#
+
+CREATE TABLE t1 (
+ a char(20) NOT NULL,
+ b char(7) DEFAULT NULL,
+ c char(4) DEFAULT NULL
+);
+
+INSERT INTO t1(a,b,c) VALUES (9.999999e+0, 9.999999e+0, 9.999e+0);
+INSERT INTO t1(a,b,c) VALUES (1.225e-05, 1.225e-05, 1.225e-05);
+INSERT INTO t1(a,b) VALUES (1.225e-04, 1.225e-04);
+INSERT INTO t1(a,b) VALUES (1.225e-01, 1.225e-01);
+INSERT INTO t1(a,b) VALUES (1.225877e-01, 1.225877e-01);
+INSERT INTO t1(a,b) VALUES (1.225e+01, 1.225e+01);
+INSERT INTO t1(a,b,c) VALUES (1.225e+01, 1.225e+01, 1.225e+01);
+INSERT INTO t1(a,b) VALUES (1.225e+05, 1.225e+05);
+INSERT INTO t1(a,b) VALUES (1.225e+10, 1.225e+10);
+INSERT INTO t1(a,b) VALUES (1.225e+15, 1.225e+15);
+INSERT INTO t1(a,b) VALUES (5000000e+0, 5000000e+0);
+INSERT INTO t1(a,b) VALUES (1.25e+78, 1.25e+78);
+INSERT INTO t1(a,b) VALUES (1.25e-94, 1.25e-94);
+INSERT INTO t1(a,b) VALUES (1.25e+203, 1.25e+203);
+INSERT INTO t1(a,b) VALUES (1.25e-175, 1.25e-175);
+INSERT INTO t1(a,c) VALUES (1.225e+0, 1.225e+0);
+INSERT INTO t1(a,c) VALUES (1.37e+0, 1.37e+0);
+INSERT INTO t1(a,c) VALUES (-1.37e+0, -1.37e+0);
+INSERT INTO t1(a,c) VALUES (1.87e-3, 1.87e-3);
+INSERT INTO t1(a,c) VALUES (-1.87e-2, -1.87e-2);
+INSERT INTO t1(a,c) VALUES (5000e+0, 5000e+0);
+INSERT INTO t1(a,c) VALUES (-5000e+0, -5000e+0);
+# Expected results are "12.2" and "1.2e+78", but Windows returns "12.3" and
+# "1.3e+78" due to different rounding rules
+--replace_result 12.3 12.2 1.3e+78 1.2e+78
+SELECT * FROM t1;
+
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ a char(20) NOT NULL,
+ b char(7) DEFAULT NULL,
+ c char(5)
+);
+
+
+INSERT INTO t1(a,b,c) VALUES (9.999999e+0, 9.999999e+0, 9.999e+0);
+INSERT INTO t1(a,b,c) VALUES (1.225e-05, 1.225e-05, 1.225e-05);
+INSERT INTO t1(a,b) VALUES (1.225e-04, 1.225e-04);
+INSERT INTO t1(a,b) VALUES (1.225e-01, 1.225e-01);
+INSERT INTO t1(a,b) VALUES (1.225877e-01, 1.225877e-01);
+INSERT INTO t1(a,b) VALUES (1.225e+01, 1.225e+01);
+INSERT INTO t1(a,b,c) VALUES (1.225e+01, 1.225e+01, 1.225e+01);
+INSERT INTO t1(a,b) VALUES (1.225e+05, 1.225e+05);
+INSERT INTO t1(a,b) VALUES (1.225e+10, 1.225e+10);
+INSERT INTO t1(a,b) VALUES (1.225e+15, 1.225e+15);
+INSERT INTO t1(a,b) VALUES (5000000e+0, 5000000e+0);
+INSERT INTO t1(a,b) VALUES (1.25e+78, 1.25e+78);
+INSERT INTO t1(a,b) VALUES (1.25e-94, 1.25e-94);
+INSERT INTO t1(a,b) VALUES (1.25e+203, 1.25e+203);
+INSERT INTO t1(a,b) VALUES (1.25e-175, 1.25e-175);
+INSERT INTO t1(a,c) VALUES (1.225e+0, 1.225e+0);
+INSERT INTO t1(a,c) VALUES (1.37e+0, 1.37e+0);
+INSERT INTO t1(a,c) VALUES (-1.37e+0, -1.37e+0);
+INSERT INTO t1(a,c) VALUES (1.87e-3, 1.87e-3);
+INSERT INTO t1(a,c) VALUES (-1.87e-2, -1.87e-2);
+INSERT INTO t1(a,c) VALUES (5000e+0, 5000e+0);
+INSERT INTO t1(a,c) VALUES (-5000e+0, -5000e+0);
+
+# Expected results are "12.2" and "1.2e+78", but Windows returns "12.3" and
+# "1.3e+78" due to different rounding rules
+--replace_result 12.3 12.2 1.3e+78 1.2e+78
+SELECT * FROM t1;
+
+DROP TABLE t1;
+
+#
+# Bug #31152: assertion in Field_str::store(double)
+#
+
+CREATE TABLE t (a CHAR(10),b INT);
+INSERT INTO t VALUES (),(),();
+INSERT INTO t(a) SELECT rand() FROM t;
+DROP TABLE t;
+
+#
+# Bug #30453: String not cast to int correctly
+#
+
+CREATE TABLE t1 (c1 INT NOT NULL);
+INSERT INTO t1 VALUES(4188.32999999999992724042385816574096679687500),
+('4188.32999999999992724042385816574096679687500'), (4188);
+SELECT * FROM t1;
+
+CREATE TABLE t2 (c1 BIGINT);
+INSERT INTO t2 VALUES('15449237462.0000000000');
+SELECT * FROM t2;
+
+DROP TABLE t1, t2;
+
--echo End of 5.0 tests.
diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test
index fcd07a21821..78a903e0d18 100644
--- a/mysql-test/t/insert_select.test
+++ b/mysql-test/t/insert_select.test
@@ -385,3 +385,15 @@ INSERT INTO t1 (prev_id) SELECT id
SELECT * FROM t1;
DROP TABLE t1,t2;
+
+--echo #
+--echo # Bug#30384: Having SQL_BUFFER_RESULT option in the
+--echo # CREATE .. KEY(..) .. SELECT led to creating corrupted index.
+--echo #
+create table t1(f1 int);
+insert into t1 values(1),(2),(3);
+create table t2 (key(f1)) engine=myisam select sql_buffer_result f1 from t1;
+check table t2 extended;
+drop table t1,t2;
+--echo ##################################################################
+
diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test
index 3d0e68dc0f3..f63336a9864 100644
--- a/mysql-test/t/key.test
+++ b/mysql-test/t/key.test
@@ -443,4 +443,22 @@ ALTER TABLE t1 DISABLE KEYS;
EXPLAIN SELECT MAX(a) FROM t1 FORCE INDEX(a);
DROP TABLE t1;
+#
+# Bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0
+#
+create table t1(a int not null, key aa(a),
+ b char(10) not null, unique key bb(b(1)),
+ c char(4) not null, unique key cc(c));
+desc t1;
+show create table t1;
+drop table t1;
+create table t1(a int not null, key aa(a),
+ b char(10) not null, unique key bb(b(1)),
+ c char(4) not null);
+desc t1;
+alter table t1 add unique key cc(c);
+desc t1;
+show create table t1;
+drop table t1;
+
--echo End of 5.0 tests.
diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test
index d670bb55a18..649c1a4efbd 100644
--- a/mysql-test/t/lock_multi.test
+++ b/mysql-test/t/lock_multi.test
@@ -249,4 +249,36 @@ reap;
connection locker;
drop table t1;
+#
+# Bug#31479 Bad lock interaction if CREATE TABLE LIKE is killed
+#
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int);
+--echo connection: locker
+connection locker;
+lock tables t1 read;
+--echo connection: writer
+connection writer;
+let $ID= `select connection_id()`;
+--send create table t2 like t1;
+--echo connection: default
+connection default;
+let $show_type= open tables where in_use=2 and name_locked=1;
+let $show_pattern= '%t1%2%1';
+--source include/wait_show_pattern.inc
+--echo kill query
+disable_query_log;
+eval kill query $ID;
+enable_query_log;
+connection writer;
+--error ER_QUERY_INTERRUPTED
+--reap
+connection locker;
+unlock tables;
+connection default;
+drop table t1;
+
# End of 5.0 tests
diff --git a/mysql-test/t/lowercase_view.test b/mysql-test/t/lowercase_view.test
index e9cc26bec18..d6612b3e6b9 100644
--- a/mysql-test/t/lowercase_view.test
+++ b/mysql-test/t/lowercase_view.test
@@ -138,3 +138,26 @@ create view v1Aa as select AaA.col1 from t1Aa as AaA;
show create view v1AA;
drop view v1AA;
drop table t1Aa;
+
+
+#
+# Bug #31562: HAVING and lower case
+#
+
+CREATE TABLE t1 (a int, b int);
+
+select X.a from t1 AS X group by X.b having (X.a = 1);
+select X.a from t1 AS X group by X.b having (x.a = 1);
+select X.a from t1 AS X group by X.b having (x.b = 1);
+
+CREATE OR REPLACE VIEW v1 AS
+select X.a from t1 AS X group by X.b having (X.a = 1);
+
+SHOW CREATE VIEW v1;
+
+SELECT * FROM v1;
+
+DROP VIEW v1;
+DROP TABLE t1;
+
+--echo End of 5.0 tests.
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index c3e5cef5e63..b5c1a01fe8e 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -507,4 +507,18 @@ SELECT * FROM tm1;
CHECK TABLE tm1;
DROP TABLE tm1, t1, t2;
+#
+# Bug#15522 - create ... select and with merge tables
+#
+# This was fixed together with Bug#20662 (Infinite loop in CREATE TABLE
+# IF NOT EXISTS ... SELECT with locked tables).
+# The new behavior for MERGE tables is consistent with the
+# CREATE TABLE SELECT behavior for ordinary tables.
+#
+CREATE TABLE t1(c1 INT);
+CREATE TABLE t2 (c1 INT) ENGINE=MERGE UNION=(t1) INSERT_METHOD=FIRST;
+--error ER_UPDATE_TABLE_USED
+CREATE TABLE IF NOT EXISTS t1 SELECT * FROM t2;
+DROP TABLE t1, t2;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/mix_innodb_myisam_binlog.test b/mysql-test/t/mix_innodb_myisam_binlog.test
index f9d7235ff84..e0ce802254a 100644
--- a/mysql-test/t/mix_innodb_myisam_binlog.test
+++ b/mysql-test/t/mix_innodb_myisam_binlog.test
@@ -347,7 +347,7 @@ CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM;
CREATE TABLE t2 (a int NOT NULL auto_increment, PRIMARY KEY (a));
delimiter |;
-create function bug27417(n int)
+create function bug27417(n int)
RETURNS int(11)
begin
insert into t1 values (null);
@@ -380,8 +380,190 @@ delete t2 from t2 where t2.a=bug27417(100) /* must not affect t2 */;
--disable_info
select count(*) from t1 /* must be 7 */;
-drop function bug27417;
+# function bug27417 remains for the following testing of bug#23333
drop table t1,t2;
+#
+# Bug#23333 using the patch (and the test) for bug#27471
+#
+# throughout the bug tests
+# t1 - non-trans side effects gatherer;
+# t2 - transactional table;
+#
+
+CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM;
+CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
+CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique) ENGINE=MyISAM;
+CREATE TABLE t4 (a int, PRIMARY KEY (a), b int unique) ENGINE=Innodb;
+CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
+
+
+#
+# INSERT
+#
+
+# prepare
+
+ insert into t2 values (1);
+ reset master;
+
+# execute
+
+ --error ER_DUP_ENTRY
+ insert into t2 values (bug27417(1));
+
+# check
+
+ show master status /* the offset must denote there is the query */;
+ select count(*) from t1 /* must be 1 */;
+
+#
+# INSERT SELECT
+#
+
+# prepare
+ delete from t1;
+ delete from t2;
+ insert into t2 values (2);
+ reset master;
+
+# execute
+
+ --error ER_DUP_ENTRY
+ insert into t2 select bug27417(1) union select bug27417(2);
+
+# check
+
+ show master status /* the offset must denote there is the query */;
+ select count(*) from t1 /* must be 2 */;
+
+#
+# UPDATE inc multi-update
+#
+
+# prepare
+ delete from t1;
+ insert into t3 values (1,1),(2,3),(3,4);
+ reset master;
+
+# execute
+ --error ER_DUP_ENTRY
+ update t3 set b=b+bug27417(1);
+
+# check
+ show master status /* the offset must denote there is the query */;
+ select count(*) from t1 /* must be 2 */;
+
+## multi_update::send_eof() branch
+
+# prepare
+ delete from t3;
+ delete from t4;
+ insert into t3 values (1,1);
+ insert into t4 values (1,1),(2,2);
+
+ reset master;
+
+# execute
+ --error ER_DUP_ENTRY
+ UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */;
+
+# check
+ show master status /* the offset must denote there is the query */;
+ select count(*) from t1 /* must be 4 */;
+
+## send_error() branch of multi_update
+
+# prepare
+ delete from t1;
+ delete from t3;
+ delete from t4;
+ insert into t3 values (1,1),(2,2);
+ insert into t4 values (1,1),(2,2);
+
+ reset master;
+
+# execute
+ --error ER_DUP_ENTRY
+ UPDATE t3,t4 SET t3.a=t4.a + bug27417(1);
+
+# check
+ select count(*) from t1 /* must be 1 */;
+
+# cleanup
+ drop table t4;
+
+
+#
+# DELETE incl multi-delete
+#
+
+# prepare
+ delete from t1;
+ delete from t2;
+ delete from t3;
+ insert into t2 values (1);
+ insert into t3 values (1,1);
+ create trigger trg_del before delete on t2 for each row
+ insert into t3 values (bug27417(1), 2);
+ reset master;
+
+# execute
+ --error ER_DUP_ENTRY
+ delete from t2;
+# check
+ show master status /* the offset must denote there is the query */;
+ select count(*) from t1 /* must be 1 */;
+
+# cleanup
+ drop trigger trg_del;
+
+# prepare
+ delete from t1;
+ delete from t2;
+ delete from t5;
+ create trigger trg_del_t2 after delete on t2 for each row
+ insert into t1 values (1);
+ insert into t2 values (2),(3);
+ insert into t5 values (1),(2);
+ reset master;
+
+# execute
+ --error ER_DUP_ENTRY
+ delete t2.* from t2,t5 where t2.a=t5.a + 1;
+
+# check
+ show master status /* the offset must denote there is the query */;
+ select count(*) from t1 /* must be 1 */;
+
+
+#
+# LOAD DATA
+#
+
+# prepare
+ delete from t1;
+ create table t4 (a int default 0, b int primary key) engine=innodb;
+ insert into t4 values (0, 17);
+ reset master;
+
+# execute
+ --error ER_DUP_ENTRY
+ load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
+# check
+ select * from t4;
+ select count(*) from t1 /* must be 2 */;
+ show master status /* the offset must denote there is the query */;
+
+#
+# bug#23333 cleanup
+#
+
+
+drop trigger trg_del_t2;
+drop table t1,t2,t3,t4,t5;
+drop function bug27417;
+
+
--echo end of tests
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
index 84e6a444d47..37cdfcf5f26 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -574,4 +574,38 @@ show master status /* there must be the UPDATE query event */;
# cleanup bug#27716
drop table t1, t2;
+#
+# Bug #29136 erred multi-delete on trans table does not rollback
+#
+
+# prepare
+--disable_warnings
+drop table if exists t1, t2, t3;
+--enable_warnings
+CREATE TABLE t1 (a int, PRIMARY KEY (a));
+CREATE TABLE t2 (a int, PRIMARY KEY (a));
+CREATE TABLE t3 (a int, PRIMARY KEY (a)) ENGINE=MyISAM;
+create trigger trg_del_t3 before delete on t3 for each row insert into t1 values (1);
+
+insert into t2 values (1),(2);
+insert into t3 values (1),(2);
+reset master;
+
+# exec cases B, A - see innodb.test
+
+# B. send_eof() and send_error() afterward
+
+--error ER_DUP_ENTRY
+delete t3.* from t2,t3 where t2.a=t3.a;
+
+# check
+select count(*) from t1 /* must be 1 */;
+select count(*) from t3 /* must be 1 */;
+# the query must be in binlog (no surprise though)
+source include/show_binlog_events.inc;
+
+# cleanup bug#29136
+drop table t1, t2, t3;
+
+
--echo end of tests
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index d5f403616c8..80c7a92c12f 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -1161,4 +1161,36 @@ ALTER TABLE t1 ENABLE KEYS;
SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1;
DROP TABLE t1;
+#
+# Bug#4692 - DISABLE/ENABLE KEYS waste a space
+#
+CREATE TABLE t1 (c1 INT, c2 INT, UNIQUE INDEX (c1), INDEX (c2)) ENGINE=MYISAM;
+--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
+SHOW TABLE STATUS LIKE 't1';
+INSERT INTO t1 VALUES (1,1);
+--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
+SHOW TABLE STATUS LIKE 't1';
+ALTER TABLE t1 DISABLE KEYS;
+--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
+SHOW TABLE STATUS LIKE 't1';
+ALTER TABLE t1 ENABLE KEYS;
+--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
+SHOW TABLE STATUS LIKE 't1';
+ALTER TABLE t1 DISABLE KEYS;
+--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
+SHOW TABLE STATUS LIKE 't1';
+ALTER TABLE t1 ENABLE KEYS;
+--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
+SHOW TABLE STATUS LIKE 't1';
+#--exec ls -log var/master-data/test/t1.MYI
+#--exec myisamchk -dvv var/master-data/test/t1.MYI
+#--exec myisamchk -iev var/master-data/test/t1.MYI
+--echo # Enable keys with parallel repair
+SET @@myisam_repair_threads=2;
+ALTER TABLE t1 DISABLE KEYS;
+ALTER TABLE t1 ENABLE KEYS;
+SET @@myisam_repair_threads=1;
+CHECK TABLE t1 EXTENDED;
+DROP TABLE t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/myisampack.test b/mysql-test/t/myisampack.test
new file mode 100644
index 00000000000..6598af6318a
--- /dev/null
+++ b/mysql-test/t/myisampack.test
@@ -0,0 +1,33 @@
+#
+# BUG#31277 - myisamchk --unpack corrupts a table
+#
+CREATE TABLE t1(c1 DOUBLE, c2 DOUBLE, c3 DOUBLE, c4 DOUBLE, c5 DOUBLE,
+ c6 DOUBLE, c7 DOUBLE, c8 DOUBLE, c9 DOUBLE, a INT PRIMARY KEY);
+INSERT INTO t1 VALUES
+(-3.31168791059336e-06,-3.19054655887874e-06,-1.06528081684847e-05,-1.227278240089e-06,-1.66718069164799e-06,-2.59038972510885e-06,-2.83145227805303e-06,-4.09678491270648e-07,-2.22610091291797e-06,6),
+(0.0030743000272545,2.53222044316438e-05,2.78674650061845e-05,1.95914465544536e-05,1.7347572525984e-05,1.87513810069614e-05,1.69882826885005e-05,2.44449336987598e-05,1.89914629921774e-05,9),
+(2.85229319423495e-05,3.05970988282259e-05,3.77161100113133e-05,2.3055238978766e-05,2.08241267364615e-05,2.28009504270553e-05,2.12070165658947e-05,2.84350091565409e-05,2.3366822910704e-05,3),
+(0,0,0,0,0,0,0,0,0,12),
+(3.24544577570754e-05,3.44619021870993e-05,4.37561613201124e-05,2.57556808726748e-05,2.3195354640561e-05,2.58532400758869e-05,2.34934241667179e-05,3.1621640063232e-05,2.58229982746189e-05,19),
+(2.53222044316438e-05,0.00445071933455582,2.97447268116016e-05,2.12379514059868e-05,1.86777776502663e-05,2.0170058676712e-05,1.8946030385445e-05,2.66040037173511e-05,2.09161899668946e-05,20),
+(3.03462382611645e-05,3.26517930083994e-05,3.5242025468662e-05,2.53219745106391e-05,2.24384532945004e-05,2.4052346047657e-05,2.23865572957053e-05,3.1634313969082e-05,2.48285463481801e-05,21),
+(1.95914465544536e-05,2.12379514059868e-05,2.27808649037128e-05,0.000341724375366877,1.4512761275113e-05,1.56475828693953e-05,1.44372366441415e-05,2.07952121981765e-05,1.61488256935919e-05,28),
+(1.7347572525984e-05,1.86777776502663e-05,2.04116907052727e-05,1.4512761275113e-05,0.000432162526082388,1.38116514014465e-05,1.2712914948904e-05,1.82503165178506e-05,1.43043075345922e-05,30),
+(1.68339762136661e-05,1.77836497166611e-05,2.36328309295222e-05,1.30183423732016e-05,1.18674654241553e-05,1.32467273128652e-05,1.24581739117775e-05,1.55624190959406e-05,1.33010638508213e-05,31),
+(1.89643062824415e-05,2.06997140070717e-05,2.29045490159364e-05,1.57918175731019e-05,1.39864987449492e-05,1.50580274578455e-05,1.45908734129609e-05,1.95329296993327e-05,1.5814709481221e-05,32),
+(1.69882826885005e-05,1.8946030385445e-05,2.00820439721439e-05,1.44372366441415e-05,1.2712914948904e-05,1.35209686474184e-05,0.00261563314789896,1.78285095864627e-05,1.46699314500019e-05,34),
+(2.0278186540684e-05,2.18923409729654e-05,2.39981539939738e-05,1.71774589459438e-05,1.54654355357383e-05,1.62731485707636e-05,1.49253140625051e-05,2.18229800160297e-05,1.71923561673718e-05,35),
+(2.44449336987598e-05,2.66040037173511e-05,2.84860148925308e-05,2.07952121981765e-05,1.82503165178506e-05,1.97667730441441e-05,1.78285095864627e-05,0.00166478601822712,2.0299952103232e-05,36),
+(1.89914629921774e-05,2.09161899668946e-05,2.26026841007872e-05,1.61488256935919e-05,1.43043075345922e-05,1.52609063290127e-05,1.46699314500019e-05,2.0299952103232e-05,0.00306670170971682,39),
+(0,0,0,0,0,0,0,0,0,41),
+(0,0,0,0,0,0,0,0,0,17),
+(0,0,0,0,0,0,0,0,0,18),
+(2.51880677333017e-05,2.63051795435778e-05,2.79874748974906e-05,2.02888886670845e-05,1.8178636318197e-05,1.91308527003585e-05,1.83260023644133e-05,2.4422300558171e-05,1.96411467520551e-05,44),
+(2.22402118719591e-05,2.37546284320705e-05,2.58463051055541e-05,1.83391609130854e-05,1.6300720519646e-05,1.74559091886791e-05,1.63733785575587e-05,2.26616253279828e-05,1.79541237435621e-05,45),
+(3.01092775359837e-05,3.23865212934412e-05,4.09444584045994e-05,0,2.15470966302776e-05,2.39082636344032e-05,2.28296706429177e-05,2.9007671511595e-05,2.44201138973326e-05,46);
+FLUSH TABLES;
+--exec $MYISAMPACK -s $MYSQLTEST_VARDIR/master-data/test/t1
+--exec $MYISAMCHK -srq $MYSQLTEST_VARDIR/master-data/test/t1
+--exec $MYISAMCHK -s --unpack $MYSQLTEST_VARDIR/master-data/test/t1
+CHECK TABLE t1 EXTENDED;
+DROP TABLE t1;
diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test
index 6e97d0faede..182b292c817 100644
--- a/mysql-test/t/mysql.test
+++ b/mysql-test/t/mysql.test
@@ -281,4 +281,13 @@ remove_file $MYSQLTEST_VARDIR/tmp/bug21412.sql;
#
--exec $MYSQL test -e "/*! \C latin1 */ select 1;"
+#
+# Bug#29323 mysql client only accetps ANSI encoded files
+#
+--write_file $MYSQLTEST_VARDIR/tmp/bug29323.sql
+select "This is a file starting with UTF8 BOM 0xEFBBBF";
+EOF
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug29323.sql 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/bug29323.sql;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/mysql_comments.sql b/mysql-test/t/mysql_comments.sql
new file mode 100644
index 00000000000..60b223a240f
--- /dev/null
+++ b/mysql-test/t/mysql_comments.sql
@@ -0,0 +1,177 @@
+##============================================================================
+## Notes
+##============================================================================
+
+# Test case for Bug#11230
+
+# The point of this test is to make sure that '#', '-- ' and '/* ... */'
+# comments, as well as empty lines, are sent from the client to the server.
+# This is to ensure better error reporting, and to keep comments in the code
+# for stored procedures / functions / triggers (Bug#11230).
+# As a result, be careful when editing comments in this script, they do
+# matter.
+#
+# Also, note that this is a script for **mysql**, not mysqltest.
+# This is critical, as the mysqltest client interprets comments differently.
+
+##============================================================================
+## Setup
+##============================================================================
+
+## See mysql_comments.test for initial cleanup
+
+# Test tables
+#
+# t1 is reused throughout the file, and dropped at the end.
+#
+drop table if exists t1;
+create table t1 (
+ id char(16) not null default '',
+ data int not null
+);
+
+##============================================================================
+## Comments outside statements
+##============================================================================
+
+# Ignored 1a
+-- Ignored 1b
+/*
+ Ignored 1c
+*/
+
+select 1;
+
+##============================================================================
+## Comments inside statements
+##============================================================================
+
+select # comment 1a
+# comment 2a
+-- comment 2b
+/*
+ comment 2c
+*/
+2
+; # not strictly inside, but on same line
+# ignored
+
+##============================================================================
+## Comments inside functions
+##============================================================================
+
+drop function if exists foofct ;
+
+create function foofct (x char(20))
+returns char(20)
+/* not inside the body yet */
+return
+-- comment 1a
+# comment 1b
+/* comment 1c */
+x; # after body, on same line
+
+select foofct("call 1");
+
+show create function foofct;
+drop function foofct;
+
+delimiter |
+
+create function foofct(x char(20))
+returns char(20)
+begin
+ -- comment 1a
+ # comment 1b
+ /*
+ comment 1c
+ */
+
+ -- empty line below
+
+ -- empty line above
+ return x;
+end|
+
+delimiter ;
+
+select foofct("call 2");
+
+show create function foofct;
+drop function foofct;
+
+##============================================================================
+## Comments inside stored procedures
+##============================================================================
+
+# Empty statement
+drop procedure if exists empty;
+create procedure empty()
+begin
+end;
+
+call empty();
+show create procedure empty;
+drop procedure empty;
+
+drop procedure if exists foosp;
+
+## These comments are before the create, and will be lost
+# Comment 1a
+-- Comment 1b
+/*
+ Comment 1c
+ */
+create procedure foosp()
+/* Comment not quiet in the body yet */
+ insert into test.t1
+## These comments are part of the procedure body, and should be kept.
+# Comment 2a
+-- Comment 2b
+/* Comment 2c */
+ -- empty line below
+
+ -- empty line above
+ values ("foo", 42); # comment 3, still part of the body
+## After the ';', therefore not part of the body
+# comment 4a
+-- Comment 4b
+/*
+ Comment 4c
+ */
+
+call foosp();
+select * from t1;
+delete from t1;
+show create procedure foosp;
+drop procedure foosp;
+
+drop procedure if exists nicesp;
+
+delimiter |
+
+create procedure nicesp(a int)
+begin
+ -- declare some variables here
+ declare b int;
+ declare c float;
+
+ -- do more stuff here
+ -- commented nicely and so on
+
+ -- famous last words ...
+end|
+
+delimiter ;
+
+show create procedure nicesp;
+drop procedure nicesp;
+
+# Triggers can be tested only in 5.1, since 5.0 does not have
+# SHOW CREATE TRIGGER
+
+##============================================================================
+## Cleanup
+##============================================================================
+
+drop table t1;
diff --git a/mysql-test/t/mysql_comments.test b/mysql-test/t/mysql_comments.test
new file mode 100644
index 00000000000..1f997aeb1ab
--- /dev/null
+++ b/mysql-test/t/mysql_comments.test
@@ -0,0 +1,37 @@
+# This test should work in embedded server after we fix mysqltest
+-- source include/not_embedded.inc
+###################### mysql_comments.test #############################
+# #
+# Testing of comments handling by the command line client (mysql) #
+# #
+# Creation: #
+# 2007-10-29 akopytov Implemented this test as a part of fixes for #
+# bug #26215 and bug #11230 #
+# #
+########################################################################
+
+#
+# Bug #11230: Keeping comments when storing stored procedures
+#
+
+# See the content of mysql_comments.sql
+# Set the test database to a known state before running the tests.
+--disable_warnings
+drop table if exists t1;
+drop function if exists foofct;
+drop procedure if exists empty;
+drop procedure if exists foosp;
+drop procedure if exists nicesp;
+drop trigger if exists t1_empty;
+drop trigger if exists t1_bi;
+--enable_warnings
+
+# Test without comments
+--echo "Pass 1 : --disable-comments"
+--exec $MYSQL --disable-comments test 2>&1 < "./t/mysql_comments.sql"
+
+# Test with comments
+--echo "Pass 2 : --enable-comments"
+--exec $MYSQL --enable-comments test 2>&1 < "./t/mysql_comments.sql"
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test
index 451eef17108..c83fe94f2eb 100644
--- a/mysql-test/t/mysqlbinlog.test
+++ b/mysql-test/t/mysqlbinlog.test
@@ -237,4 +237,8 @@ let $c= `select $a=$b`;
--echo $c
drop table t1;
+echo shell> mysqlbinlog std_data/corrupt-relay-bin.000624 > var/tmp/bug31793.sql;
+error 1;
+exec $MYSQL_BINLOG $MYSQL_TEST_DIR/std_data/corrupt-relay-bin.000624 > $MYSQLTEST_VARDIR/tmp/bug31793.sql;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test
index 655ff39001c..3875d496552 100644
--- a/mysql-test/t/mysqlcheck.test
+++ b/mysql-test/t/mysqlcheck.test
@@ -2,7 +2,7 @@
#
--disable_warnings
-DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t1, `t``1`, `t 1`;
drop view if exists v1;
drop database if exists client_test_db;
--enable_warnings
@@ -32,6 +32,15 @@ drop view v1;
drop table t1;
#
+# Bug #30654: mysqlcheck fails during upgrade of tables whose names include backticks
+#
+create table `t``1`(a int);
+create table `t 1`(a int);
+--replace_result 'Table is already up to date' OK
+--exec $MYSQL_CHECK --databases test
+drop table `t``1`, `t 1`;
+
+#
# Bug#25347: mysqlcheck -A -r doesn't repair table marked as crashed
#
create database d_bug25347;
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index 3c62577e781..6dba0a590d0 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -1577,5 +1577,22 @@ SELECT * FROM t2;
DROP TABLE t1,t2;
--echo #
+--echo # Bug#29815: new option for suppressing last line of mysqldump:
+--echo # "Dump completed on"
+--echo #
+
+--echo # --skip-dump-date:
+--replace_regex /-- [^D][^u][^m][^p].*// /\/\*!.*//
+--exec $MYSQL_DUMP --skip-dump-date test
+
+--echo # --dump-date:
+--replace_regex /-- [^D][^u][^m][^p].*// /\/\*!.*// / on [0-9 :-]+/ on DATE/
+--exec $MYSQL_DUMP --dump-date test
+
+--echo # --dump-date (default):
+--replace_regex /-- [^D][^u][^m][^p].*// /\/\*!.*// / on [0-9 :-]+/ on DATE/
+--exec $MYSQL_DUMP test
+
+--echo #
--echo # End of 5.0 tests
--echo #
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index 8a38972c00f..ec188af0244 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -1435,7 +1435,10 @@ select "this will be executed";
--exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/query.sql -R $MYSQLTEST_VARDIR/tmp/zero_length_file.result > /dev/null 2>&1
remove_file $MYSQLTEST_VARDIR/tmp/zero_length_file.result;
+--error 0,1
remove_file $MYSQLTEST_VARDIR/log/zero_length_file.reject;
+--error 0,1
+remove_file $MYSQL_TEST_DIR/r/zero_length_file.reject;
#
# Test that a test file that does not generate any output fails.
diff --git a/mysql-test/t/named_pipe-master.opt b/mysql-test/t/named_pipe-master.opt
new file mode 100644
index 00000000000..e534ae1eae5
--- /dev/null
+++ b/mysql-test/t/named_pipe-master.opt
@@ -0,0 +1 @@
+--loose-enable-named-pipe
diff --git a/mysql-test/t/named_pipe.test b/mysql-test/t/named_pipe.test
new file mode 100644
index 00000000000..e3dfd24bb52
--- /dev/null
+++ b/mysql-test/t/named_pipe.test
@@ -0,0 +1,14 @@
+# We currently only have named pipe support on windows, so
+# in order to optimize things we skip this test on all
+# other platforms
+--source include/windows.inc
+
+# Only run this test if named pipe is avaliable
+let $nmp= query_get_value("SHOW VARIABLES LIKE 'named_pipe'", Value, 1);
+if (`SELECT '$nmp' != 'ON'`){
+ skip No named pipe support;
+}
+
+# Source select test case
+-- source include/common-tests.inc
+
diff --git a/mysql-test/t/ndb_condition_pushdown.test b/mysql-test/t/ndb_condition_pushdown.test
index 748c26e2a9a..b5b7e41fb21 100644
--- a/mysql-test/t/ndb_condition_pushdown.test
+++ b/mysql-test/t/ndb_condition_pushdown.test
@@ -1718,5 +1718,1030 @@ SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
set engine_condition_pushdown = 1;
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
+# bug#29390 (scan filter is too large, discarded)
+
+drop table t1;
+
+create table t1 (a int, b int, c int, d int, primary key using hash(a))
+ engine=ndbcluster;
+
+insert into t1 values (10,1,100,0+0x1111);
+insert into t1 values (20,2,200,0+0x2222);
+insert into t1 values (30,3,300,0+0x3333);
+insert into t1 values (40,4,400,0+0x4444);
+insert into t1 values (50,5,500,0+0x5555);
+
+set engine_condition_pushdown = on;
+
+select a,b,d from t1
+ where b in (0,1,2,5)
+ order by b;
+
+--disable_query_log
+select a,b,d from t1
+ where b in (
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
+0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2)
+ order by b;
+--enable_query_log
+
set engine_condition_pushdown = @old_ecpd;
DROP TABLE t1,t2,t3,t4,t5;
diff --git a/mysql-test/t/ndb_update.test b/mysql-test/t/ndb_update.test
index ebcc6995d74..0f8793300e0 100644
--- a/mysql-test/t/ndb_update.test
+++ b/mysql-test/t/ndb_update.test
@@ -33,6 +33,11 @@ UPDATE IGNORE t1 set pk1 = 1, c = 2 where pk1 = 4;
select * from t1 order by pk1;
UPDATE t1 set pk1 = pk1 + 10;
select * from t1 order by pk1;
+# bug#25817
+create unique index ib on t1(b);
+update t1 set c = 4 where pk1 = 12;
+update ignore t1 set b = 55 where pk1 = 14;
+select * from t1 order by pk1;
--disable_warnings
DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/t/null.test b/mysql-test/t/null.test
index 65e09b006ec..2878b54c357 100644
--- a/mysql-test/t/null.test
+++ b/mysql-test/t/null.test
@@ -1,6 +1,6 @@
# Initialise
--disable_warnings
-drop table if exists t1;
+drop table if exists t1, t2;
--enable_warnings
#
@@ -231,4 +231,27 @@ drop table bug19145a;
drop table bug19145b;
drop table bug19145c;
-# End of 4.1 tests
+--echo # End of 4.1 tests
+
+--echo #
+--echo # Bug #31471: decimal_bin_size: Assertion `scale >= 0 &&
+--echo # precision > 0 && scale <= precision'
+--echo #
+
+CREATE TABLE t1 (a DECIMAL (1, 0) ZEROFILL, b DECIMAL (1, 0) ZEROFILL);
+INSERT INTO t1 (a, b) VALUES (0, 0);
+
+CREATE TABLE t2 SELECT IFNULL(a, b) FROM t1;
+DESCRIBE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 SELECT IFNULL(a, NULL) FROM t1;
+DESCRIBE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 SELECT IFNULL(NULL, b) FROM t1;
+DESCRIBE t2;
+
+DROP TABLE t1, t2;
+
+--echo # End of 5.0 tests
diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test
index 05934bff492..d1e40024733 100644
--- a/mysql-test/t/olap.test
+++ b/mysql-test/t/olap.test
@@ -358,3 +358,21 @@ SELECT * FROM (SELECT a, SUM(a) FROM t1 GROUP BY a WITH ROLLUP) as t;
DROP TABLE t1;
+--echo #
+--echo # Bug#31095: Unexpected NULL constant caused server crash.
+--echo #
+create table t1(a int);
+insert into t1 values (1),(2),(3);
+select count(a) from t1 group by null with rollup;
+drop table t1;
+--echo ##############################################################
+
+#
+# Bug #32558: group by null-returning expression with rollup causes crash
+#
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES(0);
+SELECT 1 FROM t1 GROUP BY (DATE(NULL)) WITH ROLLUP;
+DROP TABLE t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/outfile_loaddata.test b/mysql-test/t/outfile_loaddata.test
new file mode 100644
index 00000000000..2f6ac998b3d
--- /dev/null
+++ b/mysql-test/t/outfile_loaddata.test
@@ -0,0 +1,89 @@
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+--echo #
+--echo # Bug#31663 FIELDS TERMINATED BY special character
+--echo #
+
+CREATE TABLE t1 (i1 int, i2 int, c1 VARCHAR(256), c2 VARCHAR(256));
+INSERT INTO t1 VALUES (101, 202, '-r-', '=raker=');
+
+--let $fields=*
+--let $clauses=FIELDS TERMINATED BY 'raker'
+--echo # $clauses, warning:
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt')
+--eval CREATE TABLE t2 SELECT $fields FROM t1
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 $clauses
+--eval SELECT $fields FROM t2
+--remove_file $MYSQLTEST_VARDIR/tmp/bug31663.txt
+DROP TABLE t2;
+
+--let $fields=i1, i2
+--let $clauses=FIELDS TERMINATED BY 'r'
+--echo # Only numeric fields, $clauses, no warnings:
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt')
+--eval CREATE TABLE t2 SELECT $fields FROM t1
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 $clauses
+--eval SELECT $fields FROM t2
+--remove_file $MYSQLTEST_VARDIR/tmp/bug31663.txt
+DROP TABLE t2;
+
+--let $fields=*
+--let $clauses=FIELDS TERMINATED BY '0'
+--echo # $clauses, warning:
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt')
+--eval CREATE TABLE t2 SELECT $fields FROM t1
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 $clauses
+--eval SELECT $fields FROM t2
+--remove_file $MYSQLTEST_VARDIR/tmp/bug31663.txt
+DROP TABLE t2;
+
+--let $fields=*
+--let $clauses=FIELDS OPTIONALLY ENCLOSED BY '"' TERMINATED BY '0'
+--echo # $clauses, warning:
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt')
+--eval CREATE TABLE t2 SELECT $fields FROM t1
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 $clauses
+--eval SELECT $fields FROM t2
+--remove_file $MYSQLTEST_VARDIR/tmp/bug31663.txt
+DROP TABLE t2;
+
+--let $fields=c1, c2
+--let $clauses=FIELDS OPTIONALLY ENCLOSED BY '"' TERMINATED BY '0'
+--echo # Only string fields, $clauses, no warnings:
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt')
+--eval CREATE TABLE t2 SELECT $fields FROM t1
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 $clauses
+--eval SELECT $fields FROM t2
+--remove_file $MYSQLTEST_VARDIR/tmp/bug31663.txt
+DROP TABLE t2;
+
+DROP TABLE t1;
+
+--echo # End of 5.0 tests.
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index cd2fc44e3ce..c1505ffd645 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -1210,6 +1210,16 @@ EXECUTE st1;
DEALLOCATE PREPARE st1;
DROP TABLE t1;
+
+#
+# Bug #32137: prepared statement crash with str_to_date in update clause
+#
+create table t1 (a int, b tinyint);
+prepare st1 from 'update t1 set b= (str_to_date(a, a))';
+execute st1;
+deallocate prepare st1;
+drop table t1;
+
--echo End of 4.1 tests.
############################# 5.0 tests start ################################
diff --git a/mysql-test/t/repair.test b/mysql-test/t/repair.test
index f2e4c328218..9870e1749b3 100644
--- a/mysql-test/t/repair.test
+++ b/mysql-test/t/repair.test
@@ -83,4 +83,33 @@ SET myisam_repair_threads=@@global.myisam_repair_threads;
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
DROP TABLE t1;
-# End of 4.1 tests
+#
+# BUG#31174 - "Repair" command on MyISAM crashes with small
+# myisam_sort_buffer_size
+#
+CREATE TABLE t1(a CHAR(255), KEY(a));
+SET myisam_sort_buffer_size=4496;
+INSERT INTO t1 VALUES
+('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'),('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');
+SET myisam_repair_threads=2;
+REPAIR TABLE t1;
+SET myisam_repair_threads=@@global.myisam_repair_threads;
+SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
+DROP TABLE t1;
+
+--echo End of 4.1 tests
diff --git a/mysql-test/t/rpl_dual_pos_advance.test b/mysql-test/t/rpl_dual_pos_advance.test
index 074aeec63b1..518fa9df885 100644
--- a/mysql-test/t/rpl_dual_pos_advance.test
+++ b/mysql-test/t/rpl_dual_pos_advance.test
@@ -106,9 +106,3 @@ connection slave;
sync_with_master;
# End of 4.1 tests
-
-# Cleanup
-# The A->B->A replication causes the master to start writing relay logs
-# in var/run, remove them
-remove_file $MYSQLTEST_VARDIR/run/master-relay-bin.000001;
-remove_file $MYSQLTEST_VARDIR/run/master-relay-bin.index;
diff --git a/mysql-test/t/rpl_flush_log_loop.test b/mysql-test/t/rpl_flush_log_loop.test
index 6e45047bd30..f0b368c285b 100644
--- a/mysql-test/t/rpl_flush_log_loop.test
+++ b/mysql-test/t/rpl_flush_log_loop.test
@@ -3,6 +3,9 @@
source include/master-slave.inc;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+show variables like 'relay_log%';
+
connection slave;
stop slave;
--replace_result $MASTER_MYPORT MASTER_PORT
diff --git a/mysql-test/t/rpl_packet.test b/mysql-test/t/rpl_packet.test
index f410b561663..84bc5d908bf 100644
--- a/mysql-test/t/rpl_packet.test
+++ b/mysql-test/t/rpl_packet.test
@@ -64,9 +64,11 @@ CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
# The slave I/O thread must stop after trying to read the above event
-connection slave;
-sleep 2;
-SHOW STATUS LIKE 'Slave_running';
-
+connection slave;
+--source include/wait_for_slave_io_to_stop.inc
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+# import is only the 11th column Slave_IO_Running
+--replace_column 1 # 8 # 9 # 12 # 23 # 33 #
+query_vertical show slave status;
# End of tests
diff --git a/mysql-test/t/rpl_slave_skip-slave.opt b/mysql-test/t/rpl_slave_skip-slave.opt
new file mode 100644
index 00000000000..627becdbfb5
--- /dev/null
+++ b/mysql-test/t/rpl_slave_skip-slave.opt
@@ -0,0 +1 @@
+--innodb
diff --git a/mysql-test/t/rpl_slave_skip.test b/mysql-test/t/rpl_slave_skip.test
new file mode 100644
index 00000000000..04aafc51129
--- /dev/null
+++ b/mysql-test/t/rpl_slave_skip.test
@@ -0,0 +1,203 @@
+source include/have_innodb.inc;
+source include/master-slave.inc;
+
+# This test is for checking that the use of SQL_SLAVE_SKIP_COUNTER
+# behaves as expected, i.e., that it is guaranteed to skip an entire
+# group and not start executing in the middle of a transaction.
+
+# We are checking the correct behaviour when using both a
+# transactional and non-transactional table. The non-transactional
+# table comes into play when rolling back a transaction containing a
+# write to this table. In that case, the transaction should still be
+# written to the binary log, and the slave will apply it and then roll
+# it back to get the non-transactional change into the table.
+
+--echo **** On Master ****
+CREATE TABLE t1 (a INT, b SET('master','slave')) ENGINE=INNODB;
+CREATE TABLE t2 (a INT, b SET('master','slave')) ENGINE=MYISAM;
+
+--echo ==== Skipping normal transactions ====
+
+--echo **** On Slave ****
+sync_slave_with_master;
+STOP SLAVE;
+source include/wait_for_slave_to_stop.inc;
+
+--echo **** On Master ****
+connection master;
+
+BEGIN;
+INSERT INTO t1 VALUES (1, 'master');
+INSERT INTO t1 VALUES (2, 'master');
+INSERT INTO t1 VALUES (3, 'master');
+COMMIT;
+
+BEGIN;
+INSERT INTO t1 VALUES (4, 'master,slave');
+INSERT INTO t1 VALUES (5, 'master,slave');
+INSERT INTO t1 VALUES (6, 'master,slave');
+COMMIT;
+
+save_master_pos;
+
+SELECT * FROM t1 ORDER BY a;
+
+# This will skip a begin event and the first INSERT of the
+# transaction, and it should keep skipping until it has reached the
+# transaction terminator.
+
+--echo **** On Slave ****
+connection slave;
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+source include/wait_for_slave_to_start.inc;
+sync_with_master;
+SELECT * FROM t1 ORDER BY a;
+
+--echo **** On Master ****
+connection master;
+DELETE FROM t1;
+sync_slave_with_master;
+
+--echo ==== Skipping two normal transactions ====
+
+--echo **** On Slave ****
+connection slave;
+STOP SLAVE;
+source include/wait_for_slave_to_stop.inc;
+
+--echo **** On Master ****
+connection master;
+
+BEGIN;
+INSERT INTO t1 VALUES (1, 'master');
+INSERT INTO t1 VALUES (2, 'master');
+INSERT INTO t1 VALUES (3, 'master');
+COMMIT;
+
+BEGIN;
+INSERT INTO t1 VALUES (4, 'master');
+INSERT INTO t1 VALUES (5, 'master');
+INSERT INTO t1 VALUES (6, 'master');
+COMMIT;
+
+BEGIN;
+INSERT INTO t1 VALUES (7, 'master,slave');
+INSERT INTO t1 VALUES (8, 'master,slave');
+INSERT INTO t1 VALUES (9, 'master,slave');
+COMMIT;
+
+save_master_pos;
+
+SELECT * FROM t1 ORDER BY a;
+
+# This will skip a begin event and the first INSERT of the
+# transaction, and it should keep skipping until it has reached the
+# transaction terminator.
+
+--echo **** On Slave ****
+connection slave;
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
+START SLAVE;
+source include/wait_for_slave_to_start.inc;
+sync_with_master;
+SELECT * FROM t1 ORDER BY a;
+
+--echo **** On Master ****
+connection master;
+DELETE FROM t1;
+sync_slave_with_master;
+
+--echo ==== Skipping without autocommit ====
+
+# Testing without using autocommit instead. It should still write a
+# BEGIN event, so the behaviour should be the same
+
+--echo **** On Slave ****
+connection slave;
+STOP SLAVE;
+source include/wait_for_slave_to_stop.inc;
+
+--echo **** On Master ****
+connection master;
+SET AUTOCOMMIT=0;
+
+INSERT INTO t1 VALUES (1, 'master');
+INSERT INTO t1 VALUES (2, 'master');
+INSERT INTO t1 VALUES (3, 'master');
+COMMIT;
+
+INSERT INTO t1 VALUES (4, 'master,slave');
+INSERT INTO t1 VALUES (5, 'master,slave');
+INSERT INTO t1 VALUES (6, 'master,slave');
+COMMIT;
+
+save_master_pos;
+
+SELECT * FROM t1 ORDER BY a;
+
+# This will skip a begin event and the first INSERT of the
+# transaction, and it should keep skipping until it has reached the
+# transaction terminator.
+
+--echo **** On Slave ****
+connection slave;
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+source include/wait_for_slave_to_start.inc;
+sync_with_master;
+SELECT * FROM t1 ORDER BY a;
+
+# Testing with a non-transactional table in the transaction. This will
+# log a ROLLBACK as a transaction terminator, which is a normal Query
+# log event.
+
+--echo ==== Rollback of transaction with non-transactional change ====
+
+--echo **** On Master ****
+connection master;
+DELETE FROM t1;
+SET AUTOCOMMIT=1;
+
+--echo **** On Slave ****
+sync_slave_with_master;
+STOP SLAVE;
+source include/wait_for_slave_to_stop.inc;
+
+--echo **** On Master ****
+connection master;
+disable_warnings;
+BEGIN;
+INSERT INTO t1 VALUES (1, '');
+INSERT INTO t2 VALUES (2, 'master');
+INSERT INTO t1 VALUES (3, '');
+ROLLBACK;
+
+BEGIN;
+INSERT INTO t1 VALUES (4, '');
+INSERT INTO t2 VALUES (5, 'master,slave');
+INSERT INTO t1 VALUES (6, '');
+ROLLBACK;
+enable_warnings;
+
+save_master_pos;
+
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+--echo **** On Slave ****
+connection slave;
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+source include/wait_for_slave_to_start.inc;
+sync_with_master;
+
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+--echo ==== Cleanup ====
+
+--echo **** On Master ****
+connection master;
+DROP TABLE t1, t2;
+sync_slave_with_master;
diff --git a/mysql-test/t/rpl_sp_effects.test b/mysql-test/t/rpl_sp_effects.test
index 9da5723b993..f18710efa37 100644
--- a/mysql-test/t/rpl_sp_effects.test
+++ b/mysql-test/t/rpl_sp_effects.test
@@ -195,9 +195,60 @@ sync_slave_with_master;
connection slave;
select 'slave', a from t1;
+#
+# cleanup
+#
+
connection master;
drop table t1;
drop function f1;
drop function f2;
drop procedure p1;
sync_slave_with_master;
+
+#
+# bug#26199 Replication Failure on Slave when using stored procs
+# with bit-type parameters
+
+connection master;
+
+create table t2 (b BIT(7));
+delimiter //;
+create procedure sp_bug26199(bitvalue BIT(7))
+begin
+ insert into t2 set b = bitvalue;
+end //
+
+create function sf_bug26199(b BIT(7)) returns int
+begin
+ insert into t2 values(b);
+ return 0;
+end//
+
+DELIMITER ;//
+
+
+
+call sp_bug26199(b'1110');
+call sp_bug26199('\0');
+select sf_bug26199(b'1111111');
+select sf_bug26199(b'101111111');
+select sf_bug26199('\'');
+select hex(b) from t2;
+
+sync_slave_with_master;
+#connection slave;
+select hex(b) from t2;
+
+#
+# cleanup bug#26199
+#
+connection master;
+drop table t2;
+drop procedure sp_bug26199;
+drop function sf_bug26199;
+
+sync_slave_with_master;
+
+
+--echo end of the tests
diff --git a/mysql-test/t/rpl_temporary.test b/mysql-test/t/rpl_temporary.test
index d09049af217..a7a15aebe7a 100644
--- a/mysql-test/t/rpl_temporary.test
+++ b/mysql-test/t/rpl_temporary.test
@@ -211,6 +211,8 @@ select * from t1;
connection master;
drop table t1;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug14157.sql
+
# Delete the anonymous users
source include/delete_anonymous_users.inc;
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 5c30a17e08e..31c8a3f7d11 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -2360,6 +2360,27 @@ insert into t1 values (0xfffffffffffffffff, 0xfffffffffffffffff),
select hex(a), hex(b) from t1;
drop table t1;
+#
+# Bug #32103: optimizer crash when join on int and mediumint with variable in
+# where clause
+#
+
+CREATE TABLE t1 (c0 int);
+CREATE TABLE t2 (c0 int);
+
+# We need any variable that:
+# 1. has integer type,
+# 2. can be used with the "@@name" syntax
+# 3. available in every server build
+INSERT INTO t1 VALUES(@@connect_timeout);
+INSERT INTO t2 VALUES(@@connect_timeout);
+
+# We only need to ensure 1 row is returned to validate the results
+--replace_column 1 X 2 X
+SELECT * FROM t1 JOIN t2 ON t1.c0 = t2.c0 WHERE (t1.c0 <=> @@connect_timeout);
+
+DROP TABLE t1, t2;
+
--echo End of 4.1 tests
#
@@ -2742,14 +2763,14 @@ create table t1(f1 int, f2 date);
insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'),
(4,'2005-10-01'),(5,'2005-12-30');
# should return all records
-select * from t1 where f2 >= 0;
-select * from t1 where f2 >= '0000-00-00';
+select * from t1 where f2 >= 0 order by f2;
+select * from t1 where f2 >= '0000-00-00' order by f2;
# should return 4,5
-select * from t1 where f2 >= '2005-09-31';
-select * from t1 where f2 >= '2005-09-3a';
+select * from t1 where f2 >= '2005-09-31' order by f2;
+select * from t1 where f2 >= '2005-09-3a' order by f2;
# should return 1,2,3
-select * from t1 where f2 <= '2005-09-31';
-select * from t1 where f2 <= '2005-09-3a';
+select * from t1 where f2 <= '2005-09-31' order by f2;
+select * from t1 where f2 <= '2005-09-3a' order by f2;
drop table t1;
#
@@ -3466,22 +3487,178 @@ DROP TABLE t1;
#
--disable_ps_protocol
-
SELECT 1 AS ` `;
SELECT 1 AS ` `;
SELECT 1 AS ` x`;
+--enable_ps_protocol
+--error 1166
+CREATE VIEW v1 AS SELECT 1 AS ``;
+
+--error 1166
CREATE VIEW v1 AS SELECT 1 AS ` `;
-SELECT `` FROM v1;
-CREATE VIEW v2 AS SELECT 1 AS ` `;
-SELECT `` FROM v2;
+--error 1166
+CREATE VIEW v1 AS SELECT 1 AS ` `;
+
+--error 1166
+CREATE VIEW v1 AS SELECT (SELECT 1 AS ` `);
+
+CREATE VIEW v1 AS SELECT 1 AS ` x`;
+SELECT `x` FROM v1;
+
+--error 1166
+ALTER VIEW v1 AS SELECT 1 AS ` `;
+
+DROP VIEW v1;
+
+#
+# Bug#31800: Date comparison fails with timezone and slashes for greater
+# than comparison
+#
+
+# On DATETIME-like literals with trailing garbage, BETWEEN fudged in a
+# DATETIME comparator, while greater/less-than used bin-string comparisons.
+# Should correctly be compared as DATE or DATETIME, but throw a warning:
+
+select str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT'
+ and '2007/10/20 00:00:00 GMT';
+select str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6';
+select str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6';
+
+# We have all we need -- and trailing garbage:
+# (leaving out a leading zero in first example to prove it's a
+# value-comparison, not a string-comparison!)
+select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6';
+select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6';
+select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6';
+select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6';
+# no time at all:
+select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6';
+# partial time:
+select str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6';
+# fail, different second part:
+select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6';
+# correct syntax, no trailing nonsense -- this one must throw no warning:
+select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56';
+# no warning, but failure (different hour parts):
+select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00';
+# succeed:
+select str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00';
+# succeed, but warn for "trailing garbage" (":34"):
+select str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00';
+# invalid date (Feb 30) succeeds
+select str_to_date('2007-02-30 12:34','%Y-%m-%d %H:%i') = '2007-02-30 12:34';
+# 0-day for both, just works in default SQL mode.
+select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34';
+# 0-day, succeed
+select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00'
+ and '2007/10/20 00:00:00';
+set SQL_MODE=TRADITIONAL;
+# 0-day throws warning in traditional mode, and fails
+select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34';
+select str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34';
+# different code-path: get_datetime_value() with 0-day
+select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34';
+select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01'
+ and '2007/10/20';
+set SQL_MODE=DEFAULT;
+select str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20';
+select str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20';
+select str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34';
+select str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34';
+select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '';
+
+select str_to_date('1','%Y-%m-%d') = '1';
+select str_to_date('1','%Y-%m-%d') = '1';
+select str_to_date('','%Y-%m-%d') = '';
+
+# these three should work!
+select str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL;
+select str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00';
+select str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL;
+
+#
+# Bug #30666: Incorrect order when using range conditions on 2 tables or more
+#
+
+CREATE TABLE t1 (c11 INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY);
+CREATE TABLE t2 (c21 INT UNSIGNED NOT NULL,
+ c22 INT DEFAULT NULL,
+ KEY(c21, c22));
+CREATE TABLE t3 (c31 INT UNSIGNED NOT NULL DEFAULT 0,
+ c32 INT DEFAULT NULL,
+ c33 INT NOT NULL,
+ c34 INT UNSIGNED DEFAULT 0,
+ KEY (c33, c34, c32));
+
+INSERT INTO t1 values (),(),(),(),();
+INSERT INTO t2 SELECT a.c11, b.c11 FROM t1 a, t1 b;
+INSERT INTO t3 VALUES (1, 1, 1, 0),
+ (2, 2, 0, 0),
+ (3, 3, 1, 0),
+ (4, 4, 0, 0),
+ (5, 5, 1, 0);
+
+# Show that ORDER BY produces the correct results order
+SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND
+ t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND
+ t3.c33 = 1 AND t2.c22 in (1, 3)
+ ORDER BY c32;
+
+# Show that ORDER BY DESC produces the correct results order
+SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND
+ t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND
+ t3.c33 = 1 AND t2.c22 in (1, 3)
+ ORDER BY c32 DESC;
+
+DROP TABLE t1, t2, t3;
+###########################################################################
+
+--echo
+--echo #
+--echo # Bug#30736: Row Size Too Large Error Creating a Table and
+--echo # Inserting Data.
+--echo #
-CREATE VIEW v3 AS SELECT 1 AS ` x`;
-SELECT `x` FROM v3;
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+--enable_warnings
-DROP VIEW v1, v2, v3;
+--echo
---enable_ps_protocol
+CREATE TABLE t1(
+ c1 DECIMAL(10, 2),
+ c2 FLOAT);
+
+--echo
+
+INSERT INTO t1 VALUES (0, 1), (2, 3), (4, 5);
+
+--echo
+
+CREATE TABLE t2(
+ c3 DECIMAL(10, 2))
+ SELECT
+ c1 * c2 AS c3
+ FROM t1;
+
+--echo
+
+SELECT * FROM t1;
+
+--echo
+
+SELECT * FROM t2;
+
+--echo
+
+DROP TABLE t1;
+DROP TABLE t2;
+
+--echo
+
+###########################################################################
--echo End of 5.0 tests
diff --git a/mysql-test/t/windows_shm-master.opt b/mysql-test/t/shm-master.opt
index 4476ea16360..d71395213b1 100644
--- a/mysql-test/t/windows_shm-master.opt
+++ b/mysql-test/t/shm-master.opt
@@ -1 +1 @@
---skip-grant-tables --loose-shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --loose-shared-memory=1
+--skip-grant-tables --loose-shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX$MTR_BUILD_THREAD --loose-shared-memory=1
diff --git a/mysql-test/t/shm.test b/mysql-test/t/shm.test
new file mode 100644
index 00000000000..380607d8ebf
--- /dev/null
+++ b/mysql-test/t/shm.test
@@ -0,0 +1,19 @@
+# We currently only have shm support on windows, so in order
+# to optimize things we skip this test on all other platforms
+--source include/windows.inc
+
+# Only run this test if shared memory is avaliable
+let $shm= query_get_value("SHOW VARIABLES LIKE 'shared_memory'", Value, 1);
+if (`SELECT '$shm' != 'ON'`){
+ skip No shm support;
+}
+
+# Source select test case
+-- source include/common-tests.inc
+
+#
+# Bug #24924: shared-memory-base-name that is too long causes buffer overflow
+#
+--exec $MYSQLADMIN --no-defaults --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ping
+
+--echo End of 5.0 tests.
diff --git a/mysql-test/t/skip_grants.test b/mysql-test/t/skip_grants.test
index 75694672a17..02a381063ee 100644
--- a/mysql-test/t/skip_grants.test
+++ b/mysql-test/t/skip_grants.test
@@ -116,3 +116,15 @@ select count(*) from information_schema.COLUMN_PRIVILEGES;
select count(*) from information_schema.SCHEMA_PRIVILEGES;
select count(*) from information_schema.TABLE_PRIVILEGES;
select count(*) from information_schema.USER_PRIVILEGES;
+
+#
+# Bug #32020: loading udfs while --skip-grant-tables is enabled causes out of
+# memory errors
+#
+
+--error ER_CANT_INITIALIZE_UDF
+CREATE FUNCTION a RETURNS STRING SONAME '';
+--error ER_SP_DOES_NOT_EXIST
+DROP FUNCTION a;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test
index 240cda67edc..8133a2271a1 100644
--- a/mysql-test/t/sp-error.test
+++ b/mysql-test/t/sp-error.test
@@ -1744,7 +1744,7 @@ drop procedure bug15091;
drop function if exists bug16896;
--enable_warnings
---error ER_SP_NO_AGGREGATE
+--error ER_PARSE_ERROR
create aggregate function bug16896() returns int return 1;
@@ -2090,6 +2090,29 @@ end//
delimiter ;//
#
+# Bug#29816 Syntactically wrong query fails with misleading error message
+#
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest;
+--enable_warnings
+CREATE DATABASE mysqltest;
+USE mysqltest;
+DROP DATABASE mysqltest;
+# Both ER_SP_DOES_NOT_EXIST and ER_PARSE_ERROR are valid here,
+# the result is implementation dependent:
+# See Bug#29816 for details
+--error ER_SP_DOES_NOT_EXIST
+SELECT inexistent(), 1 + ,;
+--error ER_SP_DOES_NOT_EXIST
+SELECT inexistent();
+--error ER_PARSE_ERROR
+SELECT .inexistent();
+--error ER_PARSE_ERROR
+SELECT ..inexistent();
+USE test;
+
+#
# BUG#NNNN: New bug synopsis
#
#--disable_warnings
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 465585a693e..785e7e3793c 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -6642,9 +6642,6 @@ DROP VIEW v1, v2|
DROP TABLE t3, t4|
---echo End of 5.0 tests
-
-
#
# BUG#23760: ROW_COUNT() and store procedure not owrking together
#
@@ -7076,9 +7073,6 @@ show create procedure proc_21513|
drop procedure proc_21513|
-###
---echo End of 5.0 tests.
-
#
# BUG#NNNN: New bug synopsis
#
@@ -7677,4 +7671,35 @@ DROP FUNCTION f1;
###########################################################################
---echo End of 5.0 tests
+#
+# Bug#28318 (CREATE FUNCTION (UDF) requires a schema)
+#
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS db28318_a.t1;
+DROP PROCEDURE IF EXISTS db28318_b.t2;
+DROP DATABASE IF EXISTS db28318_a;
+DROP DATABASE IF EXISTS db28318_b;
+--enable_warnings
+
+CREATE DATABASE db28318_a;
+CREATE DATABASE db28318_b;
+
+CREATE PROCEDURE db28318_a.t1() SELECT "db28318_a.t1";
+CREATE PROCEDURE db28318_b.t2() CALL t1();
+
+use db28318_a;
+
+# In db28318_b.t2, t1 refers to db28318_b.t1
+--error ER_SP_DOES_NOT_EXIST
+CALL db28318_b.t2();
+
+DROP PROCEDURE db28318_a.t1;
+DROP PROCEDURE db28318_b.t2;
+DROP DATABASE db28318_a;
+DROP DATABASE db28318_b;
+
+
+--echo # ------------------------------------------------------------------
+--echo # -- End of 5.0 tests
+--echo # ------------------------------------------------------------------
diff --git a/mysql-test/t/sp_trans_log.test b/mysql-test/t/sp_trans_log.test
index 3e440b3ccc1..93605722f6b 100644
--- a/mysql-test/t/sp_trans_log.test
+++ b/mysql-test/t/sp_trans_log.test
@@ -27,7 +27,7 @@ reset master|
--error ER_DUP_ENTRY
insert into t2 values (bug23333(),1)|
--replace_column 2 # 5 # 6 #
-show binlog events from 98 /* with fixes for #23333 will show there is the query */|
+show binlog events from 98 /* with fixes for #23333 will show there are 2 queries */|
select count(*),@a from t1 /* must be 1,1 */|
drop table t1, t2|
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index d076ca6bd33..06a64f518fb 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -2970,7 +2970,7 @@ DROP TABLE t1,t2;
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (1, 2), (1,3), (1,4), (2,1), (2,2);
--- returns no rows, when it should
+# returns no rows, when it should
SELECT a1.a, COUNT(*) FROM t1 a1 WHERE a1.a = 1
AND EXISTS( SELECT a2.a FROM t1 a2 WHERE a2.a = a1.a)
GROUP BY a1.a;
@@ -2987,4 +2987,61 @@ SELECT (SELECT SUM(t1.a) FROM t2 WHERE a!=0) FROM t1;
SELECT (SELECT SUM(t1.a) FROM t2 WHERE a=1) FROM t1;
DROP TABLE t1,t2;
+#
+# Bug #31884: Assertion + crash in subquery in the SELECT clause.
+#
+
+CREATE TABLE t1 (a1 INT, a2 INT);
+CREATE TABLE t2 (b1 INT, b2 INT);
+
+INSERT INTO t1 VALUES (100, 200);
+INSERT INTO t1 VALUES (101, 201);
+INSERT INTO t2 VALUES (101, 201);
+INSERT INTO t2 VALUES (103, 203);
+
+SELECT ((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL FROM t1;
+DROP TABLE t1, t2;
+
+#
+# Bug #28076: inconsistent binary/varbinary comparison
+#
+
+CREATE TABLE t1 (s1 BINARY(5), s2 VARBINARY(5));
+INSERT INTO t1 VALUES (0x41,0x41), (0x42,0x42), (0x43,0x43);
+
+SELECT s1, s2 FROM t1 WHERE s2 IN (SELECT s1 FROM t1);
+SELECT s1, s2 FROM t1 WHERE (s2, 10) IN (SELECT s1, 10 FROM t1);
+
+CREATE INDEX I1 ON t1 (s1);
+CREATE INDEX I2 ON t1 (s2);
+
+SELECT s1, s2 FROM t1 WHERE s2 IN (SELECT s1 FROM t1);
+SELECT s1, s2 FROM t1 WHERE (s2, 10) IN (SELECT s1, 10 FROM t1);
+
+TRUNCATE t1;
+INSERT INTO t1 VALUES (0x41,0x41);
+SELECT * FROM t1 WHERE s1 = (SELECT s2 FROM t1);
+
+DROP TABLE t1;
+
+CREATE TABLE t1 (a1 VARBINARY(2) NOT NULL DEFAULT '0', PRIMARY KEY (a1));
+CREATE TABLE t2 (a2 BINARY(2) default '0', INDEX (a2));
+CREATE TABLE t3 (a3 BINARY(2) default '0');
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+INSERT INTO t2 VALUES (1),(2),(3);
+INSERT INTO t3 VALUES (1),(2),(3);
+SELECT LEFT(t2.a2, 1) FROM t2,t3 WHERE t3.a3=t2.a2;
+SELECT t1.a1, t1.a1 in (SELECT t2.a2 FROM t2,t3 WHERE t3.a3=t2.a2) FROM t1;
+DROP TABLE t1,t2,t3;
+
+CREATE TABLE t1 (a1 BINARY(3) PRIMARY KEY, b1 VARBINARY(3));
+CREATE TABLE t2 (a2 VARBINARY(3) PRIMARY KEY);
+CREATE TABLE t3 (a3 VARBINARY(3) PRIMARY KEY);
+INSERT INTO t1 VALUES (1,10), (2,20), (3,30), (4,40);
+INSERT INTO t2 VALUES (2), (3), (4), (5);
+INSERT INTO t3 VALUES (10), (20), (30);
+SELECT LEFT(t1.a1,1) FROM t1,t3 WHERE t1.b1=t3.a3;
+SELECT a2 FROM t2 WHERE t2.a2 IN (SELECT t1.a1 FROM t1,t3 WHERE t1.b1=t3.a3);
+DROP TABLE t1, t2, t3;
+
--echo End of 5.0 tests.
diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test
index 013e648225c..507537457d3 100644
--- a/mysql-test/t/type_date.test
+++ b/mysql-test/t/type_date.test
@@ -138,6 +138,20 @@ select * from t1;
drop table t1;
#
+# Bug #30942: select str_to_date from derived table returns varying results
+#
+CREATE TABLE t1 (
+ a INT
+);
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (NULL);
+
+SELECT str_to_date( '', a ) FROM t1;
+DROP TABLE t1;
+
+
+#
# Bug #31221: Optimizer incorrectly identifies impossible WHERE clause
#
@@ -156,4 +170,24 @@ EXPLAIN SELECT COUNT(*) FROM t1 WHERE a = NOW();
DROP TABLE t1;
+#
+# Bug #28687: Search fails on '0000-00-00' date after sql_mode change
+#
+
+CREATE TABLE t1 (a DATE);
+CREATE TABLE t2 (a DATE);
+CREATE INDEX i ON t1 (a);
+INSERT INTO t1 VALUES ('0000-00-00'),('0000-00-00');
+INSERT INTO t2 VALUES ('0000-00-00'),('0000-00-00');
+SELECT * FROM t1 WHERE a = '0000-00-00';
+SELECT * FROM t2 WHERE a = '0000-00-00';
+SET SQL_MODE=TRADITIONAL;
+EXPLAIN SELECT * FROM t1 WHERE a = '0000-00-00';
+SELECT * FROM t1 WHERE a = '0000-00-00';
+SELECT * FROM t2 WHERE a = '0000-00-00';
+--error ER_TRUNCATED_WRONG_VALUE
+INSERT INTO t1 VALUES ('0000-00-00');
+SET SQL_MODE=DEFAULT;
+DROP TABLE t1,t2;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test
index ffda593f320..219af2336e1 100644
--- a/mysql-test/t/type_datetime.test
+++ b/mysql-test/t/type_datetime.test
@@ -155,13 +155,13 @@ set @@sql_mode='ansi,traditional';
insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38');
insert into t1 set dt='2007-03-23 13:49:38',da=dt;
# Test error handling
---error 1292
+--error ER_TRUNCATED_WRONG_VALUE
insert into t1 values ('2007-03-32','2007-03-23 13:49:38');
select * from t1;
drop table t1;
---error 1067
+--error ER_INVALID_DEFAULT
create table t1 (da date default '1962-03-32 23:33:34', dt datetime default '1962-03-03');
---error 1067
+--error ER_INVALID_DEFAULT
create table t1 (t time default '916:00:00 a');
set @@sql_mode= @org_mode;
@@ -169,6 +169,19 @@ set @@sql_mode= @org_mode;
#
# Bug#27590: Wrong DATE/DATETIME comparison.
#
+## The following sub test will fail (difference to expected result) if the
+## select curdate() < now(), f1 < now(), cast(f1 as date) < now() from t1;
+## runs exact at midnight ('00:00:00').
+## ( Bug#29290 type_datetime.test failure in 5.1 )
+## Therefore we sleep a bit if we are too close to midnight.
+## The complete test itself needs around 1 second.
+## Therefore a time_distance to midnight of 5 seconds should be sufficient.
+if (`SELECT CURTIME() > SEC_TO_TIME(24 * 3600 - 5)`)
+{
+ # We are here when CURTIME() is between '23:59:56' and '23:59:59'.
+ # So a sleep time of 5 seconds brings us between '00:00:01' and '00:00:04'.
+ --real_sleep 5
+}
create table t1 (f1 date, f2 datetime, f3 timestamp);
insert into t1(f1) values(curdate());
select curdate() < now(), f1 < now(), cast(f1 as date) < now() from t1;
@@ -282,3 +295,60 @@ select * from t1 where f1 between 20020101 and 20070101000000;
select * from t1 where f1 between 2002010 and 20070101000000;
select * from t1 where f1 between 20020101 and 2007010100000;
drop table t1;
+
+--echo #
+--echo # Bug#27216: functions with parameters of different date types may
+--echo # return wrong type of the result.
+--echo #
+create table t1 (f1 date, f2 datetime, f3 varchar(20));
+create table t2 as select coalesce(f1,f1) as f4 from t1;
+desc t2;
+create table t3 as select coalesce(f1,f2) as f4 from t1;
+desc t3;
+create table t4 as select coalesce(f2,f2) as f4 from t1;
+desc t4;
+create table t5 as select coalesce(f1,f3) as f4 from t1;
+desc t5;
+create table t6 as select coalesce(f2,f3) as f4 from t1;
+desc t6;
+create table t7 as select coalesce(makedate(1997,1),f2) as f4 from t1;
+desc t7;
+create table t8 as select coalesce(cast('01-01-01' as datetime),f2) as f4
+ from t1;
+desc t8;
+create table t9 as select case when 1 then cast('01-01-01' as date)
+ when 0 then cast('01-01-01' as date) end as f4 from t1;
+desc t9;
+create table t10 as select case when 1 then cast('01-01-01' as datetime)
+ when 0 then cast('01-01-01' as datetime) end as f4 from t1;
+desc t10;
+create table t11 as select if(1, cast('01-01-01' as datetime),
+ cast('01-01-01' as date)) as f4 from t1;
+desc t11;
+create table t12 as select least(cast('01-01-01' as datetime),
+ cast('01-01-01' as date)) as f4 from t1;
+desc t12;
+create table t13 as select ifnull(cast('01-01-01' as datetime),
+ cast('01-01-01' as date)) as f4 from t1;
+desc t13;
+drop tables t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13;
+--echo ###################################################################
+#
+# Bug #31253: crash comparing datetime to double
+# Should return 1st row only. Crashes if NULL propagation fails.
+#
+create table t1 (f1 time);
+insert into t1 set f1 = '45:44:44';
+insert into t1 set f1 = '15:44:44';
+select * from t1 where (convert(f1,datetime)) != 1;
+drop table t1;
+
+#
+# Bug #31249: problem with convert(..., datetime)
+#
+create table t1 (a tinyint);
+insert into t1 values (), (), ();
+select sum(a) from t1 group by convert(a, datetime);
+drop table t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test
index 5538f19f5f9..807d1e6b01e 100644
--- a/mysql-test/t/type_decimal.test
+++ b/mysql-test/t/type_decimal.test
@@ -278,7 +278,7 @@ update t1 set b=a;
select * from t1;
drop table t1;
-# End of 4.1 tests
+--echo End of 4.1 tests
#
# Test for BUG#8397: decimal type in subselects (Item_cache_decimal)
@@ -408,3 +408,74 @@ INSERT INTO t1 VALUES (1.1325,3);
SELECT ROUND(qty,3), dps, ROUND(qty,dps) FROM t1;
DROP TABLE t1;
+
+#
+# Bug#31019: MOD() function and operator crashes MySQL when
+# divisor is very long and < 1
+#
+
+SELECT 1 % .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS '%';
+SELECT MOD(1, .123456789123456789123456789123456789123456789123456789123456789123456789123456789) AS 'MOD()';
+
+# Bug #31227: memory overrun with decimal (6,6) and zerofill and group_concat
+# valgrind will complain about this (the group_concat(f2)) on unpatched mysqld.
+#
+create table t1 (f1 decimal(6,6),f2 decimal(6,6) zerofill);
+insert into t1 values (-0.123456,0.123456);
+select group_concat(f1),group_concat(f2) from t1;
+drop table t1;
+
+#
+# BUG#31450 "Query causes error 1048"
+#
+create table t1 (
+ ua_id decimal(22,0) not null,
+ ua_invited_by_id decimal(22,0) default NULL,
+ primary key(ua_id)
+);
+insert into t1 values (123, NULL), (456, NULL);
+
+--echo this must not produce error 1048:
+select * from t1 where ua_invited_by_id not in (select ua_id from t1);
+
+drop table t1;
+
+#
+# Bug #30889: filesort and order by with float/numeric crashes server
+#
+--disable_warnings
+DROP TABLE IF EXISTS t3;
+DROP TABLE IF EXISTS t4;
+--enable_warnings
+CREATE TABLE t1( a NUMERIC, b INT );
+INSERT INTO t1 VALUES (123456, 40), (123456, 40);
+SELECT TRUNCATE( a, b ) AS c FROM t1 ORDER BY c;
+SELECT ROUND( a, b ) AS c FROM t1 ORDER BY c;
+SELECT ROUND( a, 100 ) AS c FROM t1 ORDER BY c;
+
+CREATE TABLE t2( a NUMERIC, b INT );
+INSERT INTO t2 VALUES (123456, 100);
+SELECT TRUNCATE( a, b ) AS c FROM t2 ORDER BY c;
+SELECT ROUND( a, b ) AS c FROM t2 ORDER BY c;
+
+CREATE TABLE t3( a DECIMAL, b INT );
+INSERT INTO t3 VALUES (123456, 40), (123456, 40);
+SELECT TRUNCATE( a, b ) AS c FROM t3 ORDER BY c;
+SELECT ROUND( a, b ) AS c FROM t3 ORDER BY c;
+SELECT ROUND( a, 100 ) AS c FROM t3 ORDER BY c;
+
+CREATE TABLE t4( a DECIMAL, b INT );
+INSERT INTO t4 VALUES (123456, 40), (123456, 40);
+SELECT TRUNCATE( a, b ) AS c FROM t4 ORDER BY c;
+SELECT ROUND( a, b ) AS c FROM t4 ORDER BY c;
+SELECT ROUND( a, 100 ) AS c FROM t4 ORDER BY c;
+
+delete from t1;
+INSERT INTO t1 VALUES (1234567890, 20), (999.99, 5);
+show create table t1;
+
+select round(a,b) as c from t1 order by c;
+
+DROP TABLE t1, t2, t3, t4;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test
index a55200c8853..9aa8c00d24a 100644
--- a/mysql-test/t/type_float.test
+++ b/mysql-test/t/type_float.test
@@ -116,15 +116,10 @@ drop table if exists t1;
# Check conversion of floats to character field (Bug #7774)
create table t1 (c char(20));
insert into t1 values (5e-28);
-# Expected result is "5e-28", but windows returns "5e-028"
---replace_result 5e-028 5e-28
select * from t1;
drop table t1;
create table t1 (c char(6));
insert into t1 values (2e5),(2e6),(2e-4),(2e-5);
-# Expected result is "2e+06", but windows returns "2e+006"
-# Expected result is "2e-05", but windows returns "2e-005"
---replace_result 2e+006 2e+06 2e-005 2e-05
select * from t1;
drop table t1;
@@ -224,6 +219,22 @@ create table t1 (s1 float(0,2));
create table t1 (s1 float(1,2));
#
+# MySQL Bugs: #11589: mysqltest --ps-protocol, strange output, float/double/real with zerofill
+#
+
+CREATE TABLE t1 (
+ f1 real zerofill,
+ f2 double zerofill,
+ f3 float zerofill);
+INSERT INTO t1 VALUES ( 0.314152e+1, 0.314152e+1, 0.314152e+1);
+
+let $my_stmt= select f1, f2, f3 FROM t1;
+eval PREPARE stmt1 FROM '$my_stmt';
+select f1, f2, f3 FROM t1;
+eval $my_stmt;
+EXECUTE stmt1;
+
+DROP TABLE t1;
# Bug #28121 "INSERT or UPDATE into DOUBLE(200,0) field being truncated to 31 digits"
#
diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test
index 5a631b6163e..cb7e0c4163a 100644
--- a/mysql-test/t/type_newdecimal.test
+++ b/mysql-test/t/type_newdecimal.test
@@ -1195,6 +1195,25 @@ SELECT 1 FROM t1 GROUP BY @b := @a, @b;
DROP TABLE t1;
---echo End of 5.0 tests
+#
+# Bug #24907: unpredictable (display) precission, if input precission
+# increases
+#
+# As per 10.1.1. Overview of Numeric Types, type (new) DECIMAL has a
+# maxmimum precision of 30 places after the decimal point. Show that
+# temp field creation beyond that works and throws a truncation warning.
+# DECIMAL(37,36) should be adjusted to DECIMAL(31,30).
+CREATE TABLE t1 SELECT 0.123456789012345678901234567890123456 AS f1;
+DESC t1;
+SELECT f1 FROM t1;
+DROP TABLE t1;
+# too many decimal places, AND too many digits altogether (90 = 45+45).
+# should preserve integers (65 = 45+20)
+CREATE TABLE t1 SELECT 123451234512345123451234512345123451234512345.678906789067890678906789067890678906789067890 AS f1;
+DESC t1;
+SELECT f1 FROM t1;
+DROP TABLE t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/udf.test b/mysql-test/t/udf.test
index 75af1f4be4b..22b8ed10a49 100644
--- a/mysql-test/t/udf.test
+++ b/mysql-test/t/udf.test
@@ -113,11 +113,11 @@ DROP TABLE bug19904;
# Bug#21269: DEFINER-clause is allowed for UDF-functions
#
---error ER_WRONG_USAGE
+--error ER_PARSE_ERROR
CREATE DEFINER=CURRENT_USER() FUNCTION should_not_parse
RETURNS STRING SONAME "should_not_parse.so";
---error ER_WRONG_USAGE
+--error ER_PARSE_ERROR
CREATE DEFINER=someone@somewhere FUNCTION should_not_parse
RETURNS STRING SONAME "should_not_parse.so";
#
@@ -311,5 +311,55 @@ drop table t1;
drop function metaphon;
set GLOBAL query_cache_size=default;
+#
+# Bug#28318 CREATE FUNCTION (UDF) requires a schema
+#
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest;
+--enable_warnings
+CREATE DATABASE mysqltest;
+USE mysqltest;
+DROP DATABASE mysqltest;
+--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
+eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
+DROP FUNCTION metaphon;
+USE test;
+
+#
+# Bug #29804 UDF parameters don't contain correct string length
+#
+
+CREATE TABLE const_len_bug (
+ str_const varchar(4000),
+ result1 varchar(4000),
+ result2 varchar(4000)
+);
+
+DELIMITER |;
+CREATE TRIGGER check_const_len_trigger BEFORE INSERT ON const_len_bug FOR EACH ROW BEGIN
+ set NEW.str_const = 'bar';
+ set NEW.result2 = check_const_len(NEW.str_const);
+END |
+
+CREATE PROCEDURE check_const_len_sp (IN str_const VARCHAR(4000))
+BEGIN
+DECLARE result VARCHAR(4000);
+SET result = check_const_len(str_const);
+insert into const_len_bug values(str_const, result, "");
+END |
+DELIMITER ;|
+
+--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
+eval CREATE FUNCTION check_const_len RETURNS string SONAME "$UDF_EXAMPLE_LIB";
+
+CALL check_const_len_sp("foo");
+
+SELECT * from const_len_bug;
+
+DROP FUNCTION check_const_len;
+DROP PROCEDURE check_const_len_sp;
+DROP TRIGGER check_const_len_trigger;
+DROP TABLE const_len_bug;
--echo End of 5.0 tests.
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index 0ad85a32568..a8f0a3425df 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -139,6 +139,7 @@ show global variables like 'net_%';
show session variables like 'net_%';
set net_buffer_length=1;
show variables like 'net_buffer_length';
+#warning 1292
set net_buffer_length=2000000000;
show variables like 'net_buffer_length';
@@ -535,7 +536,14 @@ set @test = @@query_prealloc_size;
set @@query_prealloc_size = @test;
select @@query_prealloc_size = @test;
-# End of 4.1 tests
+#
+# Bug#31588 buffer overrun when setting variables
+#
+# Buffer-size Off By One. Should throw valgrind-warning without fix #31588.
+--error 1231
+set global sql_mode=repeat('a',80);
+
+--echo End of 4.1 tests
#
# Bug#6282 Packet error with SELECT INTO
@@ -674,6 +682,20 @@ set @@hostname= "anothername";
--replace_column 2 #
show variables like 'hostname';
+#
+# Bug #29131: SHOW VARIABLES reports variable 'log' but SET doesn't recognize it
+#
+
+SHOW VARIABLES LIKE 'log';
+SELECT @@log;
+--error 1238
+SET GLOBAL log=0;
+
+SHOW VARIABLES LIKE 'log_slow_queries';
+SELECT @@log_slow_queries;
+--error 1238
+SET GLOBAL log_slow_queries=0;
+
--echo End of 5.0 tests
# This is at the very after the versioned tests, since it involves doing
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index fc3fdc932ba..0faa8e7a785 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -510,7 +510,7 @@ drop table t1;
#
create table t1 (a int, b int);
create view v1 as select a, sum(b) from t1 group by a;
--- error 1176
+--error ER_WRONG_USAGE
select b from v1 use index (some_index) where b=1;
drop view v1;
drop table t1;
@@ -2548,19 +2548,20 @@ CREATE TABLE t1(
fName varchar(25) NOT NULL,
lName varchar(25) NOT NULL,
DOB date NOT NULL,
+ test_date date NOT NULL,
uID int unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY);
-INSERT INTO t1(fName, lName, DOB) VALUES
- ('Hank', 'Hill', '1964-09-29'),
- ('Tom', 'Adams', '1908-02-14'),
- ('Homer', 'Simpson', '1968-03-05');
+INSERT INTO t1(fName, lName, DOB, test_date) VALUES
+ ('Hank', 'Hill', '1964-09-29', '2007-01-01'),
+ ('Tom', 'Adams', '1908-02-14', '2007-01-01'),
+ ('Homer', 'Simpson', '1968-03-05', '2007-01-01');
CREATE VIEW v1 AS
- SELECT (year(now())-year(DOB)) AS Age
+ SELECT (year(test_date)-year(DOB)) AS Age
FROM t1 HAVING Age < 75;
SHOW CREATE VIEW v1;
-SELECT (year(now())-year(DOB)) AS Age FROM t1 HAVING Age < 75;
+SELECT (year(test_date)-year(DOB)) AS Age FROM t1 HAVING Age < 75;
SELECT * FROM v1;
DROP VIEW v1;
@@ -3415,5 +3416,45 @@ select table_name, is_updatable from information_schema.views
drop view v1;
drop table t1;
+#
+# Bug #28701: SELECTs from VIEWs completely ignore USE/FORCE KEY, allowing
+# invalid statements
+#
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE VIEW v1 AS SELECT * FROM t1;
+--error ER_WRONG_USAGE
+SELECT * FROM v1 USE KEY(non_existant);
+--error ER_WRONG_USAGE
+SELECT * FROM v1 FORCE KEY(non_existant);
+--error ER_WRONG_USAGE
+SELECT * FROM v1 IGNORE KEY(non_existant);
+
+DROP VIEW v1;
+DROP TABLE t1;
+
+
+#
+# Bug #28702: VIEWs defined with USE/FORCE KEY ignore that request
+#
+CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b INT NOT NULL DEFAULT 0,
+ PRIMARY KEY(a), KEY (b));
+INSERT INTO t1 VALUES (),(),(),(),(),(),(),(),(),(),(),(),(),(),();
+CREATE VIEW v1 AS SELECT * FROM t1 FORCE KEY (PRIMARY,b) ORDER BY a;
+SHOW CREATE VIEW v1;
+EXPLAIN SELECT * FROM v1;
+CREATE VIEW v2 AS SELECT * FROM t1 USE KEY () ORDER BY a;
+SHOW CREATE VIEW v2;
+EXPLAIN SELECT * FROM v2;
+CREATE VIEW v3 AS SELECT * FROM t1 IGNORE KEY (b) ORDER BY a;
+SHOW CREATE VIEW v3;
+EXPLAIN SELECT * FROM v3;
+
+DROP VIEW v1;
+DROP VIEW v2;
+DROP VIEW v3;
+DROP TABLE t1;
+
--echo End of 5.0 tests.
diff --git a/mysql-test/t/view_grant.test b/mysql-test/t/view_grant.test
index a102f87c4e8..7f9eb4e1cff 100644
--- a/mysql-test/t/view_grant.test
+++ b/mysql-test/t/view_grant.test
@@ -1034,10 +1034,11 @@ GRANT SELECT ON db26813.t1 TO u26813@localhost;
connect (u1,localhost,u26813,,db26813);
connection u1;
---error 1142
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER VIEW v1 AS SELECT f2 FROM t1;
---error 1142
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER VIEW v2 AS SELECT f2 FROM t1;
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER VIEW v3 AS SELECT f2 FROM t1;
connection root;
@@ -1047,6 +1048,51 @@ DROP USER u26813@localhost;
DROP DATABASE db26813;
disconnect u1;
+--echo #
+--echo # Bug#29908: A user can gain additional access through the ALTER VIEW.
+--echo #
+connection root;
+CREATE DATABASE mysqltest_29908;
+USE mysqltest_29908;
+CREATE TABLE t1(f1 INT, f2 INT);
+CREATE USER u29908_1@localhost;
+CREATE DEFINER = u29908_1@localhost VIEW v1 AS SELECT f1 FROM t1;
+CREATE DEFINER = u29908_1@localhost SQL SECURITY INVOKER VIEW v2 AS
+ SELECT f1 FROM t1;
+GRANT DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v1 TO u29908_1@localhost;
+GRANT DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_1@localhost;
+GRANT SELECT ON mysqltest_29908.t1 TO u29908_1@localhost;
+CREATE USER u29908_2@localhost;
+GRANT DROP, CREATE VIEW ON mysqltest_29908.v1 TO u29908_2@localhost;
+GRANT DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_2@localhost;
+GRANT SELECT ON mysqltest_29908.t1 TO u29908_2@localhost;
+
+connect (u2,localhost,u29908_2,,mysqltest_29908);
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+ALTER VIEW v1 AS SELECT f2 FROM t1;
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+ALTER VIEW v2 AS SELECT f2 FROM t1;
+SHOW CREATE VIEW v2;
+
+connect (u1,localhost,u29908_1,,mysqltest_29908);
+ALTER VIEW v1 AS SELECT f2 FROM t1;
+SHOW CREATE VIEW v1;
+ALTER VIEW v2 AS SELECT f2 FROM t1;
+SHOW CREATE VIEW v2;
+
+connection root;
+ALTER VIEW v1 AS SELECT f1 FROM t1;
+SHOW CREATE VIEW v1;
+ALTER VIEW v2 AS SELECT f1 FROM t1;
+SHOW CREATE VIEW v2;
+
+DROP USER u29908_1@localhost;
+DROP USER u29908_2@localhost;
+DROP DATABASE mysqltest_29908;
+disconnect u1;
+disconnect u2;
+--echo #######################################################################
+
#
# BUG#24040: Create View don't succed with "all privileges" on a database.
#
diff --git a/mysql-test/t/windows_shm.test b/mysql-test/t/windows_shm.test
deleted file mode 100644
index 1c6f05f2da0..00000000000
--- a/mysql-test/t/windows_shm.test
+++ /dev/null
@@ -1,9 +0,0 @@
-# Windows-specific tests
---source include/windows.inc
-
-#
-# Bug #24924: shared-memory-base-name that is too long causes buffer overflow
-#
---exec $MYSQLADMIN --no-defaults --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ping
-
---echo End of 5.0 tests.
diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt
index 8aaf0b5f00f..cd3e7afd6a5 100755
--- a/mysys/CMakeLists.txt
+++ b/mysys/CMakeLists.txt
@@ -26,7 +26,7 @@ ADD_LIBRARY(mysys array.c charset-def.c charset.c checksum.c default.c default_m
errors.c hash.c list.c md5.c mf_brkhant.c mf_cache.c mf_dirname.c mf_fn_ext.c
mf_format.c mf_getdate.c mf_iocache.c mf_iocache2.c mf_keycache.c
mf_keycaches.c mf_loadpath.c mf_pack.c mf_path.c mf_qsort.c mf_qsort2.c
- mf_radix.c mf_same.c mf_sort.c mf_soundex.c mf_strip.c mf_tempdir.c
+ mf_radix.c mf_same.c mf_sort.c mf_soundex.c mf_strip.c mf_arr_appstr.c mf_tempdir.c
mf_tempfile.c mf_unixpath.c mf_wcomp.c mf_wfile.c mulalloc.c my_access.c
my_aes.c my_alarm.c my_alloc.c my_append.c my_bit.c my_bitmap.c my_chsize.c
my_clock.c my_compress.c my_conio.c my_copy.c my_crc32.c my_create.c my_delete.c
diff --git a/mysys/Makefile.am b/mysys/Makefile.am
index a835492e670..8c6bf5f7006 100644
--- a/mysys/Makefile.am
+++ b/mysys/Makefile.am
@@ -38,7 +38,7 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.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_pack.c mf_unixpath.c mf_strip.c mf_arr_appstr.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 \
diff --git a/mysys/charset.c b/mysys/charset.c
index 4c3f2d0ab71..d1cca150308 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -810,3 +810,43 @@ ulong escape_quotes_for_mysql(CHARSET_INFO *charset_info,
*to= 0;
return overflow ? (ulong)~0 : (ulong) (to - to_start);
}
+
+
+/**
+ @brief Find compatible character set with ctype.
+
+ @param[in] original_cs Original character set
+
+ @note
+ 128 my_charset_ucs2_general_uca ->192 my_charset_utf8_general_uca_ci
+ 129 my_charset_ucs2_icelandic_uca_ci ->193 my_charset_utf8_icelandic_uca_ci
+ 130 my_charset_ucs2_latvian_uca_ci ->194 my_charset_utf8_latvian_uca_ci
+ 131 my_charset_ucs2_romanian_uca_ci ->195 my_charset_utf8_romanian_uca_ci
+ 132 my_charset_ucs2_slovenian_uca_ci ->196 my_charset_utf8_slovenian_uca_ci
+ 133 my_charset_ucs2_polish_uca_ci ->197 my_charset_utf8_polish_uca_ci
+ 134 my_charset_ucs2_estonian_uca_ci ->198 my_charset_utf8_estonian_uca_ci
+ 135 my_charset_ucs2_spanish_uca_ci ->199 my_charset_utf8_spanish_uca_ci
+ 136 my_charset_ucs2_swedish_uca_ci ->200 my_charset_utf8_swedish_uca_ci
+ 137 my_charset_ucs2_turkish_uca_ci ->201 my_charset_utf8_turkish_uca_ci
+ 138 my_charset_ucs2_czech_uca_ci ->202 my_charset_utf8_czech_uca_ci
+ 139 my_charset_ucs2_danish_uca_ci ->203 my_charset_utf8_danish_uca_ci
+ 140 my_charset_ucs2_lithuanian_uca_ci->204 my_charset_utf8_lithuanian_uca_ci
+ 141 my_charset_ucs2_slovak_uca_ci ->205 my_charset_utf8_slovak_uca_ci
+ 142 my_charset_ucs2_spanish2_uca_ci ->206 my_charset_utf8_spanish2_uca_ci
+ 143 my_charset_ucs2_roman_uca_ci ->207 my_charset_utf8_roman_uca_ci
+ 144 my_charset_ucs2_persian_uca_ci ->208 my_charset_utf8_persian_uca_ci
+
+ @return Compatible character set or NULL.
+*/
+
+CHARSET_INFO *get_compatible_charset_with_ctype(CHARSET_INFO *original_cs)
+{
+ CHARSET_INFO *compatible_cs= 0;
+ DBUG_ENTER("get_compatible_charset_with_ctype");
+ if (!strcmp(original_cs->csname, "ucs2") &&
+ (compatible_cs= get_charset(original_cs->number + 64, MYF(0))) &&
+ (!compatible_cs->ctype ||
+ strcmp(original_cs->name + 4, compatible_cs->name + 4)))
+ compatible_cs= 0;
+ DBUG_RETURN(compatible_cs);
+}
diff --git a/mysys/default.c b/mysys/default.c
index aff38b6af0b..e58903d6d64 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -47,7 +47,7 @@ char *my_defaults_extra_file=0;
/* Which directories are searched for options (and in which order) */
-#define MAX_DEFAULT_DIRS 7
+#define MAX_DEFAULT_DIRS 6
const char *default_directories[MAX_DEFAULT_DIRS + 1];
#ifdef __WIN__
@@ -83,7 +83,22 @@ static int search_default_file_with_ext(Process_option_func func,
void *func_ctx,
const char *dir, const char *ext,
const char *config_file, int recursion_level);
-static void init_default_directories();
+
+
+
+/**
+ Create the list of default directories.
+
+ @details
+ On all systems, if a directory is already in the list, it will be moved
+ to the end of the list. This avoids reading defaults files multiple times,
+ while ensuring the correct precedence.
+
+ @return void
+*/
+
+static void (*init_default_directories)();
+
static char *remove_end_comment(char *ptr);
@@ -913,6 +928,34 @@ void print_defaults(const char *conf_file, const char **groups)
#include <help_end.h>
+/*
+ This extra complexity is to avoid declaring 'rc' if it won't be
+ used.
+*/
+#define ADD_DIRECTORY_INTERNAL(DIR) \
+ array_append_string_unique((DIR), default_directories, \
+ array_elements(default_directories))
+#ifdef DBUG_OFF
+# define ADD_DIRECTORY(DIR) (void) ADD_DIRECTORY_INTERNAL(DIR)
+#else
+#define ADD_DIRECTORY(DIR) \
+ do { \
+ my_bool rc= ADD_DIRECTORY_INTERNAL(DIR); \
+ DBUG_ASSERT(rc == FALSE); /* Success */ \
+ } while (0)
+#endif
+
+
+#define ADD_COMMON_DIRECTORIES() \
+ do { \
+ char *env; \
+ if ((env= getenv(STRINGIFY_ARG(DEFAULT_HOME_ENV)))) \
+ ADD_DIRECTORY(env); \
+ /* Placeholder for --defaults-extra-file=<path> */ \
+ ADD_DIRECTORY(""); \
+ } while (0)
+
+
#ifdef __WIN__
/*
This wrapper for GetSystemWindowsDirectory() will dynamically bind to the
@@ -947,73 +990,33 @@ static uint my_get_system_windows_directory(char *buffer, uint size)
}
return count;
}
-#endif
-/*
- Create the list of default directories.
+/**
+ Initialize default directories for Microsoft Windows
- On Microsoft Windows, this is:
- 1. C:/
+ @details
+ 1. GetSystemWindowsDirectory()
2. GetWindowsDirectory()
- 3. GetSystemWindowsDirectory()
- 4. getenv(DEFAULT_HOME_ENV)
- 5. Directory above where the executable is located
- 6. ""
- 7. --sysconfdir=<path>
-
- On Novell NetWare, this is:
- 1. sys:/etc/
- 2. getenv(DEFAULT_HOME_ENV)
- 3. ""
- 4. --sysconfdir=<path>
-
- On OS/2, this is:
- 1. getenv(ETC)
- 2. /etc/
- 3. getenv(DEFAULT_HOME_ENV)
- 4. ""
- 5. "~/"
- 6. --sysconfdir=<path>
-
- Everywhere else, this is:
- 1. /etc/
- 2. getenv(DEFAULT_HOME_ENV)
- 3. ""
- 4. "~/"
- 5. --sysconfdir=<path>
-
- */
+ 3. C:/
+ 4. Directory above where the executable is located
+ 5. getenv(DEFAULT_HOME_ENV)
+ 6. --defaults-extra-file=<path> (run-time option)
+*/
-static void init_default_directories()
+static void init_default_directories_win()
{
- const char *env, **ptr= default_directories;
+ bzero((char *) default_directories, sizeof(default_directories));
-#ifdef __WIN__
- *ptr++= "C:/";
+ if (my_get_system_windows_directory(shared_system_dir,
+ sizeof(shared_system_dir)))
+ ADD_DIRECTORY(shared_system_dir);
if (GetWindowsDirectory(system_dir,sizeof(system_dir)))
- *ptr++= (char*)&system_dir;
- if (my_get_system_windows_directory(shared_system_dir,
- sizeof(shared_system_dir)) &&
- strcmp(system_dir, shared_system_dir))
- *ptr++= (char *)&shared_system_dir;
+ ADD_DIRECTORY(system_dir);
+
+ ADD_DIRECTORY("C:/");
-#elif defined(__NETWARE__)
- *ptr++= "sys:/etc/";
-#else
-#if defined(__EMX__) || defined(OS2)
- if ((env= getenv("ETC")))
- *ptr++= env;
-#endif
- *ptr++= "/etc/";
-#endif
- if ((env= getenv(STRINGIFY_ARG(DEFAULT_HOME_ENV))))
- *ptr++= env;
- *ptr++= ""; /* Place for defaults_extra_file */
-#if !defined(__WIN__) && !defined(__NETWARE__)
- *ptr++= "~/";;
-#elif defined(__WIN__)
if (GetModuleFileName(NULL, config_dir, sizeof(config_dir)))
{
char *last= NULL, *end= strend(config_dir);
@@ -1043,12 +1046,84 @@ static void init_default_directories()
last= end;
}
}
- *ptr++= (char *)&config_dir;
+ ADD_DIRECTORY(config_dir);
}
-#endif
+
+ ADD_COMMON_DIRECTORIES();
+}
+
+static void (*init_default_directories)()= init_default_directories_win;
+
+#elif defined(__NETWARE__)
+
+/**
+ Initialize default directories for Novell Netware
+
+ @details
+ 1. sys:/etc/
+ 2. getenv(DEFAULT_HOME_ENV)
+ 3. --defaults-extra-file=<path> (run-time option)
+*/
+
+static void init_default_directories_netware()
+{
+ bzero((char *) default_directories, sizeof(default_directories));
+ ADD_DIRECTORY("sys:/etc/");
+ ADD_COMMON_DIRECTORIES();
+}
+
+static void (*init_default_directories)()= init_default_directories_netware;
+
+#elif defined(__EMX__) || defined(OS2)
+
+/**
+ Initialize default directories for OS/2
+
+ @details
+ 1. /etc/
+ 2. getenv(ETC)
+ 3. getenv(DEFAULT_HOME_ENV)
+ 4. --defaults-extra-file=<path> (run-time option)
+*/
+
+static void init_default_directories_os2()
+{
+ const char *env;
+
+ bzero((char *) default_directories, sizeof(default_directories));
+ ADD_DIRECTORY("/etc/");
+ if ((env= getenv("ETC")))
+ ADD_DIRECTORY(env);
+ ADD_COMMON_DIRECTORIES();
+}
+
+static void (*init_default_directories)()= init_default_directories_os2;
+
+#else
+
+/**
+ Initialize default directories for Unix
+
+ @details
+ 1. /etc/
+ 2. --sysconfdir=<path> (compile-time option)
+ 3. getenv(DEFAULT_HOME_ENV)
+ 4. --defaults-extra-file=<path> (run-time option)
+ 5. "~/"
+*/
+
+static void init_default_directories_unix()
+{
+ bzero((char *) default_directories, sizeof(default_directories));
+ ADD_DIRECTORY("/etc/");
#ifdef DEFAULT_SYSCONFDIR
if (DEFAULT_SYSCONFDIR != "")
- *ptr++= DEFAULT_SYSCONFDIR;
+ ADD_DIRECTORY(DEFAULT_SYSCONFDIR);
#endif
- *ptr= 0; /* end marker */
+ ADD_COMMON_DIRECTORIES();
+ ADD_DIRECTORY("~/");
}
+
+static void (*init_default_directories)()= init_default_directories_unix;
+
+#endif
diff --git a/mysys/mf_arr_appstr.c b/mysys/mf_arr_appstr.c
new file mode 100644
index 00000000000..1edbea9df4a
--- /dev/null
+++ b/mysys/mf_arr_appstr.c
@@ -0,0 +1,61 @@
+/* Copyright (C) 2007 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include "mysys_priv.h"
+#include <m_string.h> /* strcmp() */
+
+
+/**
+ Append str to array, or move to the end if it already exists
+
+ @param str String to be appended
+ @param array The array, terminated by a NULL element, all unused elements
+ pre-initialized to NULL
+ @param size Size of the array; array must be terminated by a NULL
+ pointer, so can hold size - 1 elements
+
+ @retval FALSE Success
+ @retval TRUE Failure, array is full
+*/
+
+my_bool array_append_string_unique(const char *str,
+ const char **array, size_t size)
+{
+ const char **p;
+ /* end points at the terminating NULL element */
+ const char **end= array + size - 1;
+ DBUG_ASSERT(*end == NULL);
+
+ for (p= array; *p; ++p)
+ {
+ if (strcmp(*p, str) == 0)
+ break;
+ }
+ if (p >= end)
+ return TRUE; /* Array is full */
+
+ DBUG_ASSERT(*p == NULL || strcmp(*p, str) == 0);
+
+ while (*(p + 1))
+ {
+ *p= *(p + 1);
+ ++p;
+ }
+
+ DBUG_ASSERT(p < end);
+ *p= str;
+
+ return FALSE; /* Success */
+}
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index af910678a1f..baf3bffccb8 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -301,10 +301,11 @@ static uint next_power(uint value)
*/
int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
- ulong use_mem, uint division_limit,
- uint age_threshold)
+ size_t use_mem, uint division_limit,
+ uint age_threshold)
{
- uint blocks, hash_links, length;
+ ulong blocks, hash_links;
+ size_t length;
int error;
DBUG_ENTER("init_key_cache");
DBUG_ASSERT(key_cache_block_size >= 512);
@@ -332,8 +333,8 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
DBUG_PRINT("info", ("key_cache_block_size: %u",
key_cache_block_size));
- blocks= (uint) (use_mem / (sizeof(BLOCK_LINK) + 2 * sizeof(HASH_LINK) +
- sizeof(HASH_LINK*) * 5/4 + key_cache_block_size));
+ blocks= (ulong) (use_mem / (sizeof(BLOCK_LINK) + 2 * sizeof(HASH_LINK) +
+ sizeof(HASH_LINK*) * 5/4 + key_cache_block_size));
/* It doesn't make sense to have too few blocks (less than 8) */
if (blocks >= 8 && keycache->disk_blocks < 0)
{
@@ -351,18 +352,18 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
ALIGN_SIZE(hash_links * sizeof(HASH_LINK)) +
ALIGN_SIZE(sizeof(HASH_LINK*) *
keycache->hash_entries))) +
- ((ulong) blocks * keycache->key_cache_block_size) > use_mem)
+ ((size_t) blocks * keycache->key_cache_block_size) > use_mem)
blocks--;
/* Allocate memory for cache page buffers */
if ((keycache->block_mem=
- my_large_malloc((ulong) blocks * keycache->key_cache_block_size,
- MYF(MY_WME))))
+ my_large_malloc((size_t) blocks * keycache->key_cache_block_size,
+ MYF(MY_WME))))
{
/*
Allocate memory for blocks, hash_links and hash entries;
For each block 2 hash links are allocated
*/
- if ((keycache->block_root= (BLOCK_LINK*) my_malloc((uint) length,
+ if ((keycache->block_root= (BLOCK_LINK*) my_malloc(length,
MYF(0))))
break;
my_large_free(keycache->block_mem, MYF(0));
@@ -375,7 +376,7 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
}
blocks= blocks / 4*3;
}
- keycache->blocks_unused= (ulong) blocks;
+ keycache->blocks_unused= blocks;
keycache->disk_blocks= (int) blocks;
keycache->hash_links= hash_links;
keycache->hash_root= (HASH_LINK**) ((char*) keycache->block_root +
@@ -480,8 +481,8 @@ err:
*/
int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
- ulong use_mem, uint division_limit,
- uint age_threshold)
+ size_t use_mem, uint division_limit,
+ uint age_threshold)
{
int blocks;
struct st_my_thread_var *thread;
@@ -2267,7 +2268,7 @@ static int flush_cached_blocks(KEY_CACHE *keycache,
As all blocks referred in 'cache' are marked by BLOCK_IN_FLUSH
we are guarunteed no thread will change them
*/
- qsort((byte*) cache, count, sizeof(*cache), (qsort_cmp) cmp_sec_link);
+ my_qsort((byte*) cache, count, sizeof(*cache), (qsort_cmp) cmp_sec_link);
keycache_pthread_mutex_lock(&keycache->cache_lock);
for ( ; cache != end ; cache++)
diff --git a/mysys/mf_qsort.c b/mysys/mf_qsort.c
index 3d52d56c952..4b3ecb603a6 100644
--- a/mysys/mf_qsort.c
+++ b/mysys/mf_qsort.c
@@ -91,10 +91,10 @@ typedef struct st_stack
*****************************************************************************/
#ifdef QSORT_EXTRA_CMP_ARGUMENT
-qsort_t qsort2(void *base_ptr, size_t count, size_t size, qsort2_cmp cmp,
+qsort_t my_qsort2(void *base_ptr, size_t count, size_t size, qsort2_cmp cmp,
void *cmp_argument)
#else
-qsort_t qsort(void *base_ptr, size_t count, size_t size, qsort_cmp cmp)
+qsort_t my_qsort(void *base_ptr, size_t count, size_t size, qsort_cmp cmp)
#endif
{
char *low, *high, *pivot;
diff --git a/mysys/mf_sort.c b/mysys/mf_sort.c
index e7fd6873eee..a0c74642cb0 100644
--- a/mysys/mf_sort.c
+++ b/mysys/mf_sort.c
@@ -35,7 +35,7 @@ void my_string_ptr_sort(void *base, uint items, size_s size)
if (size && items)
{
uint size_arg=size;
- qsort2(base,items,sizeof(byte*),get_ptr_compare(size),(void*) &size_arg);
+ my_qsort2(base,items,sizeof(byte*),get_ptr_compare(size),(void*) &size_arg);
}
}
}
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index 623c48b2e55..71630e1b4c2 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -19,6 +19,7 @@
#include <my_sys.h>
#include <mysys_err.h>
#include <my_getopt.h>
+#include <errno.h>
static void default_reporter(enum loglevel level, const char *format, ...);
my_error_reporter my_getopt_error_reporter= &default_reporter;
@@ -693,7 +694,15 @@ static longlong eval_num_suffix (char *argument, int *error, char *option_name)
longlong num;
*error= 0;
+ errno= 0;
num= strtoll(argument, &endchar, 10);
+ if (errno == ERANGE)
+ {
+ my_getopt_error_reporter(ERROR_LEVEL,
+ "Incorrect integer value: '%s'", argument);
+ *error= 1;
+ return 0;
+ }
if (*endchar == 'k' || *endchar == 'K')
num*= 1024L;
else if (*endchar == 'm' || *endchar == 'M')
@@ -730,7 +739,14 @@ static longlong getopt_ll(char *arg, const struct my_option *optp, int *err)
num= eval_num_suffix(arg, err, (char*) optp->name);
if (num > 0 && (ulonglong) num > (ulonglong) optp->max_value &&
optp->max_value) /* if max value is not set -> no upper limit */
+ {
+ char buf[22];
+ my_getopt_error_reporter(WARNING_LEVEL,
+ "Truncated incorrect %s value: '%s'",
+ optp->name, llstr(num, buf));
+
num= (ulonglong) optp->max_value;
+ }
num= ((num - optp->sub_size) / block_size);
num= (longlong) (num * block_size);
return max(num, optp->min_value);
diff --git a/mysys/my_init.c b/mysys/my_init.c
index 32d3f07fd31..8154a5fce51 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -286,7 +286,7 @@ int handle_rtc_failure(int err_type, const char *file, int line,
return 0; /* Error is handled */
}
-#pragma runtime_checks("", on)
+#pragma runtime_checks("", restore)
#endif
diff --git a/mysys/my_largepage.c b/mysys/my_largepage.c
index 9714c582acb..082b6368a64 100644
--- a/mysys/my_largepage.c
+++ b/mysys/my_largepage.c
@@ -26,7 +26,7 @@
#endif
static uint my_get_large_page_size_int(void);
-static gptr my_large_malloc_int(uint size, myf my_flags);
+static gptr my_large_malloc_int(size_t size, myf my_flags);
static my_bool my_large_free_int(gptr ptr, myf my_flags);
/* Gets the size of large pages from the OS */
@@ -48,7 +48,7 @@ uint my_get_large_page_size(void)
my_malloc_lock() in case of failure
*/
-gptr my_large_malloc(uint size, myf my_flags)
+gptr my_large_malloc(size_t size, myf my_flags)
{
gptr ptr;
DBUG_ENTER("my_large_malloc");
@@ -113,7 +113,7 @@ finish:
#if HAVE_DECL_SHM_HUGETLB
/* Linux-specific large pages allocator */
-gptr my_large_malloc_int(uint size, myf my_flags)
+gptr my_large_malloc_int(size_t size, myf my_flags)
{
int shmid;
gptr ptr;
@@ -123,13 +123,13 @@ gptr my_large_malloc_int(uint size, myf my_flags)
/* Align block size to my_large_page_size */
size = ((size - 1) & ~(my_large_page_size - 1)) + my_large_page_size;
- shmid = shmget(IPC_PRIVATE, (size_t)size, SHM_HUGETLB | SHM_R | SHM_W);
+ shmid = shmget(IPC_PRIVATE, size, SHM_HUGETLB | SHM_R | SHM_W);
if (shmid < 0)
{
if (my_flags & MY_WME)
fprintf(stderr,
- "Warning: Failed to allocate %d bytes from HugeTLB memory."
- " errno %d\n", size, errno);
+ "Warning: Failed to allocate %lu bytesx from HugeTLB memory."
+ " errno %d\n", (ulong) size, errno);
DBUG_RETURN(NULL);
}
diff --git a/mysys/my_lib.c b/mysys/my_lib.c
index 61de4ff9065..a076a0c971d 100644
--- a/mysys/my_lib.c
+++ b/mysys/my_lib.c
@@ -187,7 +187,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
result->number_off_files= dir_entries_storage->elements;
if (!(MyFlags & MY_DONT_SORT))
- qsort((void *) result->dir_entry, result->number_off_files,
+ my_qsort((void *) result->dir_entry, result->number_off_files,
sizeof(FILEINFO), (qsort_cmp) comp_names);
DBUG_RETURN(result);
@@ -498,7 +498,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
result->number_off_files= dir_entries_storage->elements;
if (!(MyFlags & MY_DONT_SORT))
- qsort((void *) result->dir_entry, result->number_off_files,
+ my_qsort((void *) result->dir_entry, result->number_off_files,
sizeof(FILEINFO), (qsort_cmp) comp_names);
DBUG_PRINT("exit", ("found %d files", result->number_off_files));
DBUG_RETURN(result);
@@ -605,7 +605,7 @@ MY_DIR *my_dir(const char* path, myf MyFlags)
result->number_off_files= dir_entries_storage->elements;
if (!(MyFlags & MY_DONT_SORT))
- qsort((void *) result->dir_entry, result->number_off_files,
+ my_qsort((void *) result->dir_entry, result->number_off_files,
sizeof(FILEINFO), (qsort_cmp) comp_names);
DBUG_RETURN(result);
diff --git a/mysys/my_malloc.c b/mysys/my_malloc.c
index 38d0263b495..256b14a9605 100644
--- a/mysys/my_malloc.c
+++ b/mysys/my_malloc.c
@@ -23,11 +23,11 @@
/* My memory allocator */
-gptr my_malloc(unsigned int size, myf my_flags)
+gptr my_malloc(size_t size, myf my_flags)
{
gptr point;
DBUG_ENTER("my_malloc");
- DBUG_PRINT("my",("size: %u my_flags: %d",size, my_flags));
+ DBUG_PRINT("my",("size: %lu my_flags: %d", (ulong) size, my_flags));
if (!size)
size=1; /* Safety */
@@ -63,11 +63,11 @@ void my_no_flags_free(gptr ptr)
/* malloc and copy */
-gptr my_memdup(const byte *from, uint length, myf my_flags)
+gptr my_memdup(const byte *from, size_t length, myf my_flags)
{
gptr ptr;
if ((ptr=my_malloc(length,my_flags)) != 0)
- memcpy((byte*) ptr, (byte*) from,(size_t) length);
+ memcpy((byte*) ptr, (byte*)from, length);
return(ptr);
}
@@ -75,19 +75,19 @@ gptr my_memdup(const byte *from, uint length, myf my_flags)
char *my_strdup(const char *from, myf my_flags)
{
gptr ptr;
- uint length=(uint) strlen(from)+1;
+ size_t length= strlen(from)+1;
if ((ptr=my_malloc(length,my_flags)) != 0)
- memcpy((byte*) ptr, (byte*) from,(size_t) length);
+ memcpy((byte*) ptr, (byte*) from, length);
return((my_string) ptr);
}
-char *my_strdup_with_length(const char *from, uint length, myf my_flags)
+char *my_strdup_with_length(const char *from, size_t length, myf my_flags)
{
gptr ptr;
if ((ptr=my_malloc(length+1,my_flags)) != 0)
{
- memcpy((byte*) ptr, (byte*) from,(size_t) length);
+ memcpy((byte*) ptr, (byte*) from, length);
((char*) ptr)[length]=0;
}
return((char*) ptr);
diff --git a/mysys/my_winthread.c b/mysys/my_winthread.c
index 27ccaef4f23..e94369bec32 100644
--- a/mysys/my_winthread.c
+++ b/mysys/my_winthread.c
@@ -40,6 +40,29 @@ void win_pthread_init(void)
pthread_mutex_init(&THR_LOCK_thread,MY_MUTEX_INIT_FAST);
}
+
+/**
+ Adapter to @c pthread_mutex_trylock()
+
+ @retval 0 Mutex was acquired
+ @retval EBUSY Mutex was already locked by a thread
+ */
+int
+win_pthread_mutex_trylock(pthread_mutex_t *mutex)
+{
+ if (TryEnterCriticalSection(mutex))
+ {
+ /* Don't allow recursive lock */
+ if (mutex->RecursionCount > 1){
+ LeaveCriticalSection(mutex);
+ return EBUSY;
+ }
+ return 0;
+ }
+ return EBUSY;
+}
+
+
/*
** We have tried to use '_beginthreadex' instead of '_beginthread' here
** but in this case the program leaks about 512 characters for each
diff --git a/mysys/my_write.c b/mysys/my_write.c
index 4c3d187e4e8..9ff7babab31 100644
--- a/mysys/my_write.c
+++ b/mysys/my_write.c
@@ -29,6 +29,10 @@ uint my_write(int Filedes, const byte *Buffer, uint Count, myf MyFlags)
Filedes, (long) Buffer, Count, MyFlags));
errors=0; written=0L;
+ /* The behavior of write(fd, buf, 0) is not portable */
+ if (unlikely(!Count))
+ DBUG_RETURN(0);
+
for (;;)
{
if ((writenbytes = (uint) write(Filedes, Buffer, Count)) == Count)
diff --git a/mysys/queues.c b/mysys/queues.c
index 7809c97131c..6b88420a1cd 100644
--- a/mysys/queues.c
+++ b/mysys/queues.c
@@ -250,6 +250,6 @@ static int queue_fix_cmp(QUEUE *queue, void **a, void **b)
void queue_fix(QUEUE *queue)
{
- qsort2(queue->root+1,queue->elements, sizeof(void *),
- (qsort2_cmp)queue_fix_cmp, queue);
+ my_qsort2(queue->root+1,queue->elements, sizeof(void *),
+ (qsort2_cmp)queue_fix_cmp, queue);
}
diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c
index a7d8f372151..1cdbd1ecbf2 100644
--- a/mysys/safemalloc.c
+++ b/mysys/safemalloc.c
@@ -119,12 +119,12 @@ static int _checkchunk(struct st_irem *pRec, const char *sFile, uint uLine);
/* Allocate some memory. */
-gptr _mymalloc(uint size, const char *filename, uint lineno, myf MyFlags)
+gptr _mymalloc(size_t size, const char *filename, uint lineno, myf MyFlags)
{
struct st_irem *irem;
char *data;
DBUG_ENTER("_mymalloc");
- DBUG_PRINT("enter",("Size: %u",size));
+ DBUG_PRINT("enter",("Size: %lu", (ulong) size));
if (!sf_malloc_quick)
(void) _sanity (filename, lineno);
@@ -151,8 +151,8 @@ gptr _mymalloc(uint size, const char *filename, uint lineno, myf MyFlags)
my_errno=errno;
sprintf(buff,"Out of memory at line %d, '%s'", lineno, filename);
my_message(EE_OUTOFMEMORY, buff, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH));
- sprintf(buff,"needed %d byte (%ldk), memory in use: %ld bytes (%ldk)",
- size, (size + 1023L) / 1024L,
+ sprintf(buff,"needed %u byte (%ldk), memory in use: %ld bytes (%ldk)",
+ (uint) size, (uint) (size + 1023L) / 1024L,
sf_malloc_max_memory, (sf_malloc_max_memory + 1023L) / 1024L);
my_message(EE_OUTOFMEMORY, buff, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH));
}
@@ -207,8 +207,8 @@ gptr _mymalloc(uint size, const char *filename, uint lineno, myf MyFlags)
Free then old memoryblock
*/
-gptr _myrealloc(register gptr ptr, register uint size,
- const char *filename, uint lineno, myf MyFlags)
+gptr _myrealloc(register gptr ptr, register size_t size,
+ const char *filename, uint lineno, myf MyFlags)
{
struct st_irem *irem;
char *data;
@@ -373,8 +373,7 @@ void TERMINATE(FILE *file)
{
if (file)
{
- fprintf(file, "Warning: Not freed memory segments: %u\n",
- sf_malloc_count);
+ fprintf(file, "Warning: Not freed memory segments: %u\n", sf_malloc_count);
(void) fflush(file);
}
DBUG_PRINT("safe",("sf_malloc_count: %u", sf_malloc_count));
@@ -503,8 +502,8 @@ int _sanity(const char *filename, uint lineno)
/* malloc and copy */
-gptr _my_memdup(const byte *from, uint length, const char *filename,
- uint lineno, myf MyFlags)
+gptr _my_memdup(const byte *from, size_t length, const char *filename,
+ uint lineno, myf MyFlags)
{
gptr ptr;
if ((ptr=_mymalloc(length,filename,lineno,MyFlags)) != 0)
@@ -517,16 +516,16 @@ char *_my_strdup(const char *from, const char *filename, uint lineno,
myf MyFlags)
{
gptr ptr;
- uint length=(uint) strlen(from)+1;
+ size_t length= strlen(from)+1;
if ((ptr=_mymalloc(length,filename,lineno,MyFlags)) != 0)
memcpy((byte*) ptr, (byte*) from,(size_t) length);
return((char*) ptr);
} /* _my_strdup */
-char *_my_strdup_with_length(const char *from, uint length,
- const char *filename, uint lineno,
- myf MyFlags)
+char *_my_strdup_with_length(const char *from, size_t length,
+ const char *filename, uint lineno,
+ myf MyFlags)
{
gptr ptr;
if ((ptr=_mymalloc(length+1,filename,lineno,MyFlags)) != 0)
diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c
index 425e5fce459..53ee907e0a3 100644
--- a/mysys/thr_mutex.c
+++ b/mysys/thr_mutex.c
@@ -91,7 +91,7 @@ int safe_mutex_init(safe_mutex_t *mp,
}
-int safe_mutex_lock(safe_mutex_t *mp,const char *file, uint line)
+int safe_mutex_lock(safe_mutex_t *mp, my_bool try_lock, const char *file, uint line)
{
int error;
if (!mp->file)
@@ -104,15 +104,50 @@ int safe_mutex_lock(safe_mutex_t *mp,const char *file, uint line)
}
pthread_mutex_lock(&mp->global);
- if (mp->count > 0 && pthread_equal(pthread_self(),mp->thread))
+ if (mp->count > 0)
{
- fprintf(stderr,"safe_mutex: Trying to lock mutex at %s, line %d, when the mutex was already locked at %s, line %d in thread %s\n",
- file,line,mp->file, mp->line, my_thread_name());
- fflush(stderr);
- abort();
+ if (try_lock)
+ {
+ pthread_mutex_unlock(&mp->global);
+ return EBUSY;
+ }
+ else if (pthread_equal(pthread_self(),mp->thread))
+ {
+ fprintf(stderr,
+ "safe_mutex: Trying to lock mutex at %s, line %d, when the"
+ " mutex was already locked at %s, line %d in thread %s\n",
+ file,line,mp->file, mp->line, my_thread_name());
+ fflush(stderr);
+ abort();
+ }
}
pthread_mutex_unlock(&mp->global);
- error=pthread_mutex_lock(&mp->mutex);
+
+ /*
+ If we are imitating trylock(), we need to take special
+ precautions.
+
+ - We cannot use pthread_mutex_lock() only since another thread can
+ overtake this thread and take the lock before this thread
+ causing pthread_mutex_trylock() to hang. In this case, we should
+ just return EBUSY. Hence, we use pthread_mutex_trylock() to be
+ able to return immediately.
+
+ - We cannot just use trylock() and continue execution below, since
+ this would generate an error and abort execution if the thread
+ was overtaken and trylock() returned EBUSY . In this case, we
+ instead just return EBUSY, since this is the expected behaviour
+ of trylock().
+ */
+ if (try_lock)
+ {
+ error= pthread_mutex_trylock(&mp->mutex);
+ if (error == EBUSY)
+ return error;
+ }
+ else
+ error= pthread_mutex_lock(&mp->mutex);
+
if (error || (error=pthread_mutex_lock(&mp->global)))
{
fprintf(stderr,"Got error %d when trying to lock mutex at %s, line %d\n",
diff --git a/ndb/include/kernel/AttributeHeader.hpp b/ndb/include/kernel/AttributeHeader.hpp
index 448952a0780..1d07d8fef2d 100644
--- a/ndb/include/kernel/AttributeHeader.hpp
+++ b/ndb/include/kernel/AttributeHeader.hpp
@@ -41,8 +41,7 @@ public:
STATIC_CONST( FRAGMENT_MEMORY= 0xFFF9 );
/** Initialize AttributeHeader at location aHeaderPtr */
- static AttributeHeader& init(void* aHeaderPtr, Uint32 anAttributeId,
- Uint32 aDataSize);
+ static void init(Uint32* aHeaderPtr, Uint32 anAttributeId, Uint32 aDataSize);
/** Returns size of AttributeHeader (usually one or two words) */
Uint32 getHeaderSize() const; // In 32-bit words
@@ -100,10 +99,11 @@ public:
*/
inline
-AttributeHeader& AttributeHeader::init(void* aHeaderPtr, Uint32 anAttributeId,
- Uint32 aDataSize)
+void AttributeHeader::init(Uint32* aHeaderPtr, Uint32 anAttributeId,
+ Uint32 aDataSize)
{
- return * new (aHeaderPtr) AttributeHeader(anAttributeId, aDataSize);
+ AttributeHeader ah(anAttributeId, aDataSize);
+ *aHeaderPtr = ah.m_value;
}
inline
diff --git a/ndb/include/kernel/signaldata/ScanTab.hpp b/ndb/include/kernel/signaldata/ScanTab.hpp
index 15a022e2cba..38ec4cccf7b 100644
--- a/ndb/include/kernel/signaldata/ScanTab.hpp
+++ b/ndb/include/kernel/signaldata/ScanTab.hpp
@@ -46,6 +46,7 @@ public:
* Length of signal
*/
STATIC_CONST( StaticLength = 11 );
+ STATIC_CONST( MaxTotalAttrInfo = 0xFFFF );
private:
diff --git a/ndb/include/ndbapi/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp
index f83db77739e..5f0da6ea83d 100644
--- a/ndb/include/ndbapi/Ndb.hpp
+++ b/ndb/include/ndbapi/Ndb.hpp
@@ -17,7 +17,7 @@
@mainpage NDB API Programmers' Guide
This guide assumes a basic familiarity with MySQL Cluster concepts found
- on http://dev.mysql.com/doc/mysql/en/NDBCluster.html .
+ on http://dev.mysql.com/doc/mysql/en/mysql-cluster.html.
Some of the fundamental ones are also described in section @ref secConcepts.
The NDB API is a MySQL Cluster application interface
@@ -1052,6 +1052,7 @@ class Ndb
friend class NdbDictInterface;
friend class NdbBlob;
friend class NdbImpl;
+ friend class NdbScanFilterImpl;
#endif
public:
diff --git a/ndb/include/ndbapi/NdbScanFilter.hpp b/ndb/include/ndbapi/NdbScanFilter.hpp
index 1ef62558560..02fcb6215ba 100644
--- a/ndb/include/ndbapi/NdbScanFilter.hpp
+++ b/ndb/include/ndbapi/NdbScanFilter.hpp
@@ -17,6 +17,7 @@
#define NDB_SCAN_FILTER_HPP
#include <ndb_types.h>
+#include <ndbapi_limits.h>
/**
* @class NdbScanFilter
@@ -31,8 +32,13 @@ public:
/**
* Constructor
* @param op The NdbOperation that the filter belongs to (is applied to).
+ * @param abort_on_too_large abort transaction on filter too large
+ * default: true
+ * @param max_size Maximum size of generated filter in words
*/
- NdbScanFilter(class NdbOperation * op);
+ NdbScanFilter(class NdbOperation * op,
+ bool abort_on_too_large = true,
+ Uint32 max_size = NDB_MAX_SCANFILTER_SIZE_IN_WORDS);
~NdbScanFilter();
/**
@@ -166,6 +172,25 @@ public:
/** @} *********************************************************************/
#endif
+ enum Error {
+ FilterTooLarge = 4294
+ };
+
+ /**
+ * Get filter level error.
+ *
+ * Most errors are set only on operation level, and they abort the
+ * transaction. The error FilterTooLarge is set on filter level and
+ * by default it propagates to operation level and also aborts the
+ * transaction.
+ *
+ * If option abort_on_too_large is set to false, then FilterTooLarge
+ * does not propagate. One can then either ignore this error (in
+ * which case no filtering is done) or try to define a new filter
+ * immediately.
+ */
+ const class NdbError & getNdbError() const;
+
private:
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class NdbScanFilterImpl;
diff --git a/ndb/include/ndbapi/ndbapi_limits.h b/ndb/include/ndbapi/ndbapi_limits.h
index 63399e4bd0a..e283913d059 100644
--- a/ndb/include/ndbapi/ndbapi_limits.h
+++ b/ndb/include/ndbapi/ndbapi_limits.h
@@ -26,4 +26,6 @@
#define NDB_MAX_TUPLE_SIZE (NDB_MAX_TUPLE_SIZE_IN_WORDS*4)
#define NDB_MAX_ACTIVE_EVENTS 100
+#define NDB_MAX_SCANFILTER_SIZE_IN_WORDS 50000
+
#endif
diff --git a/ndb/include/util/ndb_rand.h b/ndb/include/util/ndb_rand.h
new file mode 100644
index 00000000000..1521ca9c4ff
--- /dev/null
+++ b/ndb/include/util/ndb_rand.h
@@ -0,0 +1,33 @@
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#ifndef NDB_RAND_H
+#define NDB_RAND_H
+
+#define NDB_RAND_MAX 32767
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int ndb_rand(void);
+
+void ndb_srand(unsigned seed);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ndb/src/common/util/Makefile.am b/ndb/src/common/util/Makefile.am
index 4cc2e49f9ec..dc83a70990f 100644
--- a/ndb/src/common/util/Makefile.am
+++ b/ndb/src/common/util/Makefile.am
@@ -24,7 +24,8 @@ libgeneral_la_SOURCES = \
uucode.c random.c version.c \
strdup.c \
ConfigValues.cpp ndb_init.c basestring_vsnprintf.c \
- Bitmask.cpp
+ Bitmask.cpp \
+ ndb_rand.c
EXTRA_PROGRAMS = testBitmask
testBitmask_SOURCES = testBitmask.cpp
diff --git a/ndb/src/common/util/ndb_rand.c b/ndb/src/common/util/ndb_rand.c
new file mode 100644
index 00000000000..4fcc483cd49
--- /dev/null
+++ b/ndb/src/common/util/ndb_rand.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include <ndb_rand.h>
+
+static unsigned long next= 1;
+
+/**
+ * ndb_rand
+ *
+ * constant time, cheap, pseudo-random number generator.
+ *
+ * NDB_RAND_MAX assumed to be 32767
+ *
+ * This is the POSIX example for "generating the same sequence on
+ * different machines". Although that is not one of our requirements.
+ */
+int ndb_rand(void)
+{
+ next= next * 1103515245 + 12345;
+ return((unsigned)(next/65536) % 32768);
+}
+
+void ndb_srand(unsigned seed)
+{
+ next= seed;
+}
+
diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
index 60024e82978..91adae183f4 100644
--- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
+++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
@@ -20,6 +20,7 @@
#include <RefConvert.hpp>
#include <ndb_limits.h>
#include <my_sys.h>
+#include <ndb_rand.h>
#include <signaldata/EventReport.hpp>
#include <signaldata/TcKeyReq.hpp>
@@ -6278,7 +6279,7 @@ void Dbtc::timeOutLoopStartLab(Signal* signal, Uint32 api_con_ptr)
jam();
if (api_timer != 0) {
Uint32 error= ZTIME_OUT_ERROR;
- time_out_value= time_out_param + (api_con_ptr & mask_value);
+ time_out_value= time_out_param + (ndb_rand() & mask_value);
if (unlikely(old_mask_value)) // abort during single user mode
{
apiConnectptr.i = api_con_ptr;
diff --git a/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp b/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
index 28f3b987e7b..298fb183bc3 100644
--- a/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
+++ b/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
@@ -1138,7 +1138,8 @@ Dbtup::updateStartLab(Signal* signal,
regOperPtr->attrinbufLen);
} else {
jam();
- if (interpreterStartLab(signal, pagePtr, regOperPtr->pageOffset) == -1)
+ retValue = interpreterStartLab(signal, pagePtr, regOperPtr->pageOffset);
+ if (retValue == -1)
{
jam();
return -1;
@@ -1577,8 +1578,8 @@ int Dbtup::interpreterNextLab(Signal* signal,
Uint32 TdataForUpdate[3];
Uint32 Tlen;
- AttributeHeader& ah = AttributeHeader::init(&TdataForUpdate[0],
- TattrId, TattrNoOfWords);
+ AttributeHeader ah(TattrId, TattrNoOfWords);
+ TdataForUpdate[0] = ah.m_value;
TdataForUpdate[1] = TregMemBuffer[theRegister + 2];
TdataForUpdate[2] = TregMemBuffer[theRegister + 3];
Tlen = TattrNoOfWords + 1;
@@ -1594,6 +1595,7 @@ int Dbtup::interpreterNextLab(Signal* signal,
// Write a NULL value into the attribute
/* --------------------------------------------------------- */
ah.setNULL();
+ TdataForUpdate[0] = ah.m_value;
Tlen = 1;
}//if
int TnoDataRW= updateAttributes(pagePtr,
diff --git a/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp b/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp
index ae3bb0dcd7c..d8036dc0dee 100644
--- a/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp
+++ b/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp
@@ -676,8 +676,6 @@ bool
Dbtup::checkUpdateOfPrimaryKey(Uint32* updateBuffer, Tablerec* const regTabPtr)
{
Uint32 keyReadBuffer[MAX_KEY_SIZE_IN_WORDS];
- Uint32 attributeHeader;
- AttributeHeader* ahOut = (AttributeHeader*)&attributeHeader;
AttributeHeader ahIn(*updateBuffer);
Uint32 attributeId = ahIn.getAttributeId();
Uint32 attrDescriptorIndex = regTabPtr->tabDescriptor + (attributeId << ZAD_LOG_SIZE);
@@ -700,16 +698,17 @@ Dbtup::checkUpdateOfPrimaryKey(Uint32* updateBuffer, Tablerec* const regTabPtr)
ReadFunction f = regTabPtr->readFunctionArray[attributeId];
- AttributeHeader::init(&attributeHeader, attributeId, 0);
+ AttributeHeader attributeHeader(attributeId, 0);
tOutBufIndex = 0;
tMaxRead = MAX_KEY_SIZE_IN_WORDS;
bool tmp = tXfrmFlag;
tXfrmFlag = true;
- ndbrequire((this->*f)(&keyReadBuffer[0], ahOut, attrDescriptor, attributeOffset));
+ ndbrequire((this->*f)(&keyReadBuffer[0], &attributeHeader, attrDescriptor,
+ attributeOffset));
tXfrmFlag = tmp;
- ndbrequire(tOutBufIndex == ahOut->getDataSize());
- if (ahIn.getDataSize() != ahOut->getDataSize()) {
+ ndbrequire(tOutBufIndex == attributeHeader.getDataSize());
+ if (ahIn.getDataSize() != attributeHeader.getDataSize()) {
ljam();
return true;
}//if
diff --git a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp
index 55d36124476..3bc95d1eba8 100644
--- a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp
+++ b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp
@@ -1168,9 +1168,7 @@ DbUtil::prepareOperation(Signal* signal, PreparePtr prepPtr)
/**************************************************************
* Attribute found - store in mapping (AttributeId, Position)
**************************************************************/
- AttributeHeader & attrMap =
- AttributeHeader::init(attrMappingIt.data,
- attrDesc.AttributeId, // 1. Store AttrId
+ AttributeHeader attrMap(attrDesc.AttributeId, // 1. Store AttrId
0);
if (attrDesc.AttributeKeyFlag) {
@@ -1199,6 +1197,7 @@ DbUtil::prepareOperation(Signal* signal, PreparePtr prepPtr)
return;
}
}
+ *(attrMappingIt.data) = attrMap.m_value;
#if 0
ndbout << "BEFORE: attrLength: " << attrLength << endl;
#endif
diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp
index 409694fead1..d68f42cbbb4 100644
--- a/ndb/src/mgmsrv/MgmtSrvr.cpp
+++ b/ndb/src/mgmsrv/MgmtSrvr.cpp
@@ -227,10 +227,10 @@ MgmtSrvr::startEventLog()
}
}
-void
-MgmtSrvr::stopEventLog()
+void
+MgmtSrvr::stopEventLog()
{
- // Nothing yet
+ g_eventLogger.close();
}
class ErrorItem
diff --git a/ndb/src/ndbapi/NdbOperationDefine.cpp b/ndb/src/ndbapi/NdbOperationDefine.cpp
index 95e90609f9b..aaaf64b2986 100644
--- a/ndb/src/ndbapi/NdbOperationDefine.cpp
+++ b/ndb/src/ndbapi/NdbOperationDefine.cpp
@@ -392,9 +392,8 @@ NdbOperation::getValue_impl(const NdbColumnImpl* tAttrInfo, char* aValue)
return NULL;
}//if
}//if
- Uint32 ah;
- AttributeHeader::init(&ah, tAttrInfo->m_attrId, 0);
- if (insertATTRINFO(ah) != -1) {
+ AttributeHeader ah(tAttrInfo->m_attrId, 0);
+ if (insertATTRINFO(ah.m_value) != -1) {
// Insert Attribute Id into ATTRINFO part.
/************************************************************************
@@ -525,12 +524,11 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo,
tAttrId = tAttrInfo->m_attrId;
const char *aValue = aValuePassed;
- Uint32 ahValue;
if (aValue == NULL) {
if (tAttrInfo->m_nullable) {
- AttributeHeader& ah = AttributeHeader::init(&ahValue, tAttrId, 0);
+ AttributeHeader ah(tAttrId, 0);
ah.setNULL();
- insertATTRINFO(ahValue);
+ insertATTRINFO(ah.m_value);
// Insert Attribute Id with the value
// NULL into ATTRINFO part.
DBUG_RETURN(0);
@@ -563,8 +561,8 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo,
}//if
const Uint32 totalSizeInWords = (sizeInBytes + 3)/4; // Including bits in last word
const Uint32 sizeInWords = sizeInBytes / 4; // Excluding bits in last word
- (void) AttributeHeader::init(&ahValue, tAttrId, totalSizeInWords);
- insertATTRINFO( ahValue );
+ AttributeHeader ah(tAttrId, totalSizeInWords);
+ insertATTRINFO( ah.m_value );
/***********************************************************************
* Check if the pointer of the value passed is aligned on a 4 byte boundary.
diff --git a/ndb/src/ndbapi/NdbScanFilter.cpp b/ndb/src/ndbapi/NdbScanFilter.cpp
index fb47772fdea..58e9f180119 100644
--- a/ndb/src/ndbapi/NdbScanFilter.cpp
+++ b/ndb/src/ndbapi/NdbScanFilter.cpp
@@ -14,11 +14,15 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <NdbScanFilter.hpp>
+#include <Ndb.hpp>
#include <NdbOperation.hpp>
#include "NdbDictionaryImpl.hpp"
#include <Vector.hpp>
#include <NdbOut.hpp>
#include <Interpreter.hpp>
+#include <signaldata/AttrInfo.hpp>
+#include "NdbApiSignal.hpp"
+#include "NdbUtil.hpp"
#ifdef VM_TRACE
#include <NdbEnv.h>
@@ -52,14 +56,37 @@ public:
int cond_col_const(Interpreter::BinaryCondition, Uint32 attrId,
const void * value, Uint32 len);
+
+ bool m_abort_on_too_large;
+
+ NdbOperation::OperationStatus m_initial_op_status;
+ Uint32 m_initial_AI_size;
+ Uint32 m_max_size;
+
+ Uint32 get_size() {
+ assert(m_operation->theTotalCurrAI_Len >= m_initial_AI_size);
+ return m_operation->theTotalCurrAI_Len - m_initial_AI_size;
+ }
+ bool check_size() {
+ if (get_size() <= m_max_size)
+ return true;
+ handle_filter_too_large();
+ return false;
+ }
+ void handle_filter_too_large();
+
+ NdbError m_error;
};
const Uint32 LabelExit = ~0;
-NdbScanFilter::NdbScanFilter(class NdbOperation * op)
+NdbScanFilter::NdbScanFilter(class NdbOperation * op,
+ bool abort_on_too_large,
+ Uint32 max_size)
: m_impl(* new NdbScanFilterImpl())
{
+ DBUG_ENTER("NdbScanFilter::NdbScanFilter");
m_impl.m_current.m_group = (NdbScanFilter::Group)0;
m_impl.m_current.m_popCount = 0;
m_impl.m_current.m_ownLabel = 0;
@@ -69,6 +96,21 @@ NdbScanFilter::NdbScanFilter(class NdbOperation * op)
m_impl.m_latestAttrib = ~0;
m_impl.m_operation = op;
m_impl.m_negative = 0;
+
+ DBUG_PRINT("info", ("op status: %d tot AI: %u in curr: %u",
+ op->theStatus,
+ op->theTotalCurrAI_Len, op->theAI_LenInCurrAI));
+
+ m_impl.m_abort_on_too_large = abort_on_too_large;
+
+ m_impl.m_initial_op_status = op->theStatus;
+ m_impl.m_initial_AI_size = op->theTotalCurrAI_Len;
+ if (max_size > NDB_MAX_SCANFILTER_SIZE_IN_WORDS)
+ max_size = NDB_MAX_SCANFILTER_SIZE_IN_WORDS;
+ m_impl.m_max_size = max_size;
+
+ m_impl.m_error.code = 0;
+ DBUG_VOID_RETURN;
}
NdbScanFilter::~NdbScanFilter(){
@@ -200,30 +242,38 @@ NdbScanFilter::end(){
switch(tmp.m_group){
case NdbScanFilter::AND:
if(tmp.m_trueLabel == (Uint32)~0){
- m_impl.m_operation->interpret_exit_ok();
+ if (m_impl.m_operation->interpret_exit_ok() == -1)
+ return -1;
} else {
- m_impl.m_operation->branch_label(tmp.m_trueLabel);
+ if (m_impl.m_operation->branch_label(tmp.m_trueLabel) == -1)
+ return -1;
}
break;
case NdbScanFilter::NAND:
if(tmp.m_trueLabel == (Uint32)~0){
- m_impl.m_operation->interpret_exit_nok();
+ if (m_impl.m_operation->interpret_exit_nok() == -1)
+ return -1;
} else {
- m_impl.m_operation->branch_label(tmp.m_falseLabel);
+ if (m_impl.m_operation->branch_label(tmp.m_falseLabel) == -1)
+ return -1;
}
break;
case NdbScanFilter::OR:
if(tmp.m_falseLabel == (Uint32)~0){
- m_impl.m_operation->interpret_exit_nok();
+ if (m_impl.m_operation->interpret_exit_nok() == -1)
+ return -1;
} else {
- m_impl.m_operation->branch_label(tmp.m_falseLabel);
+ if (m_impl.m_operation->branch_label(tmp.m_falseLabel) == -1)
+ return -1;
}
break;
case NdbScanFilter::NOR:
if(tmp.m_falseLabel == (Uint32)~0){
- m_impl.m_operation->interpret_exit_ok();
+ if (m_impl.m_operation->interpret_exit_ok() == -1)
+ return -1;
} else {
- m_impl.m_operation->branch_label(tmp.m_trueLabel);
+ if (m_impl.m_operation->branch_label(tmp.m_trueLabel) == -1)
+ return -1;
}
break;
default:
@@ -231,24 +281,29 @@ NdbScanFilter::end(){
return -1;
}
- m_impl.m_operation->def_label(tmp.m_ownLabel);
+ if (m_impl.m_operation->def_label(tmp.m_ownLabel) == -1)
+ return -1;
if(m_impl.m_stack.size() == 0){
switch(tmp.m_group){
case NdbScanFilter::AND:
case NdbScanFilter::NOR:
- m_impl.m_operation->interpret_exit_nok();
+ if (m_impl.m_operation->interpret_exit_nok() == -1)
+ return -1;
break;
case NdbScanFilter::OR:
case NdbScanFilter::NAND:
- m_impl.m_operation->interpret_exit_ok();
+ if (m_impl.m_operation->interpret_exit_ok() == -1)
+ return -1;
break;
default:
m_impl.m_operation->setErrorCodeAbort(4260);
return -1;
}
}
-
+
+ if (!m_impl.check_size())
+ return -1;
return 0;
}
@@ -261,10 +316,16 @@ NdbScanFilter::istrue(){
}
if(m_impl.m_current.m_trueLabel == (Uint32)~0){
- return m_impl.m_operation->interpret_exit_ok();
+ if (m_impl.m_operation->interpret_exit_ok() == -1)
+ return -1;
} else {
- return m_impl.m_operation->branch_label(m_impl.m_current.m_trueLabel);
+ if (m_impl.m_operation->branch_label(m_impl.m_current.m_trueLabel) == -1)
+ return -1;
}
+
+ if (!m_impl.check_size())
+ return -1;
+ return 0;
}
int
@@ -276,10 +337,16 @@ NdbScanFilter::isfalse(){
}
if(m_impl.m_current.m_falseLabel == (Uint32)~0){
- return m_impl.m_operation->interpret_exit_nok();
+ if (m_impl.m_operation->interpret_exit_nok() == -1)
+ return -1;
} else {
- return m_impl.m_operation->branch_label(m_impl.m_current.m_falseLabel);
+ if (m_impl.m_operation->branch_label(m_impl.m_current.m_falseLabel) == -1)
+ return -1;
}
+
+ if (!m_impl.check_size())
+ return -1;
+ return 0;
}
@@ -330,7 +397,11 @@ NdbScanFilterImpl::cond_col(Interpreter::UnaryCondition op, Uint32 AttrId){
}
Branch1 branch = table2[op].m_branches[m_current.m_group];
- (m_operation->* branch)(AttrId, m_current.m_ownLabel);
+ if ((m_operation->* branch)(AttrId, m_current.m_ownLabel) == -1)
+ return -1;
+
+ if (!check_size())
+ return -1;
return 0;
}
@@ -463,8 +534,12 @@ NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition op,
return -1;
}
- int ret = (m_operation->* branch)(AttrId, value, len, false, m_current.m_ownLabel);
- return ret;
+ if ((m_operation->* branch)(AttrId, value, len, false, m_current.m_ownLabel) == -1)
+ return -1;
+
+ if (!check_size())
+ return -1;
+ return 0;
}
int
@@ -490,7 +565,130 @@ NdbScanFilter::cmp(BinaryCondition cond, int ColId,
return m_impl.cond_col_const(Interpreter::NOT_LIKE, ColId, val, len);
}
return -1;
-}
+}
+
+void
+NdbScanFilterImpl::handle_filter_too_large()
+{
+ DBUG_ENTER("NdbScanFilterImpl::handle_filter_too_large");
+
+ NdbOperation* const op = m_operation;
+ m_error.code = NdbScanFilter::FilterTooLarge;
+ if (m_abort_on_too_large)
+ op->setErrorCodeAbort(m_error.code);
+
+ /*
+ * Possible interpreted parts at this point are:
+ *
+ * 1. initial read
+ * 2. interpreted program
+ *
+ * It is assumed that NdbScanFilter has created all of 2
+ * so that we don't have to save interpreter state.
+ */
+
+ const Uint32 size = get_size();
+ assert(size != 0);
+
+ // new ATTRINFO size
+ const Uint32 new_size = m_initial_AI_size;
+
+ // find last signal for new size
+ assert(op->theFirstATTRINFO != NULL);
+ NdbApiSignal* lastSignal = op->theFirstATTRINFO;
+ Uint32 n = 0;
+ while (n + AttrInfo::DataLength < new_size) {
+ lastSignal = lastSignal->next();
+ assert(lastSignal != NULL);
+ n += AttrInfo::DataLength;
+ }
+ assert(n < size);
+
+ // release remaining signals
+ NdbApiSignal* tSignal = lastSignal->next();
+ op->theNdb->releaseSignalsInList(&tSignal);
+ lastSignal->next(NULL);
+
+ // length of lastSignal
+ const Uint32 new_curr = AttrInfo::HeaderLength + new_size - n;
+ assert(new_curr <= 25);
+
+ DBUG_PRINT("info", ("op status: %d->%d tot AI: %u->%u in curr: %u->%u",
+ op->theStatus, m_initial_op_status,
+ op->theTotalCurrAI_Len, new_size,
+ op->theAI_LenInCurrAI, new_curr));
+
+ // reset op state
+ op->theStatus = m_initial_op_status;
+
+ // reset interpreter state to initial
+
+ NdbBranch* tBranch = op->theFirstBranch;
+ while (tBranch != NULL) {
+ NdbBranch* tmp = tBranch;
+ tBranch = tBranch->theNext;
+ op->theNdb->releaseNdbBranch(tmp);
+ }
+ op->theFirstBranch = NULL;
+ op->theLastBranch = NULL;
+
+ NdbLabel* tLabel = op->theFirstLabel;
+ while (tLabel != NULL) {
+ NdbLabel* tmp = tLabel;
+ tLabel = tLabel->theNext;
+ op->theNdb->releaseNdbLabel(tmp);
+ }
+ op->theFirstLabel = NULL;
+ op->theLastLabel = NULL;
+
+ NdbCall* tCall = op->theFirstCall;
+ while (tCall != NULL) {
+ NdbCall* tmp = tCall;
+ tCall = tCall->theNext;
+ op->theNdb->releaseNdbCall(tmp);
+ }
+ op->theFirstCall = NULL;
+ op->theLastCall = NULL;
+
+ NdbSubroutine* tSubroutine = op->theFirstSubroutine;
+ while (tSubroutine != NULL) {
+ NdbSubroutine* tmp = tSubroutine;
+ tSubroutine = tSubroutine->theNext;
+ op->theNdb->releaseNdbSubroutine(tmp);
+ }
+ op->theFirstSubroutine = NULL;
+ op->theLastSubroutine = NULL;
+
+ op->theNoOfLabels = 0;
+ op->theNoOfSubroutines = 0;
+
+ // reset AI size
+ op->theTotalCurrAI_Len = new_size;
+ op->theAI_LenInCurrAI = new_curr;
+
+ // reset signal pointers
+ op->theCurrentATTRINFO = lastSignal;
+ op->theATTRINFOptr = &lastSignal->getDataPtrSend()[new_curr];
+
+ // interpreter sizes are set later somewhere
+
+ DBUG_VOID_RETURN;
+}
+
+static void
+update(const NdbError & _err){
+ NdbError & error = (NdbError &) _err;
+ ndberror_struct ndberror = (ndberror_struct)error;
+ ndberror_update(&ndberror);
+ error = NdbError(ndberror);
+}
+
+const NdbError &
+NdbScanFilter::getNdbError() const
+{
+ update(m_impl.m_error);
+ return m_impl.m_error;
+}
#if 0
diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp
index aec98a7f5d5..9176fb47297 100644
--- a/ndb/src/ndbapi/NdbScanOperation.cpp
+++ b/ndb/src/ndbapi/NdbScanOperation.cpp
@@ -849,6 +849,10 @@ NdbScanOperation::doSendScan(int aProcessorId)
// sending it. This could not be done in openScan because
// we created the ATTRINFO signals after the SCAN_TABREQ signal.
ScanTabReq * const req = CAST_PTR(ScanTabReq, tSignal->getDataPtrSend());
+ if (unlikely(theTotalCurrAI_Len > ScanTabReq::MaxTotalAttrInfo)) {
+ setErrorCode(4257);
+ return -1;
+ }
req->attrLenKeyLen = (tupKeyLen << 16) | theTotalCurrAI_Len;
Uint32 tmp = req->requestInfo;
ScanTabReq::setDistributionKeyFlag(tmp, theDistrKeyIndicator_);
diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c
index 24ccb1d07c2..56eb2c0f8bd 100644
--- a/ndb/src/ndbapi/ndberror.c
+++ b/ndb/src/ndbapi/ndberror.c
@@ -527,7 +527,8 @@ ErrorBundle ErrorCodes[] = {
{ 4270, IE, "Unknown blob error" },
{ 4335, AE, "Only one autoincrement column allowed per table. Having a table without primary key uses an autoincremented hidden key, i.e. a table without a primary key can not have an autoincremented column" },
{ 4271, AE, "Invalid index object, not retrieved via getIndex()" },
- { 4275, AE, "The blob method is incompatible with operation type or lock mode" }
+ { 4275, AE, "The blob method is incompatible with operation type or lock mode" },
+ { 4294, AE, "Scan filter is too large, discarded" }
};
static
diff --git a/netware/mysql_test_run.c b/netware/mysql_test_run.c
index 6bab2f0149c..3bdbc242f9e 100644
--- a/netware/mysql_test_run.c
+++ b/netware/mysql_test_run.c
@@ -175,7 +175,7 @@ void report_stats()
log_msg("\nThe .out and .err files in %s may give you some\n", result_dir);
log_msg("hint of what went wrong.\n");
log_msg("\nIf you want to report this error, please first read the documentation\n");
- log_msg("at: http://www.mysql.com/doc/en/MySQL_test_suite.html\n");
+ log_msg("at: http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html\n");
}
log_msg("\n%.02f total minutes elapsed in the test cases\n\n", total_time / 60);
@@ -1170,7 +1170,8 @@ void setup(char *file)
setenv("MYSQL_BINLOG", file_path, 1);
setenv("MASTER_MYPORT", "9306", 1);
setenv("SLAVE_MYPORT", "9307", 1);
- setenv("MYSQL_TCP_PORT", "3306", 1);
+ snprintf(file_path, PATH_MAX*2, "%d", MYSQL_PORT);
+ setenv("MYSQL_TCP_PORT", file_path, 1);
snprintf(file_path, PATH_MAX*2, "%s/mysql_client_test --no-defaults --testcase--user=root --port=%u ", bin_dir, master_port);
setenv("MYSQL_CLIENT_TEST",file_path,1);
snprintf(file_path, PATH_MAX*2, "%s/mysql --no-defaults --user=root --port=%u ", bin_dir, master_port);
diff --git a/netware/mysqld_safe.c b/netware/mysqld_safe.c
index 9db8a441ca3..00e7d1bcd51 100644
--- a/netware/mysqld_safe.c
+++ b/netware/mysqld_safe.c
@@ -189,7 +189,7 @@ void start_defaults(int argc, char *argv[])
snprintf(address, PATH_MAX, "0.0.0.0");
// port
- snprintf(port, PATH_MAX, "3306");
+ snprintf(port, PATH_MAX, "%d", MYSQL_PORT);
// default option
default_option[0]= NULL;
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 161c8a54df2..5db5fdd550f 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -149,13 +149,19 @@ SUFFIXES = .sh
-e 's!@''CC''@!@CC@!'\
-e 's!@''CXX''@!@CXX@!'\
-e 's!@''GXX''@!@GXX@!'\
+ -e 's!@''SAVE_CC''@!@SAVE_CC@!'\
+ -e 's!@''SAVE_CXX''@!@SAVE_CXX@!'\
-e 's!@''CC_VERSION''@!@CC_VERSION@!'\
-e 's!@''CXX_VERSION''@!@CXX_VERSION@!'\
-e 's!@''PERL''@!@PERL@!' \
- -e 's!@''ASFLAGS''@!@SAVE_ASFLAGS@!'\
- -e 's!@''CFLAGS''@!@SAVE_CFLAGS@!'\
- -e 's!@''CXXFLAGS''@!@SAVE_CXXFLAGS@!'\
- -e 's!@''LDFLAGS''@!@SAVE_LDFLAGS@!'\
+ -e 's!@''SAVE_ASFLAGS''@!@SAVE_ASFLAGS@!'\
+ -e 's!@''SAVE_CFLAGS''@!@SAVE_CFLAGS@!'\
+ -e 's!@''SAVE_CXXFLAGS''@!@SAVE_CXXFLAGS@!'\
+ -e 's!@''SAVE_LDFLAGS''@!@SAVE_LDFLAGS@!'\
+ -e 's!@''ASFLAGS''@!@ASFLAGS@!'\
+ -e 's!@''CFLAGS''@!@CFLAGS@!'\
+ -e 's!@''CXXFLAGS''@!@CXXFLAGS@!'\
+ -e 's!@''LDFLAGS''@!@LDFLAGS@!'\
-e 's!@''CLIENT_LIBS''@!@CLIENT_LIBS@!' \
-e 's!@''ZLIB_LIBS''@!@ZLIB_LIBS@!' \
-e 's!@''LIBS''@!@LIBS@!' \
@@ -174,6 +180,7 @@ SUFFIXES = .sh
-e 's!@''MYSQLD_DEFAULT_SWITCHES''@!@MYSQLD_DEFAULT_SWITCHES@!' \
-e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \
-e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \
+ -e 's!@''MYSQL_TCP_PORT_DEFAULT''@!@MYSQL_TCP_PORT_DEFAULT@!' \
-e 's!@''TARGET_LINUX''@!@TARGET_LINUX@!' \
-e "s!@""CONF_COMMAND""@!@CONF_COMMAND@!" \
-e 's!@''MYSQLD_USER''@!@MYSQLD_USER@!' \
diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh
index 6b054e83720..ae58655ed0f 100644
--- a/scripts/mysql_config.sh
+++ b/scripts/mysql_config.sh
@@ -92,9 +92,14 @@ fix_path pkgincludedir include/mysql include
version='@VERSION@'
socket='@MYSQL_UNIX_ADDR@'
-port='@MYSQL_TCP_PORT@'
ldflags='@LDFLAGS@'
+if [ @MYSQL_TCP_PORT_DEFAULT@ -eq 0 ]; then
+ port=0
+else
+ port=@MYSQL_TCP_PORT@
+fi
+
# Create options
# We intentionally add a space to the beginning and end of lib strings, simplifies replace later
libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@"
diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh
index a353273dc28..3b179957932 100644
--- a/scripts/mysql_fix_privilege_tables.sh
+++ b/scripts/mysql_fix_privilege_tables.sh
@@ -25,6 +25,7 @@ sql_only=0
basedir="@prefix@"
verbose=0
args=""
+# no elaborate fallback here; with no argument, it will happen in "mysql"
port=""
socket=""
database="mysql"
diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql
index c0e3af1c9c8..47d4ea5d950 100644
--- a/scripts/mysql_system_tables_data.sql
+++ b/scripts/mysql_system_tables_data.sql
@@ -15,7 +15,8 @@ DROP TABLE tmp_db;
-- from local machine if "users" table didn't exist before
CREATE TEMPORARY TABLE tmp_user LIKE user;
INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
-REPLACE INTO tmp_user VALUES (@@hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
+set @hostname= @@hostname;
+REPLACE INTO tmp_user VALUES (@hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
INSERT INTO tmp_user (host,user) VALUES ('localhost','');
INSERT INTO tmp_user (host,user) VALUES (@@hostname,'');
diff --git a/scripts/mysqlbug.sh b/scripts/mysqlbug.sh
index 69ea82e8794..64804b5de19 100644
--- a/scripts/mysqlbug.sh
+++ b/scripts/mysqlbug.sh
@@ -23,7 +23,8 @@ VERSION="@VERSION@@MYSQL_SERVER_SUFFIX@"
COMPILATION_COMMENT="@COMPILATION_COMMENT@"
BUGmysql="mysql@lists.mysql.com"
# This is set by configure
-COMP_ENV_INFO="CC='@CC@' CFLAGS='@CFLAGS@' CXX='@CXX@' CXXFLAGS='@CXXFLAGS@' LDFLAGS='@LDFLAGS@' ASFLAGS='@ASFLAGS@'"
+COMP_CALL_INFO="CC='@SAVE_CC@' CFLAGS='@SAVE_CFLAGS@' CXX='@SAVE_CXX@' CXXFLAGS='@SAVE_CXXFLAGS@' LDFLAGS='@SAVE_LDFLAGS@' ASFLAGS='@SAVE_ASFLAGS@'"
+COMP_RUN_INFO="CC='@CC@' CFLAGS='@CFLAGS@' CXX='@CXX@' CXXFLAGS='@CXXFLAGS@' LDFLAGS='@LDFLAGS@' ASFLAGS='@ASFLAGS@'"
CONFIGURE_LINE="@CONF_COMMAND@"
LIBC_INFO=""
@@ -261,7 +262,8 @@ ${ORGANIZATION- $ORGANIZATION_C}
`test -n "$MACHINE" && echo "Machine: $MACHINE"`
`test -n "$FILE_PATHS" && echo "Some paths: $FILE_PATHS"`
`test -n "$GCC_INFO" && echo "GCC: $GCC_INFO"`
-`test -n "$COMP_ENV_INFO" && echo "Compilation info: $COMP_ENV_INFO"`
+`test -n "$COMP_CALL_INFO" && echo "Compilation info (call): $COMP_CALL_INFO"`
+`test -n "$COMP_RUN_INFO" && echo "Compilation info (used): $COMP_RUN_INFO"`
`test -n "$LIBC_INFO" && echo "LIBC: $LIBC_INFO"`
`test -n "$CONFIGURE_LINE" && echo "Configure command: $CONFIGURE_LINE"`
`test -n "$PERL_INFO" && echo "Perl: $PERL_INFO"`
diff --git a/scripts/mysqld_safe-watch.sh b/scripts/mysqld_safe-watch.sh
index c837ba9a118..f853741c87b 100644
--- a/scripts/mysqld_safe-watch.sh
+++ b/scripts/mysqld_safe-watch.sh
@@ -66,7 +66,7 @@ fi
echo "Starting mysqld demon with databases from $DATADIR"
#Default communication ports
-#MYSQL_TCP_PORT=3306
+#MYSQL_TCP_PORT=@MYSQL_TCP_PORT@
if test -z "$MYSQL_UNIX_PORT"
then
MYSQL_UNIX_PORT="/tmp/mysql.sock"
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index 52fe282f916..e6b015e7d16 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -231,7 +231,7 @@ then
echo "Please do a cd to the mysql installation directory and restart"
echo "this script from there as follows:"
echo "./bin/mysqld_safe".
- echo "See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more"
+ echo "See http://dev.mysql.com/doc/mysql/en/mysqld-safe.html for more"
echo "information"
exit 1
fi
diff --git a/server-tools/instance-manager/priv.h b/server-tools/instance-manager/priv.h
index a746288f28b..2e55e0ac8e6 100644
--- a/server-tools/instance-manager/priv.h
+++ b/server-tools/instance-manager/priv.h
@@ -25,7 +25,7 @@
#include "my_pthread.h"
/* IM-wide platform-independent defines */
-#define SERVER_DEFAULT_PORT 3306
+#define SERVER_DEFAULT_PORT MYSQL_PORT
#define DEFAULT_MONITORING_INTERVAL 20
#define DEFAULT_PORT 2273
/* three-week timeout should be enough */
diff --git a/sql-common/client.c b/sql-common/client.c
index cb1d224ef2e..1fc73549520 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -1085,11 +1085,16 @@ void mysql_read_default_options(struct st_mysql_options *options,
my_free(options->ssl_capath, MYF(MY_ALLOW_ZERO_PTR));
options->ssl_capath = my_strdup(opt_arg, MYF(MY_WME));
break;
+ case 26: /* ssl_cipher */
+ my_free(options->ssl_cipher, MYF(MY_ALLOW_ZERO_PTR));
+ options->ssl_cipher= my_strdup(opt_arg, MYF(MY_WME));
+ break;
#else
case 13: /* Ignore SSL options */
case 14:
case 15:
case 16:
+ case 26:
break;
#endif /* HAVE_OPENSSL */
case 17: /* charset-lib */
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index f5d5828e024..453c7b73008 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -54,24 +54,24 @@ uint calc_days_in_year(uint year)
366 : 365);
}
-/*
- Check datetime value for validity according to flags.
-
- SYNOPSIS
- check_date()
- ltime Date to check.
- not_zero_date ltime is not the zero date
- flags flags to check
- was_cut set to 2 if value was truncated.
- NOTE: This is not touched if value was not truncated
- NOTES
- Here we assume that year and month is ok !
+/**
+ @brief Check datetime value for validity according to flags.
+
+ @param[in] ltime Date to check.
+ @param[in] not_zero_date ltime is not the zero date
+ @param[in] flags flags to check
+ (see str_to_datetime() flags in my_time.h)
+ @param[out] was_cut set to 2 if value was invalid according to flags.
+ (Feb 29 in non-leap etc.) This remains unchanged
+ if value is not invalid.
+
+ @details Here we assume that year and month is ok!
If month is 0 we allow any date. (This only happens if we allow zero
date parts in str_to_datetime())
Disallow dates with zero year and non-zero month and/or day.
- RETURN
- 0 ok
+ @return
+ 0 OK
1 error
*/
@@ -117,9 +117,9 @@ my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date,
TIME_NO_ZERO_IN_DATE Don't allow partial dates
TIME_NO_ZERO_DATE Don't allow 0000-00-00 date
TIME_INVALID_DATES Allow 2000-02-31
- was_cut 0 Value ok
+ was_cut 0 Value OK
1 If value was cut during conversion
- 2 Date part was within ranges but date was wrong
+ 2 check_date(date,flags) considers date invalid
DESCRIPTION
At least the following formats are recogniced (based on number of digits)
@@ -769,11 +769,6 @@ long calc_daynr(uint year,uint month,uint day)
if (year == 0 && month == 0 && day == 0)
DBUG_RETURN(0); /* Skip errors */
- if (year < 200)
- {
- if ((year=year+1900) < 1900+YY_PART_YEAR)
- year+=100;
- }
delsum= (long) (365L * year+ 31*(month-1) +day);
if (month <= 2)
year--;
@@ -1092,7 +1087,7 @@ int my_TIME_to_str(const MYSQL_TIME *l_time, char *to)
flags - flags to use in validating date, as in str_to_datetime()
was_cut 0 Value ok
1 If value was cut during conversion
- 2 Date part was within ranges but date was wrong
+ 2 check_date(date,flags) considers date invalid
DESCRIPTION
Convert a datetime value of formats YYMMDD, YYYYMMDD, YYMMDDHHMSS,
diff --git a/sql/examples/ha_tina.cc b/sql/examples/ha_tina.cc
index 2c5226222e2..0d1d821cf17 100644
--- a/sql/examples/ha_tina.cc
+++ b/sql/examples/ha_tina.cc
@@ -852,7 +852,7 @@ int ha_tina::rnd_end()
It also sorts so that we move the final blocks to the
beginning so that we move the smallest amount of data possible.
*/
- qsort(chain, (size_t)(chain_ptr - chain), sizeof(tina_set), (qsort_cmp)sort_set);
+ my_qsort(chain, (size_t)(chain_ptr - chain), sizeof(tina_set), (qsort_cmp)sort_set);
for (ptr= chain; ptr < chain_ptr; ptr++)
{
memmove(share->mapped_file + ptr->begin, share->mapped_file + ptr->end,
diff --git a/sql/field.cc b/sql/field.cc
index aa302e54a05..0a7c6a04f39 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -1356,15 +1356,25 @@ void Field_num::add_zerofill_and_unsigned(String &res) const
void Field::make_field(Send_field *field)
{
- if (orig_table->s->table_cache_key && *(orig_table->s->table_cache_key))
+ if (orig_table && orig_table->s->table_cache_key &&
+ *(orig_table->s->table_cache_key))
{
field->org_table_name= orig_table->s->table_name;
field->db_name= orig_table->s->table_cache_key;
}
else
field->org_table_name= field->db_name= "";
- field->table_name= orig_table->alias;
- field->col_name= field->org_col_name= field_name;
+ if (orig_table)
+ {
+ field->table_name= orig_table->alias;
+ field->org_col_name= field_name;
+ }
+ else
+ {
+ field->table_name= "";
+ field->org_col_name= "";
+ }
+ field->col_name= field_name;
field->charsetnr= charset()->number;
field->length=field_length;
field->type=type();
@@ -5924,24 +5934,74 @@ int Field_str::store(double nr)
{
char buff[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE];
uint length;
- bool use_scientific_notation= TRUE;
uint local_char_length= field_length / charset()->mbmaxlen;
- /*
- Check fabs(nr) against longest value that can be stored in field,
- which depends on whether the value is < 1 or not, and negative or not
- */
double anr= fabs(nr);
+ bool fractional= (anr != floor(anr));
int neg= (nr < 0.0) ? 1 : 0;
- if (local_char_length > 4 && local_char_length < 32 &&
- (anr < 1.0 ? anr > 1/(log_10[max(0,(int) local_char_length-neg-2)]) /* -2 for "0." */
- : anr < log_10[local_char_length-neg]-1))
- use_scientific_notation= FALSE;
-
- length= (uint) my_sprintf(buff, (buff, "%-.*g",
- (use_scientific_notation ?
- max(0, (int)local_char_length-neg-5) :
- local_char_length),
- nr));
+ uint max_length;
+ int exp;
+ uint digits;
+ uint i;
+
+ /* Calculate the exponent from the 'e'-format conversion */
+ if (anr < 1.0 && anr > 0)
+ {
+ for (exp= 0; anr < 1e-100; exp-= 100, anr*= 1e100);
+ for (; anr < 1e-10; exp-= 10, anr*= 1e10);
+ for (i= 1; anr < 1 / log_10[i]; exp--, i++);
+ exp--;
+ }
+ else
+ {
+ for (exp= 0; anr > 1e100; exp+= 100, anr/= 1e100);
+ for (; anr > 1e10; exp+= 10, anr/= 1e10);
+ for (i= 1; anr > log_10[i]; exp++, i++);
+ }
+
+ max_length= local_char_length - neg;
+
+ /*
+ Since in sprintf("%g") precision means the number of significant digits,
+ calculate the maximum number of significant digits if the 'f'-format
+ would be used (+1 for decimal point if the number has a fractional part).
+ */
+ digits= max(0, (int) max_length - fractional);
+ /*
+ If the exponent is negative, decrease digits by the number of leading zeros
+ after the decimal point that do not count as significant digits.
+ */
+ if (exp < 0)
+ digits= max(0, (int) digits + exp);
+ /*
+ 'e'-format is used only if the exponent is less than -4 or greater than or
+ equal to the precision. In this case we need to adjust the number of
+ significant digits to take "e+NN" + decimal point into account (hence -5).
+ We also have to reserve one additional character if abs(exp) >= 100.
+ */
+ if (exp >= (int) digits || exp < -4)
+ digits= max(0, (int) (max_length - 5 - (exp >= 100 || exp <= -100)));
+
+ /* Limit precision to DBL_DIG to avoid garbage past significant digits */
+ set_if_smaller(digits, DBL_DIG);
+
+ length= (uint) my_sprintf(buff, (buff, "%-.*g", digits, nr));
+
+#ifdef __WIN__
+ /*
+ Windows always zero-pads the exponent to 3 digits, we want to remove the
+ leading 0 to match the sprintf() output on other platforms.
+ */
+ if ((exp >= (int) digits || exp < -4) && exp > -100 && exp < 100)
+ {
+ DBUG_ASSERT(length >= 6); /* 1e+NNN */
+ uint tmp= length - 3;
+ buff[tmp]= buff[tmp + 1];
+ tmp++;
+ buff[tmp]= buff[tmp + 1];
+ length--;
+ }
+#endif
+
/*
+1 below is because "precision" in %g above means the
max. number of significant digits, not the output width.
@@ -7423,36 +7483,6 @@ uint Field_blob::max_packed_col_length(uint max_length)
#ifdef HAVE_SPATIAL
-uint Field_geom::get_key_image(char *buff, uint length, imagetype type)
-{
- char *blob;
- const char *dummy;
- MBR mbr;
- ulong blob_length= get_length(ptr);
- Geometry_buffer buffer;
- Geometry *gobj;
- const uint image_length= SIZEOF_STORED_DOUBLE*4;
-
- if (blob_length < SRID_SIZE)
- {
- bzero(buff, image_length);
- return image_length;
- }
- get_ptr(&blob);
- gobj= Geometry::construct(&buffer, blob, blob_length);
- if (!gobj || gobj->get_mbr(&mbr, &dummy))
- bzero(buff, image_length);
- else
- {
- float8store(buff, mbr.xmin);
- float8store(buff + 8, mbr.xmax);
- float8store(buff + 16, mbr.ymin);
- float8store(buff + 24, mbr.ymax);
- }
- return image_length;
-}
-
-
void Field_geom::sql_type(String &res) const
{
CHARSET_INFO *cs= &my_charset_latin1;
diff --git a/sql/field.h b/sql/field.h
index 4fcdb50f8c7..8c01931fa21 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -1326,7 +1326,6 @@ public:
int store(double nr);
int store(longlong nr, bool unsigned_val);
int store_decimal(const my_decimal *);
- uint get_key_image(char *buff,uint length,imagetype type);
uint size_of() const { return sizeof(*this); }
int reset(void) { return !maybe_null() || Field_blob::reset(); }
geometry_type get_geometry_type() { return geom_type; };
diff --git a/sql/filesort.cc b/sql/filesort.cc
index db73ede99b0..08ffa2211fa 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -534,7 +534,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
file->unlock_row();
/* It does not make sense to read more keys in case of a fatal error */
if (thd->net.report_error)
- DBUG_RETURN(HA_POS_ERROR);
+ break;
}
if (quick_select)
{
@@ -551,6 +551,9 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
file->ha_rnd_end();
}
+ if (thd->net.report_error)
+ DBUG_RETURN(HA_POS_ERROR);
+
DBUG_PRINT("test",("error: %d indexpos: %d",error,indexpos));
if (error != HA_ERR_END_OF_FILE)
{
diff --git a/sql/gstream.cc b/sql/gstream.cc
index 46e12b6ef3b..0c8011549f3 100644
--- a/sql/gstream.cc
+++ b/sql/gstream.cc
@@ -44,7 +44,7 @@ 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))
+ if ((m_cur >= m_limit) || !my_isvar_start(&my_charset_bin, *m_cur))
return 1;
/*
diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc
index d8ffd6c55f8..d7f2309657b 100644
--- a/sql/ha_federated.cc
+++ b/sql/ha_federated.cc
@@ -2528,7 +2528,12 @@ int ha_federated::info(uint flag)
status_query_string.length(0);
result= mysql_store_result(mysql);
- if (!result)
+
+ /*
+ We're going to use fields num. 4, 12 and 13 of the resultset,
+ so make sure we have these fields.
+ */
+ if (!result || (mysql_num_fields(result) < 14))
goto error;
if (!mysql_num_rows(result))
@@ -2557,9 +2562,9 @@ int ha_federated::info(uint flag)
data_file_length= records * mean_rec_length;
if (row[12] != NULL)
- update_time= (ha_rows) my_strtoll10(row[12], (char**) 0, &error);
+ update_time= (time_t) my_strtoll10(row[12], (char**) 0, &error);
if (row[13] != NULL)
- check_time= (ha_rows) my_strtoll10(row[13], (char**) 0, &error);
+ check_time= (time_t) my_strtoll10(row[13], (char**) 0, &error);
}
/*
diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc
index bf807407df1..4b96e5b5744 100644
--- a/sql/ha_heap.cc
+++ b/sql/ha_heap.cc
@@ -175,7 +175,7 @@ void ha_heap::update_key_stats()
else
{
ha_rows hash_buckets= file->s->keydef[i].hash_buckets;
- uint no_records= hash_buckets ? file->s->records/hash_buckets : 2;
+ uint no_records= hash_buckets ? (uint) (file->s->records/hash_buckets) : 2;
if (no_records < 2)
no_records= 2;
key->rec_per_key[key->key_parts-1]= no_records;
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 2d47c42cf1d..fa68da87661 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -174,6 +174,7 @@ my_bool innobase_file_per_table = FALSE;
my_bool innobase_locks_unsafe_for_binlog = FALSE;
my_bool innobase_rollback_on_timeout = FALSE;
my_bool innobase_create_status_file = FALSE;
+my_bool innobase_adaptive_hash_index = TRUE;
static char *internal_innobase_data_file_path = NULL;
@@ -521,6 +522,9 @@ convert_error_code_to_mysql(
mark_transaction_to_rollback(thd, TRUE);
return(HA_ERR_LOCK_TABLE_FULL);
+ } else if (error == DB_UNSUPPORTED) {
+
+ return(HA_ERR_UNSUPPORTED);
} else {
return(-1); // Unknown error
}
@@ -1376,6 +1380,8 @@ innobase_init(void)
srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
srv_use_checksums = (ibool) innobase_use_checksums;
+ srv_use_adaptive_hash_indexes = (ibool) innobase_adaptive_hash_index;
+
os_use_large_pages = (ibool) innobase_use_large_pages;
os_large_page_size = (ulint) innobase_large_page_size;
@@ -3710,11 +3716,22 @@ convert_search_mode_to_innobase(
and comparison of non-latin1 char type fields in
innobase_mysql_cmp() to get PAGE_CUR_LE_OR_EXTENDS to
work correctly. */
-
- default: assert(0);
+ case HA_READ_MBR_CONTAIN:
+ case HA_READ_MBR_INTERSECT:
+ case HA_READ_MBR_WITHIN:
+ case HA_READ_MBR_DISJOINT:
+ case HA_READ_MBR_EQUAL:
+ my_error(ER_TABLE_CANT_HANDLE_SPKEYS, MYF(0));
+ return(PAGE_CUR_UNSUPP);
+ /* do not use "default:" in order to produce a gcc warning:
+ enumeration value '...' not handled in switch
+ (if -Wswitch or -Wall is used)
+ */
}
- return(0);
+ my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "this functionality");
+
+ return(PAGE_CUR_UNSUPP);
}
/*
@@ -3852,11 +3869,18 @@ ha_innobase::index_read(
last_match_mode = (uint) match_mode;
- innodb_srv_conc_enter_innodb(prebuilt->trx);
+ if (mode != PAGE_CUR_UNSUPP) {
- ret = row_search_for_mysql((byte*) buf, mode, prebuilt, match_mode, 0);
+ innodb_srv_conc_enter_innodb(prebuilt->trx);
- innodb_srv_conc_exit_innodb(prebuilt->trx);
+ ret = row_search_for_mysql((byte*) buf, mode, prebuilt,
+ match_mode, 0);
+
+ innodb_srv_conc_exit_innodb(prebuilt->trx);
+ } else {
+
+ ret = DB_UNSUPPORTED;
+ }
if (ret == DB_SUCCESS) {
error = 0;
@@ -5171,8 +5195,16 @@ ha_innobase::records_in_range(
mode2 = convert_search_mode_to_innobase(max_key ? max_key->flag :
HA_READ_KEY_EXACT);
- n_rows = btr_estimate_n_rows_in_range(index, range_start,
- mode1, range_end, mode2);
+ if (mode1 != PAGE_CUR_UNSUPP && mode2 != PAGE_CUR_UNSUPP) {
+
+ n_rows = btr_estimate_n_rows_in_range(index, range_start,
+ mode1, range_end,
+ mode2);
+ } else {
+
+ n_rows = 0;
+ }
+
dtuple_free_for_mysql(heap1);
dtuple_free_for_mysql(heap2);
@@ -5474,7 +5506,7 @@ ha_innobase::info(
table->key_info[i].rec_per_key[j]=
rec_per_key >= ~(ulong) 0 ? ~(ulong) 0 :
- rec_per_key;
+ (ulong) rec_per_key;
}
index = dict_table_get_next_index_noninline(index);
diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h
index 585bc75fa36..3db983901b3 100644
--- a/sql/ha_innodb.h
+++ b/sql/ha_innodb.h
@@ -217,7 +217,8 @@ extern my_bool innobase_log_archive,
innobase_use_native_aio,
innobase_file_per_table, innobase_locks_unsafe_for_binlog,
innobase_rollback_on_timeout,
- innobase_create_status_file;
+ innobase_create_status_file,
+ innobase_adaptive_hash_index;
extern my_bool innobase_very_fast_shutdown; /* set this to 1 just before
calling innobase_end() if you want
InnoDB to shut down without
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index 36d06335717..b60ee648d62 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -173,7 +173,7 @@ int table2myisam(TABLE *table_arg, MI_KEYDEF **keydef_out,
pos= table_arg->key_info;
for (i= 0; i < share->keys; i++, pos++)
{
- keydef[i].flag= (pos->flags & (HA_NOSAME | HA_FULLTEXT | HA_SPATIAL));
+ keydef[i].flag= ((uint16) pos->flags & (HA_NOSAME | HA_FULLTEXT | HA_SPATIAL));
keydef[i].key_alg= pos->algorithm == HA_KEY_ALG_UNDEF ?
(pos->flags & HA_SPATIAL ? HA_KEY_ALG_RTREE : HA_KEY_ALG_BTREE) :
pos->algorithm;
@@ -1412,7 +1412,7 @@ void ha_myisam::start_bulk_insert(ha_rows rows)
DBUG_ENTER("ha_myisam::start_bulk_insert");
THD *thd= current_thd;
ulong size= min(thd->variables.read_buff_size,
- table->s->avg_row_length*rows);
+ (ulong) (table->s->avg_row_length*rows));
DBUG_PRINT("info",("start_bulk_insert: rows %lu size %lu",
(ulong) rows, size));
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 3e08c0fd1e2..a372c9c5b54 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -1356,6 +1356,30 @@ int ha_ndbcluster::set_primary_key_from_record(NdbOperation *op, const byte *rec
DBUG_RETURN(0);
}
+bool ha_ndbcluster::check_index_fields_in_write_set(uint keyno)
+{
+ KEY* key_info= table->key_info + keyno;
+ KEY_PART_INFO* key_part= key_info->key_part;
+ KEY_PART_INFO* end= key_part+key_info->key_parts;
+ uint i;
+ DBUG_ENTER("check_index_fields_in_write_set");
+
+ if (m_retrieve_all_fields)
+ {
+ DBUG_RETURN(true);
+ }
+ for (i= 0; key_part != end; key_part++, i++)
+ {
+ Field* field= key_part->field;
+ if (field->query_id != current_thd->query_id)
+ {
+ DBUG_RETURN(false);
+ }
+ }
+
+ DBUG_RETURN(true);
+}
+
int ha_ndbcluster::set_index_key_from_record(NdbOperation *op, const byte *record, uint keyno)
{
KEY* key_info= table->key_info + keyno;
@@ -1643,7 +1667,8 @@ check_null_in_record(const KEY* key_info, const byte *record)
* primary key or unique index values
*/
-int ha_ndbcluster::peek_indexed_rows(const byte *record, bool check_pk)
+int ha_ndbcluster::peek_indexed_rows(const byte *record,
+ NDB_WRITE_OP write_op)
{
NdbTransaction *trans= m_active_trans;
NdbOperation *op;
@@ -1656,7 +1681,7 @@ int ha_ndbcluster::peek_indexed_rows(const byte *record, bool check_pk)
(NdbOperation::LockMode)get_ndb_lock_type(m_lock.type);
first= NULL;
- if (check_pk && table->s->primary_key != MAX_KEY)
+ if (write_op != NDB_UPDATE && table->s->primary_key != MAX_KEY)
{
/*
* Fetch any row with colliding primary key
@@ -1687,9 +1712,15 @@ int ha_ndbcluster::peek_indexed_rows(const byte *record, bool check_pk)
*/
if (check_null_in_record(key_info, record))
{
- DBUG_PRINT("info", ("skipping check for key with NULL"));
+ DBUG_PRINT("info", ("skipping check for key with NULL"));
continue;
}
+ if (write_op != NDB_INSERT && !check_index_fields_in_write_set(i))
+ {
+ DBUG_PRINT("info", ("skipping check for key %u not in write_set", i));
+ continue;
+ }
+
NdbIndexOperation *iop;
NDBINDEX *unique_index = (NDBINDEX *) m_index[i].unique_index;
key_part= key_info->key_part;
@@ -2268,7 +2299,7 @@ int ha_ndbcluster::write_row(byte *record)
start_bulk_insert will set parameters to ensure that each
write_row is committed individually
*/
- int peek_res= peek_indexed_rows(record, true);
+ int peek_res= peek_indexed_rows(record, NDB_INSERT);
if (!peek_res)
{
@@ -2302,7 +2333,7 @@ int ha_ndbcluster::write_row(byte *record)
auto_value, 1) == -1)
{
if (--retries &&
- ndb->getNdbError().status == NdbError::TemporaryError);
+ ndb->getNdbError().status == NdbError::TemporaryError)
{
my_sleep(retry_sleep);
continue;
@@ -2456,7 +2487,8 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data)
if (m_ignore_dup_key && (thd->lex->sql_command == SQLCOM_UPDATE ||
thd->lex->sql_command == SQLCOM_UPDATE_MULTI))
{
- int peek_res= peek_indexed_rows(new_data, pk_update);
+ NDB_WRITE_OP write_op= (pk_update) ? NDB_PK_UPDATE : NDB_UPDATE;
+ int peek_res= peek_indexed_rows(new_data, write_op);
if (!peek_res)
{
@@ -4862,7 +4894,7 @@ ulonglong ha_ndbcluster::get_auto_increment()
auto_value, cache_size, step, start))
{
if (--retries &&
- ndb->getNdbError().status == NdbError::TemporaryError);
+ ndb->getNdbError().status == NdbError::TemporaryError)
{
my_sleep(retry_sleep);
continue;
diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h
index 81cbdcd8fea..324969ad374 100644
--- a/sql/ha_ndbcluster.h
+++ b/sql/ha_ndbcluster.h
@@ -59,6 +59,12 @@ typedef struct ndb_index_data {
bool null_in_unique_index;
} NDB_INDEX_DATA;
+typedef enum ndb_write_op {
+ NDB_INSERT = 0,
+ NDB_UPDATE = 1,
+ NDB_PK_UPDATE = 2
+} NDB_WRITE_OP;
+
typedef struct st_ndbcluster_share {
THR_LOCK lock;
pthread_mutex_t mutex;
@@ -251,7 +257,7 @@ private:
const NdbOperation *first,
const NdbOperation *last,
uint errcode);
- int peek_indexed_rows(const byte *record, bool check_pk);
+ int peek_indexed_rows(const byte *record, NDB_WRITE_OP write_op);
int unique_index_read(const byte *key, uint key_len,
byte *buf);
int ordered_index_scan(const key_range *start_key,
@@ -286,6 +292,7 @@ private:
int get_ndb_blobs_value(NdbBlob *last_ndb_blob, my_ptrdiff_t ptrdiff);
int set_primary_key(NdbOperation *op, const byte *key);
int set_primary_key_from_record(NdbOperation *op, const byte *record);
+ bool check_index_fields_in_write_set(uint keyno);
int set_index_key_from_record(NdbOperation *op, const byte *record,
uint keyno);
int set_bounds(NdbIndexScanOperation*, const key_range *keys[2], uint= 0);
diff --git a/sql/ha_ndbcluster_cond.cc b/sql/ha_ndbcluster_cond.cc
index ea3f8a7683a..c7b185a92f0 100644
--- a/sql/ha_ndbcluster_cond.cc
+++ b/sql/ha_ndbcluster_cond.cc
@@ -1338,9 +1338,23 @@ ha_ndbcluster_cond::generate_scan_filter(NdbScanOperation *op)
if (m_cond_stack)
{
- NdbScanFilter filter(op);
+ NdbScanFilter filter(op, false); // don't abort on too large
- DBUG_RETURN(generate_scan_filter_from_cond(filter));
+ int ret=generate_scan_filter_from_cond(filter);
+ if (ret != 0)
+ {
+ const NdbError& err=filter.getNdbError();
+ if (err.code == NdbScanFilter::FilterTooLarge)
+ {
+ // err.message has static storage
+ DBUG_PRINT("info", ("%s", err.message));
+ push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ err.code, err.message);
+ ret=0;
+ }
+ }
+ if (ret != 0)
+ DBUG_RETURN(ret);
}
else
{
@@ -1391,7 +1405,7 @@ int ha_ndbcluster_cond::generate_scan_filter_from_key(NdbScanOperation *op,
{
KEY_PART_INFO* key_part= key_info->key_part;
KEY_PART_INFO* end= key_part+key_info->key_parts;
- NdbScanFilter filter(op);
+ NdbScanFilter filter(op, true); // abort on too large
int res;
DBUG_ENTER("generate_scan_filter_from_key");
diff --git a/sql/item.cc b/sql/item.cc
index e9b2904e3da..431d82af331 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -274,6 +274,7 @@ my_decimal *Item::val_decimal_from_date(my_decimal *decimal_value)
if (get_date(&ltime, TIME_FUZZY_DATE))
{
my_decimal_set_zero(decimal_value);
+ null_value= 1; // set NULL, stop processing
return 0;
}
return date2my_decimal(&ltime, decimal_value);
@@ -938,9 +939,12 @@ int Item::save_in_field_no_warnings(Field *field, bool no_conversions)
int res;
THD *thd= field->table->in_use;
enum_check_fields tmp= thd->count_cuted_fields;
+ ulong sql_mode= thd->variables.sql_mode;
+ thd->variables.sql_mode&= ~(MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE);
thd->count_cuted_fields= CHECK_FIELD_IGNORE;
res= save_in_field(field, no_conversions);
thd->count_cuted_fields= tmp;
+ thd->variables.sql_mode= sql_mode;
return res;
}
@@ -3303,7 +3307,7 @@ static Item** find_field_in_group_list(Item *find_item, ORDER *group_list)
if (cur_field->table_name && table_name)
{
/* If field_name is qualified by a table name. */
- if (strcmp(cur_field->table_name, table_name))
+ if (my_strcasecmp(table_alias_charset, cur_field->table_name, table_name))
/* Same field names, different tables. */
return NULL;
@@ -4247,6 +4251,47 @@ bool Item::is_datetime()
}
+String *Item::check_well_formed_result(String *str, bool send_error)
+{
+ /* Check whether we got a well-formed string */
+ CHARSET_INFO *cs= str->charset();
+ int well_formed_error;
+ uint wlen= cs->cset->well_formed_len(cs,
+ str->ptr(), str->ptr() + str->length(),
+ str->length(), &well_formed_error);
+ if (wlen < str->length())
+ {
+ THD *thd= current_thd;
+ char hexbuf[7];
+ enum MYSQL_ERROR::enum_warning_level level;
+ uint diff= str->length() - wlen;
+ set_if_smaller(diff, 3);
+ octet2hex(hexbuf, str->ptr() + wlen, diff);
+ if (send_error)
+ {
+ my_error(ER_INVALID_CHARACTER_STRING, MYF(0),
+ cs->csname, hexbuf);
+ return 0;
+ }
+ if ((thd->variables.sql_mode &
+ (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES)))
+ {
+ level= MYSQL_ERROR::WARN_LEVEL_ERROR;
+ null_value= 1;
+ str= 0;
+ }
+ else
+ {
+ level= MYSQL_ERROR::WARN_LEVEL_WARN;
+ str->length(wlen);
+ }
+ push_warning_printf(thd, level, ER_INVALID_CHARACTER_STRING,
+ ER(ER_INVALID_CHARACTER_STRING), cs->csname, hexbuf);
+ }
+ return str;
+}
+
+
/*
Create a field to hold a string value from an item
@@ -4363,12 +4408,11 @@ Field *Item::tmp_table_field_from_field_type(TABLE *table)
return new Field_blob(max_length, maybe_null, name, table,
collation.collation);
break; // Blob handled outside of case
+#ifdef HAVE_SPATIAL
case MYSQL_TYPE_GEOMETRY:
- return new Field_geom(max_length, maybe_null, name, table,
- (Field::geometry_type)
- ((type() == Item::TYPE_HOLDER) ?
- ((Item_type_holder *)this)->get_geometry_type() :
- ((Item_geometry_func *)this)->get_geometry_type()));
+ return new Field_geom(max_length, maybe_null,
+ name, table, get_geometry_type());
+#endif /* HAVE_SPATIAL */
}
}
@@ -4507,7 +4551,7 @@ int Item::save_in_field(Field *field, bool no_conversions)
my_decimal decimal_value;
my_decimal *value= val_decimal(&decimal_value);
if (null_value)
- return set_field_to_null(field);
+ return set_field_to_null_with_conversions(field, no_conversions);
field->set_notnull();
error=field->store_decimal(value);
}
@@ -4769,6 +4813,19 @@ warn:
}
+void Item_hex_string::print(String *str)
+{
+ char *end= (char*) str_value.ptr() + str_value.length(),
+ *ptr= end - min(str_value.length(), sizeof(longlong));
+ str->append("0x");
+ for (; ptr != end ; ptr++)
+ {
+ str->append(_dig_vec_lower[((uchar) *ptr) >> 4]);
+ str->append(_dig_vec_lower[((uchar) *ptr) & 0x0F]);
+ }
+}
+
+
bool Item_hex_string::eq(const Item *arg, bool binary_cmp) const
{
if (arg->basic_const_item() && arg->type() == type())
@@ -6202,9 +6259,9 @@ bool field_is_equal_to_item(Field *field,Item *item)
return result == field->val_real();
}
-Item_cache* Item_cache::get_cache(Item_result type)
+Item_cache* Item_cache::get_cache(const Item *item)
{
- switch (type) {
+ switch (item->result_type()) {
case INT_RESULT:
return new Item_cache_int();
case REAL_RESULT:
@@ -6212,7 +6269,7 @@ Item_cache* Item_cache::get_cache(Item_result type)
case DECIMAL_RESULT:
return new Item_cache_decimal();
case STRING_RESULT:
- return new Item_cache_str();
+ return new Item_cache_str(item);
case ROW_RESULT:
return new Item_cache_row();
default:
@@ -6390,6 +6447,14 @@ my_decimal *Item_cache_str::val_decimal(my_decimal *decimal_val)
}
+int Item_cache_str::save_in_field(Field *field, bool no_conversions)
+{
+ int res= Item_cache::save_in_field(field, no_conversions);
+ return (is_varbinary && field->type() == MYSQL_TYPE_STRING &&
+ value->length() < field->field_length) ? 1 : res;
+}
+
+
bool Item_cache_row::allocate(uint num)
{
item_count= num;
@@ -6408,7 +6473,7 @@ bool Item_cache_row::setup(Item * item)
{
Item *el= item->element_index(i);
Item_cache *tmp;
- if (!(tmp= values[i]= Item_cache::get_cache(el->result_type())))
+ if (!(tmp= values[i]= Item_cache::get_cache(el)))
return 1;
tmp->setup(el);
}
@@ -6488,10 +6553,10 @@ Item_type_holder::Item_type_holder(THD *thd, Item *item)
if (Field::result_merge_type(fld_type) == INT_RESULT)
decimals= 0;
prev_decimal_int_part= item->decimal_int_part();
+#ifdef HAVE_SPATIAL
if (item->field_type() == MYSQL_TYPE_GEOMETRY)
- geometry_type= (item->type() == Item::FIELD_ITEM) ?
- ((Item_field *)item)->get_geometry_type() :
- (Field::geometry_type)((Item_geometry_func *)item)->get_geometry_type();
+ geometry_type= item->get_geometry_type();
+#endif /* HAVE_SPATIAL */
}
diff --git a/sql/item.h b/sql/item.h
index 3c699c0eda3..a1135c2c725 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -870,6 +870,9 @@ public:
*/
virtual bool result_as_longlong() { return FALSE; }
bool is_datetime();
+ virtual Field::geometry_type get_geometry_type() const
+ { return Field::GEOM_GEOMETRY; };
+ String *check_well_formed_result(String *str, bool send_error= 0);
};
@@ -1112,6 +1115,8 @@ public:
Item_name_const(Item *name_arg, Item *val):
value_item(val), name_item(name_arg)
{
+ if(!value_item->basic_const_item())
+ my_error(ER_WRONG_ARGUMENTS, MYF(0), "NAME_CONST");
Item::maybe_null= TRUE;
}
@@ -1335,7 +1340,7 @@ public:
int fix_outer_field(THD *thd, Field **field, Item **reference);
virtual Item *update_value_transformer(byte *select_arg);
void print(String *str);
- Field::geometry_type get_geometry_type()
+ Field::geometry_type get_geometry_type() const
{
DBUG_ASSERT(field_type() == MYSQL_TYPE_GEOMETRY);
return field->get_geometry_type();
@@ -1579,7 +1584,7 @@ public:
double val_real()
{ DBUG_ASSERT(fixed == 1); return ulonglong2double((ulonglong)value); }
String *val_str(String*);
- Item *clone_item() { return new Item_uint(name,max_length); }
+ Item *clone_item() { return new Item_uint(name, value, max_length); }
int save_in_field(Field *field, bool no_conversions);
void print(String *str);
Item_num *neg ();
@@ -1853,6 +1858,7 @@ public:
enum_field_types field_type() const { return MYSQL_TYPE_VARCHAR; }
// to prevent drop fixed flag (no need parent cleanup call)
void cleanup() {}
+ void print(String *str);
bool eq(const Item *item, bool binary_cmp) const;
virtual Item *safe_charset_converter(CHARSET_INFO *tocs);
};
@@ -2463,7 +2469,7 @@ public:
};
virtual void store(Item *)= 0;
enum Type type() const { return CACHE_ITEM; }
- static Item_cache* get_cache(Item_result type);
+ static Item_cache* get_cache(const Item *item);
table_map used_tables() const { return used_table_map; }
virtual void keep_array() {}
// to prevent drop fixed flag (no need parent cleanup call)
@@ -2525,9 +2531,16 @@ class Item_cache_str: public Item_cache
{
char buffer[STRING_BUFFER_USUAL_SIZE];
String *value, value_buff;
+ bool is_varbinary;
+
public:
- Item_cache_str(): Item_cache(), value(0) { }
-
+ Item_cache_str(const Item *item) :
+ Item_cache(), value(0),
+ is_varbinary(item->type() == FIELD_ITEM &&
+ ((const Item_field *) item)->field->type() ==
+ MYSQL_TYPE_VARCHAR &&
+ !((const Item_field *) item)->field->has_charset())
+ {}
void store(Item *item);
double val_real();
longlong val_int();
@@ -2535,6 +2548,7 @@ public:
my_decimal *val_decimal(my_decimal *);
enum Item_result result_type() const { return STRING_RESULT; }
CHARSET_INFO *charset() const { return value->charset(); };
+ int save_in_field(Field *field, bool no_conversions);
};
class Item_cache_row: public Item_cache
@@ -2637,7 +2651,7 @@ public:
Field *make_field_by_type(TABLE *table);
static uint32 display_length(Item *item);
static enum_field_types get_real_type(Item *);
- Field::geometry_type get_geometry_type() { return geometry_type; };
+ Field::geometry_type get_geometry_type() const { return geometry_type; };
};
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 7ed5f4e51bd..37ff37f17f4 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -147,6 +147,36 @@ static int agg_cmp_type(THD *thd, Item_result *type, Item **items, uint nitems)
}
+/**
+ @brief Aggregates field types from the array of items.
+
+ @param[in] items array of items to aggregate the type from
+ @paran[in] nitems number of items in the array
+
+ @details This function aggregates field types from the array of items.
+ Found type is supposed to be used later as the result field type
+ of a multi-argument function.
+ Aggregation itself is performed by the Field::field_type_merge()
+ function.
+
+ @note The term "aggregation" is used here in the sense of inferring the
+ result type of a function from its argument types.
+
+ @return aggregated field type.
+*/
+
+enum_field_types agg_field_type(Item **items, uint nitems)
+{
+ uint i;
+ if (!nitems || items[0]->result_type() == ROW_RESULT )
+ return (enum_field_types)-1;
+ enum_field_types res= items[0]->field_type();
+ for (i= 1 ; i < nitems ; i++)
+ res= Field::field_type_merge(res, items[i]->field_type());
+ return res;
+}
+
+
static void my_coll_agg_error(DTCollation &c1, DTCollation &c2,
const char *fname)
{
@@ -522,26 +552,26 @@ int Arg_comparator::set_compare_func(Item_bool_func2 *item, Item_result type)
}
-/*
- Convert date provided in a string to the int representation.
+/**
+ @brief Convert date provided in a string to the int representation.
- SYNOPSIS
- get_date_from_str()
- thd Thread handle
- str a string to convert
- warn_type type of the timestamp for issuing the warning
- warn_name field name for issuing the warning
- error_arg [out] TRUE if string isn't a DATETIME or clipping occur
+ @param[in] thd thread handle
+ @param[in] str a string to convert
+ @param[in] warn_type type of the timestamp for issuing the warning
+ @param[in] warn_name field name for issuing the warning
+ @param[out] error_arg could not extract a DATE or DATETIME
- DESCRIPTION
- Convert date provided in the string str to the int representation.
- if the string contains wrong date or doesn't contain it at all
- then the warning is issued and TRUE returned in the error_arg argument.
- The warn_type and the warn_name arguments are used as the name and the
- type of the field when issuing the warning.
+ @details Convert date provided in the string str to the int
+ representation. If the string contains wrong date or doesn't
+ contain it at all then a warning is issued. The warn_type and
+ the warn_name arguments are used as the name and the type of the
+ field when issuing the warning. If any input was discarded
+ (trailing or non-timestampy characters), was_cut will be non-zero.
+ was_type will return the type str_to_datetime() could correctly
+ extract.
- RETURN
- converted value.
+ @return
+ converted value. 0 on error and on zero-dates -- check 'failure'
*/
static ulonglong
@@ -552,26 +582,33 @@ get_date_from_str(THD *thd, String *str, timestamp_type warn_type,
int error;
MYSQL_TIME l_time;
enum_mysql_timestamp_type ret;
- *error_arg= TRUE;
ret= str_to_datetime(str->ptr(), str->length(), &l_time,
(TIME_FUZZY_DATE | MODE_INVALID_DATES |
(thd->variables.sql_mode &
(MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE))),
&error);
- if ((ret == MYSQL_TIMESTAMP_DATETIME || ret == MYSQL_TIMESTAMP_DATE))
+
+ if (ret == MYSQL_TIMESTAMP_DATETIME || ret == MYSQL_TIMESTAMP_DATE)
{
- value= TIME_to_ulonglong_datetime(&l_time);
+ /*
+ Do not return yet, we may still want to throw a "trailing garbage"
+ warning.
+ */
*error_arg= FALSE;
+ value= TIME_to_ulonglong_datetime(&l_time);
}
-
- if (error || *error_arg)
+ else
{
+ *error_arg= TRUE;
+ error= 1; /* force warning */
+ }
+
+ if (error > 0)
make_truncated_value_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
str->ptr(), str->length(),
warn_type, warn_name);
- *error_arg= TRUE;
- }
+
return value;
}
@@ -872,6 +909,12 @@ get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg,
timestamp_type t_type= f_type ==
MYSQL_TYPE_DATE ? MYSQL_TIMESTAMP_DATE : MYSQL_TIMESTAMP_DATETIME;
value= get_date_from_str(thd, str, t_type, warn_item->name, &error);
+ /*
+ If str did not contain a valid date according to the current
+ SQL_MODE, get_date_from_str() has already thrown a warning,
+ and we don't want to throw NULL on invalid date (see 5.2.6
+ "SQL modes" in the manual), so we're done here.
+ */
}
/*
Do not cache GET_USER_VAR() function as its const_item() may return TRUE
@@ -1343,7 +1386,7 @@ longlong Item_func_truth::val_int()
bool Item_in_optimizer::fix_left(THD *thd, Item **ref)
{
if (!args[0]->fixed && args[0]->fix_fields(thd, args) ||
- !cache && !(cache= Item_cache::get_cache(args[0]->result_type())))
+ !cache && !(cache= Item_cache::get_cache(args[0])))
return 1;
cache->setup(args[0]);
@@ -1595,24 +1638,27 @@ bool Item_func_opt_neg::eq(const Item *item, bool binary_cmp) const
void Item_func_interval::fix_length_and_dec()
{
+ uint rows= row->cols();
+
use_decimal_comparison= (row->element_index(0)->result_type() == DECIMAL_RESULT) ||
(row->element_index(0)->result_type() == INT_RESULT);
- if (row->cols() > 8)
+ if (rows > 8)
{
- bool consts=1;
+ bool not_null_consts= TRUE;
- for (uint i=1 ; consts && i < row->cols() ; i++)
+ for (uint i= 1; not_null_consts && i < rows; i++)
{
- consts&= row->element_index(i)->const_item();
+ Item *el= row->element_index(i);
+ not_null_consts&= el->const_item() & !el->is_null();
}
- if (consts &&
+ if (not_null_consts &&
(intervals=
- (interval_range*) sql_alloc(sizeof(interval_range)*(row->cols()-1))))
+ (interval_range*) sql_alloc(sizeof(interval_range) * (rows - 1))))
{
if (use_decimal_comparison)
{
- for (uint i=1 ; i < row->cols(); i++)
+ for (uint i= 1; i < rows; i++)
{
Item *el= row->element_index(i);
interval_range *range= intervals + (i-1);
@@ -1637,7 +1683,7 @@ void Item_func_interval::fix_length_and_dec()
}
else
{
- for (uint i=1 ; i < row->cols(); i++)
+ for (uint i= 1; i < rows; i++)
{
intervals[i-1].dbl= row->element_index(i)->val_real();
}
@@ -1728,12 +1774,22 @@ longlong Item_func_interval::val_int()
((el->result_type() == DECIMAL_RESULT) ||
(el->result_type() == INT_RESULT)))
{
- my_decimal e_dec_buf, *e_dec= row->element_index(i)->val_decimal(&e_dec_buf);
+ my_decimal e_dec_buf, *e_dec= el->val_decimal(&e_dec_buf);
+ /* Skip NULL ranges. */
+ if (el->null_value)
+ continue;
if (my_decimal_cmp(e_dec, dec) > 0)
- return i-1;
+ return i - 1;
+ }
+ else
+ {
+ double val= el->val_real();
+ /* Skip NULL ranges. */
+ if (el->null_value)
+ continue;
+ if (val > value)
+ return i - 1;
}
- else if (row->element_index(i)->val_real() > value)
- return i-1;
}
return i-1;
}
@@ -1990,10 +2046,20 @@ Item_func_ifnull::fix_length_and_dec()
agg_result_type(&hybrid_type, args, 2);
maybe_null=args[1]->maybe_null;
decimals= max(args[0]->decimals, args[1]->decimals);
- max_length= (hybrid_type == DECIMAL_RESULT || hybrid_type == INT_RESULT) ?
- (max(args[0]->max_length - args[0]->decimals,
- args[1]->max_length - args[1]->decimals) + decimals) :
- max(args[0]->max_length, args[1]->max_length);
+ unsigned_flag= args[0]->unsigned_flag && args[1]->unsigned_flag;
+
+ if (hybrid_type == DECIMAL_RESULT || hybrid_type == INT_RESULT)
+ {
+ int len0= args[0]->max_length - args[0]->decimals
+ - (args[0]->unsigned_flag ? 0 : 1);
+
+ int len1= args[1]->max_length - args[1]->decimals
+ - (args[1]->unsigned_flag ? 0 : 1);
+
+ max_length= max(len0, len1) + decimals + (unsigned_flag ? 0 : 1);
+ }
+ else
+ max_length= max(args[0]->max_length, args[1]->max_length);
switch (hybrid_type) {
case STRING_RESULT:
@@ -2009,9 +2075,7 @@ Item_func_ifnull::fix_length_and_dec()
default:
DBUG_ASSERT(0);
}
- cached_field_type= args[0]->field_type();
- if (cached_field_type != args[1]->field_type())
- cached_field_type= Item_func::field_type();
+ cached_field_type= agg_field_type(args, 2);
}
@@ -2159,11 +2223,13 @@ Item_func_if::fix_length_and_dec()
{
cached_result_type= arg2_type;
collation.set(args[2]->collation.collation);
+ cached_field_type= args[2]->field_type();
}
else if (null2)
{
cached_result_type= arg1_type;
collation.set(args[1]->collation.collation);
+ cached_field_type= args[1]->field_type();
}
else
{
@@ -2177,6 +2243,7 @@ Item_func_if::fix_length_and_dec()
{
collation.set(&my_charset_bin); // Number
}
+ cached_field_type= agg_field_type(args + 1, 2);
}
if ((cached_result_type == DECIMAL_RESULT )
@@ -2530,6 +2597,23 @@ bool Item_func_case::fix_fields(THD *thd, Item **ref)
}
+void Item_func_case::agg_str_lengths(Item* arg)
+{
+ set_if_bigger(max_length, arg->max_length);
+ set_if_bigger(decimals, arg->decimals);
+ unsigned_flag= unsigned_flag && arg->unsigned_flag;
+}
+
+
+void Item_func_case::agg_num_lengths(Item *arg)
+{
+ uint len= my_decimal_length_to_precision(arg->max_length, arg->decimals,
+ arg->unsigned_flag) - arg->decimals;
+ set_if_bigger(max_length, len);
+ set_if_bigger(decimals, arg->decimals);
+ unsigned_flag= unsigned_flag && arg->unsigned_flag;
+}
+
void Item_func_case::fix_length_and_dec()
{
@@ -2556,7 +2640,7 @@ void Item_func_case::fix_length_and_dec()
agg_arg_charsets(collation, agg, nagg, MY_COLL_ALLOW_CONV, 1))
return;
-
+ cached_field_type= agg_field_type(agg, nagg);
/*
Aggregate first expression and all THEN expression types
and collations when string comparison
@@ -2579,15 +2663,22 @@ void Item_func_case::fix_length_and_dec()
max_length=0;
decimals=0;
- for (uint i=0 ; i < ncases ; i+=2)
+ unsigned_flag= TRUE;
+ if (cached_result_type == STRING_RESULT)
{
- set_if_bigger(max_length,args[i+1]->max_length);
- set_if_bigger(decimals,args[i+1]->decimals);
+ for (uint i= 0; i < ncases; i+= 2)
+ agg_str_lengths(args[i + 1]);
+ if (else_expr_num != -1)
+ agg_str_lengths(args[else_expr_num]);
}
- if (else_expr_num != -1)
+ else
{
- set_if_bigger(max_length,args[else_expr_num]->max_length);
- set_if_bigger(decimals,args[else_expr_num]->decimals);
+ for (uint i= 0; i < ncases; i+= 2)
+ agg_num_lengths(args[i + 1]);
+ if (else_expr_num != -1)
+ agg_num_lengths(args[else_expr_num]);
+ max_length= my_decimal_precision_to_length(max_length + decimals, decimals,
+ unsigned_flag);
}
}
@@ -2695,6 +2786,7 @@ my_decimal *Item_func_coalesce::decimal_op(my_decimal *decimal_value)
void Item_func_coalesce::fix_length_and_dec()
{
+ cached_field_type= agg_field_type(args, arg_count);
agg_result_type(&hybrid_type, args, arg_count);
switch (hybrid_type) {
case STRING_RESULT:
@@ -2775,7 +2867,7 @@ static inline int cmp_ulongs (ulonglong a_val, ulonglong b_val)
SYNOPSIS
cmp_longlong()
- cmp_arg an argument passed to the calling function (qsort2)
+ cmp_arg an argument passed to the calling function (my_qsort2)
a left argument
b right argument
@@ -4226,6 +4318,51 @@ void Item_func_like::cleanup()
#ifdef USE_REGEX
bool
+Item_func_regex::regcomp(bool send_error)
+{
+ char buff[MAX_FIELD_WIDTH];
+ String tmp(buff,sizeof(buff),&my_charset_bin);
+ String *res= args[1]->val_str(&tmp);
+ int error;
+
+ if (args[1]->null_value)
+ return TRUE;
+
+ if (regex_compiled)
+ {
+ if (!stringcmp(res, &prev_regexp))
+ return FALSE;
+ prev_regexp.copy(*res);
+ my_regfree(&preg);
+ regex_compiled= 0;
+ }
+
+ if (cmp_collation.collation != regex_lib_charset)
+ {
+ /* Convert UCS2 strings to UTF8 */
+ uint dummy_errors;
+ if (conv.copy(res->ptr(), res->length(), res->charset(),
+ regex_lib_charset, &dummy_errors))
+ return TRUE;
+ res= &conv;
+ }
+
+ if ((error= my_regcomp(&preg, res->c_ptr_safe(),
+ regex_lib_flags, regex_lib_charset)))
+ {
+ if (send_error)
+ {
+ (void) my_regerror(error, &preg, buff, sizeof(buff));
+ my_error(ER_REGEXP_ERROR, MYF(0), buff);
+ }
+ return TRUE;
+ }
+ regex_compiled= 1;
+ return FALSE;
+}
+
+
+bool
Item_func_regex::fix_fields(THD *thd, Item **ref)
{
DBUG_ASSERT(fixed == 0);
@@ -4241,34 +4378,34 @@ Item_func_regex::fix_fields(THD *thd, Item **ref)
if (agg_arg_charsets(cmp_collation, args, 2, MY_COLL_CMP_CONV, 1))
return TRUE;
+ regex_lib_flags= (cmp_collation.collation->state &
+ (MY_CS_BINSORT | MY_CS_CSSORT)) ?
+ REG_EXTENDED | REG_NOSUB :
+ REG_EXTENDED | REG_NOSUB | REG_ICASE;
+ /*
+ If the case of UCS2 and other non-ASCII character sets,
+ we will convert patterns and strings to UTF8.
+ */
+ regex_lib_charset= (cmp_collation.collation->mbminlen > 1) ?
+ &my_charset_utf8_general_ci :
+ cmp_collation.collation;
+
used_tables_cache=args[0]->used_tables() | args[1]->used_tables();
not_null_tables_cache= (args[0]->not_null_tables() |
args[1]->not_null_tables());
const_item_cache=args[0]->const_item() && args[1]->const_item();
if (!regex_compiled && args[1]->const_item())
{
- char buff[MAX_FIELD_WIDTH];
- String tmp(buff,sizeof(buff),&my_charset_bin);
- String *res=args[1]->val_str(&tmp);
if (args[1]->null_value)
{ // Will always return NULL
maybe_null=1;
+ fixed= 1;
return FALSE;
}
- int error;
- if ((error= my_regcomp(&preg,res->c_ptr(),
- ((cmp_collation.collation->state &
- (MY_CS_BINSORT | MY_CS_CSSORT)) ?
- REG_EXTENDED | REG_NOSUB :
- REG_EXTENDED | REG_NOSUB | REG_ICASE),
- cmp_collation.collation)))
- {
- (void) my_regerror(error,&preg,buff,sizeof(buff));
- my_error(ER_REGEXP_ERROR, MYF(0), buff);
+ if (regcomp(TRUE))
return TRUE;
- }
- regex_compiled=regex_is_const=1;
- maybe_null=args[0]->maybe_null;
+ regex_is_const= 1;
+ maybe_null= args[0]->maybe_null;
}
else
maybe_null=1;
@@ -4281,47 +4418,25 @@ longlong Item_func_regex::val_int()
{
DBUG_ASSERT(fixed == 1);
char buff[MAX_FIELD_WIDTH];
- String *res, tmp(buff,sizeof(buff),&my_charset_bin);
+ String tmp(buff,sizeof(buff),&my_charset_bin);
+ String *res= args[0]->val_str(&tmp);
- res=args[0]->val_str(&tmp);
- if (args[0]->null_value)
- {
- null_value=1;
+ if ((null_value= (args[0]->null_value ||
+ (!regex_is_const && regcomp(FALSE)))))
return 0;
- }
- if (!regex_is_const)
- {
- char buff2[MAX_FIELD_WIDTH];
- String *res2, tmp2(buff2,sizeof(buff2),&my_charset_bin);
- res2= args[1]->val_str(&tmp2);
- if (args[1]->null_value)
+ if (cmp_collation.collation != regex_lib_charset)
+ {
+ /* Convert UCS2 strings to UTF8 */
+ uint dummy_errors;
+ if (conv.copy(res->ptr(), res->length(), res->charset(),
+ regex_lib_charset, &dummy_errors))
{
- null_value=1;
+ null_value= 1;
return 0;
}
- if (!regex_compiled || stringcmp(res2,&prev_regexp))
- {
- prev_regexp.copy(*res2);
- if (regex_compiled)
- {
- my_regfree(&preg);
- regex_compiled=0;
- }
- if (my_regcomp(&preg,res2->c_ptr_safe(),
- ((cmp_collation.collation->state &
- (MY_CS_BINSORT | MY_CS_CSSORT)) ?
- REG_EXTENDED | REG_NOSUB :
- REG_EXTENDED | REG_NOSUB | REG_ICASE),
- cmp_collation.collation))
- {
- null_value=1;
- return 0;
- }
- regex_compiled=1;
- }
+ res= &conv;
}
- null_value=0;
return my_regexec(&preg,res->c_ptr_safe(),0,(my_regmatch_t*) 0,0) ? 0 : 1;
}
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 8410c66b034..d250e1b366a 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -640,6 +640,7 @@ public:
class Item_func_coalesce :public Item_func_numhybrid
{
protected:
+ enum_field_types cached_field_type;
Item_func_coalesce(Item *a, Item *b) :Item_func_numhybrid(a, b) {}
public:
Item_func_coalesce(List<Item> &list) :Item_func_numhybrid(list) {}
@@ -652,13 +653,13 @@ public:
enum Item_result result_type () const { return hybrid_type; }
const char *func_name() const { return "coalesce"; }
table_map not_null_tables() const { return 0; }
+ enum_field_types field_type() const { return cached_field_type; }
};
class Item_func_ifnull :public Item_func_coalesce
{
protected:
- enum_field_types cached_field_type;
bool field_type_defined;
public:
Item_func_ifnull(Item *a, Item *b) :Item_func_coalesce(a,b) {}
@@ -677,6 +678,7 @@ public:
class Item_func_if :public Item_func
{
enum Item_result cached_result_type;
+ enum_field_types cached_field_type;
public:
Item_func_if(Item *a,Item *b,Item *c)
:Item_func(a,b,c), cached_result_type(INT_RESULT)
@@ -686,6 +688,7 @@ public:
String *val_str(String *str);
my_decimal *val_decimal(my_decimal *);
enum Item_result result_type () const { return cached_result_type; }
+ enum_field_types field_type() const { return cached_field_type; }
bool fix_fields(THD *, Item **);
void fix_length_and_dec();
uint decimal_precision() const;
@@ -722,6 +725,7 @@ class Item_func_case :public Item_func
uint ncases;
Item_result cmp_type;
DTCollation cmp_collation;
+ enum_field_types cached_field_type;
public:
Item_func_case(List<Item> &list, Item *first_expr_arg, Item *else_expr_arg)
:Item_func(), first_expr_num(-1), else_expr_num(-1),
@@ -749,10 +753,13 @@ public:
uint decimal_precision() const;
table_map not_null_tables() const { return 0; }
enum Item_result result_type () const { return cached_result_type; }
+ enum_field_types field_type() const { return cached_field_type; }
const char *func_name() const { return "case"; }
void print(String *str);
Item *find_item(String *str);
CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
+ void agg_str_lengths(Item *arg);
+ void agg_num_lengths(Item *arg);
};
@@ -781,7 +788,7 @@ public:
virtual byte *get_value(Item *item)=0;
void sort()
{
- qsort2(base,used_count,size,compare,collation);
+ my_qsort2(base,used_count,size,compare,collation);
}
int find(Item *item);
@@ -1313,6 +1320,10 @@ class Item_func_regex :public Item_bool_func
bool regex_is_const;
String prev_regexp;
DTCollation cmp_collation;
+ CHARSET_INFO *regex_lib_charset;
+ int regex_lib_flags;
+ String conv;
+ bool regcomp(bool send_error);
public:
Item_func_regex(Item *a,Item *b) :Item_bool_func(a,b),
regex_compiled(0),regex_is_const(0) {}
@@ -1382,6 +1393,7 @@ public:
bool subst_argument_checker(byte **arg) { return TRUE; }
Item *compile(Item_analyzer analyzer, byte **arg_p,
Item_transformer transformer, byte *arg_t);
+ enum_field_types field_type() const { return MYSQL_TYPE_LONGLONG; }
};
diff --git a/sql/item_func.cc b/sql/item_func.cc
index f9331093495..8e809028d8e 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -1380,7 +1380,11 @@ longlong Item_func_int_div::val_int()
void Item_func_int_div::fix_length_and_dec()
{
- max_length=args[0]->max_length - args[0]->decimals;
+ Item_result argtype= args[0]->result_type();
+ /* use precision ony for the data type it is applicable for and valid */
+ max_length=args[0]->max_length -
+ (argtype == DECIMAL_RESULT || argtype == INT_RESULT ?
+ args[0]->decimals : 0);
maybe_null=1;
unsigned_flag=args[0]->unsigned_flag | args[1]->unsigned_flag;
}
@@ -1999,6 +2003,7 @@ void Item_func_round::fix_length_and_dec()
case DECIMAL_RESULT:
{
hybrid_type= DECIMAL_RESULT;
+ decimals_to_set= min(DECIMAL_MAX_SCALE, decimals_to_set);
int decimals_delta= args[0]->decimals - decimals_to_set;
int precision= args[0]->decimal_precision();
int length_increase= ((decimals_delta <= 0) || truncate) ? 0:1;
@@ -2105,7 +2110,7 @@ my_decimal *Item_func_round::decimal_op(my_decimal *decimal_value)
longlong dec= args[1]->val_int();
if (dec > 0 || (dec < 0 && args[1]->unsigned_flag))
{
- dec= min((ulonglong) dec, DECIMAL_MAX_SCALE);
+ dec= min((ulonglong) dec, decimals);
decimals= (uint8) dec; // to get correct output
}
else if (dec < INT_MIN)
@@ -2243,6 +2248,7 @@ void Item_func_min_max::fix_length_and_dec()
else if ((cmp_type == DECIMAL_RESULT) || (cmp_type == INT_RESULT))
max_length= my_decimal_precision_to_length(max_int_part+decimals, decimals,
unsigned_flag);
+ cached_field_type= agg_field_type(args, arg_count);
}
@@ -2924,7 +2930,8 @@ udf_handler::fix_fields(THD *thd, Item_result_field *func,
String *res= arguments[i]->val_str(&buffers[i]);
if (arguments[i]->null_value)
continue;
- f_args.args[i]= (char*) res->ptr();
+ f_args.args[i]= (char*) res->c_ptr();
+ f_args.lengths[i]= res->length();
break;
}
case INT_RESULT:
@@ -3732,13 +3739,12 @@ longlong Item_func_sleep::val_int()
break;
error= 0;
}
-
+ pthread_mutex_unlock(&LOCK_user_locks);
pthread_mutex_lock(&thd->mysys_var->mutex);
thd->mysys_var->current_mutex= 0;
thd->mysys_var->current_cond= 0;
pthread_mutex_unlock(&thd->mysys_var->mutex);
- pthread_mutex_unlock(&LOCK_user_locks);
pthread_cond_destroy(&cond);
return test(!error); // Return 1 killed
@@ -4938,13 +4944,44 @@ bool Item_func_match::fix_fields(THD *thd, Item **ref)
my_error(ER_WRONG_ARGUMENTS,MYF(0),"MATCH");
return TRUE;
}
- table=((Item_field *)item)->field->table;
+ /*
+ With prepared statements Item_func_match::fix_fields is called twice.
+ When it is called first time we have original item tree here and add
+ conversion layer for character sets that do not have ctype array a few
+ lines below. When it is called second time, we already have conversion
+ layer in item tree.
+ */
+ table= (item->type() == Item::FIELD_ITEM) ?
+ ((Item_field *)item)->field->table :
+ ((Item_field *)((Item_func_conv *)item)->key_item())->field->table;
if (!(table->file->table_flags() & HA_CAN_FULLTEXT))
{
my_error(ER_TABLE_CANT_HANDLE_FT, MYF(0));
return 1;
}
table->fulltext_searched=1;
+ /* A workaround for ucs2 character set */
+ if (!args[1]->collation.collation->ctype)
+ {
+ CHARSET_INFO *compatible_cs=
+ get_compatible_charset_with_ctype(args[1]->collation.collation);
+ bool rc= 1;
+ if (compatible_cs)
+ {
+ Item_string *conv_item= new Item_string("", 0, compatible_cs,
+ DERIVATION_EXPLICIT);
+ item= args[0];
+ args[0]= conv_item;
+ rc= agg_item_charsets(cmp_collation, func_name(), args, arg_count,
+ MY_COLL_ALLOW_SUPERSET_CONV |
+ MY_COLL_ALLOW_COERCIBLE_CONV |
+ MY_COLL_DISALLOW_NONE, 1);
+ args[0]= item;
+ }
+ else
+ my_error(ER_WRONG_ARGUMENTS, MYF(0), "MATCH");
+ return rc;
+ }
return agg_arg_collations_for_comparison(cmp_collation,
args+1, arg_count-1, 0);
}
diff --git a/sql/item_func.h b/sql/item_func.h
index 56b5e75652c..a5e162f344f 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -236,9 +236,40 @@ public:
my_decimal *val_decimal(my_decimal *);
String *val_str(String*str);
+ /**
+ @brief Performs the operation that this functions implements when the
+ result type is INT.
+
+ @return The result of the operation.
+ */
virtual longlong int_op()= 0;
+
+ /**
+ @brief Performs the operation that this functions implements when the
+ result type is REAL.
+
+ @return The result of the operation.
+ */
virtual double real_op()= 0;
+
+ /**
+ @brief Performs the operation that this functions implements when the
+ result type is DECIMAL.
+
+ @param A pointer where the DECIMAL value will be allocated.
+ @return
+ - 0 If the result is NULL
+ - The same pointer it was given, with the area initialized to the
+ result of the operation.
+ */
virtual my_decimal *decimal_op(my_decimal *)= 0;
+
+ /**
+ @brief Performs the operation that this functions implements when the
+ result type is a string type.
+
+ @return The result of the operation.
+ */
virtual String *str_op(String *)= 0;
bool is_null() { update_null_value(); return null_value; }
};
@@ -435,6 +466,7 @@ public:
longlong int_op();
my_decimal *decimal_op(my_decimal *);
const char *func_name() const { return "-"; }
+ virtual bool basic_const_item() const { return args[0]->basic_const_item(); }
void fix_length_and_dec();
void fix_num_length_and_dec();
uint decimal_precision() const { return args[0]->decimal_precision(); }
@@ -692,7 +724,8 @@ class Item_func_min_max :public Item_func
/* An item used for issuing warnings while string to DATETIME conversion. */
Item *datetime_item;
THD *thd;
-
+protected:
+ enum_field_types cached_field_type;
public:
Item_func_min_max(List<Item> &list,int cmp_sign_arg) :Item_func(list),
cmp_type(INT_RESULT), cmp_sign(cmp_sign_arg), compare_as_dates(FALSE),
@@ -705,6 +738,7 @@ public:
enum Item_result result_type () const { return cmp_type; }
bool result_as_longlong() { return compare_as_dates; };
uint cmp_datetimes(ulonglong *value);
+ enum_field_types field_type() const { return cached_field_type; }
};
class Item_func_min :public Item_func_min_max
@@ -747,6 +781,8 @@ public:
collation= args[0]->collation;
max_length= args[0]->max_length;
decimals=args[0]->decimals;
+ /* The item could be a NULL constant. */
+ null_value= args[0]->is_null();
}
};
diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc
index 6c012277888..966cefea9fe 100644
--- a/sql/item_geofunc.cc
+++ b/sql/item_geofunc.cc
@@ -27,7 +27,7 @@
Field *Item_geometry_func::tmp_table_field(TABLE *t_arg)
{
return new Field_geom(max_length, maybe_null, name, t_arg,
- (Field::geometry_type) get_geometry_type());
+ get_geometry_type());
}
void Item_geometry_func::fix_length_and_dec()
@@ -38,10 +38,6 @@ void Item_geometry_func::fix_length_and_dec()
maybe_null= 1;
}
-int Item_geometry_func::get_geometry_type() const
-{
- return (int)Field::GEOM_GEOMETRY;
-}
String *Item_func_geometry_from_text::val_str(String *str)
{
@@ -160,9 +156,9 @@ String *Item_func_geometry_type::val_str(String *str)
}
-int Item_func_envelope::get_geometry_type() const
+Field::geometry_type Item_func_envelope::get_geometry_type() const
{
- return (int) Field::GEOM_POLYGON;
+ return Field::GEOM_POLYGON;
}
@@ -190,9 +186,9 @@ String *Item_func_envelope::val_str(String *str)
}
-int Item_func_centroid::get_geometry_type() const
+Field::geometry_type Item_func_centroid::get_geometry_type() const
{
- return (int) Field::GEOM_POINT;
+ return Field::GEOM_POINT;
}
@@ -330,9 +326,9 @@ err:
*/
-int Item_func_point::get_geometry_type() const
+Field::geometry_type Item_func_point::get_geometry_type() const
{
- return (int) Field::GEOM_POINT;
+ return Field::GEOM_POINT;
}
diff --git a/sql/item_geofunc.h b/sql/item_geofunc.h
index 9c7970f9e53..e99510f762f 100644
--- a/sql/item_geofunc.h
+++ b/sql/item_geofunc.h
@@ -33,7 +33,6 @@ public:
void fix_length_and_dec();
enum_field_types field_type() const { return MYSQL_TYPE_GEOMETRY; }
Field *tmp_table_field(TABLE *t_arg);
- virtual int get_geometry_type() const;
bool is_null() { (void) val_int(); return null_value; }
};
@@ -92,7 +91,7 @@ public:
Item_func_centroid(Item *a): Item_geometry_func(a) {}
const char *func_name() const { return "centroid"; }
String *val_str(String *);
- int get_geometry_type() const;
+ Field::geometry_type get_geometry_type() const;
};
class Item_func_envelope: public Item_geometry_func
@@ -101,7 +100,7 @@ public:
Item_func_envelope(Item *a): Item_geometry_func(a) {}
const char *func_name() const { return "envelope"; }
String *val_str(String *);
- int get_geometry_type() const;
+ Field::geometry_type get_geometry_type() const;
};
class Item_func_point: public Item_geometry_func
@@ -111,7 +110,7 @@ public:
Item_func_point(Item *a, Item *b, Item *srid): Item_geometry_func(a, b, srid) {}
const char *func_name() const { return "point"; }
String *val_str(String *);
- int get_geometry_type() const;
+ Field::geometry_type get_geometry_type() const;
};
class Item_func_spatial_decomp: public Item_geometry_func
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 0c11c9eece8..4e72f117869 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -38,36 +38,6 @@ C_MODE_END
String my_empty_string("",default_charset_info);
-String *Item_str_func::check_well_formed_result(String *str)
-{
- /* Check whether we got a well-formed string */
- CHARSET_INFO *cs= str->charset();
- int well_formed_error;
- uint wlen= cs->cset->well_formed_len(cs,
- str->ptr(), str->ptr() + str->length(),
- str->length(), &well_formed_error);
- if (wlen < str->length())
- {
- THD *thd= current_thd;
- char hexbuf[7];
- enum MYSQL_ERROR::enum_warning_level level;
- uint diff= str->length() - wlen;
- set_if_smaller(diff, 3);
- octet2hex(hexbuf, str->ptr() + wlen, diff);
- if (thd->variables.sql_mode &
- (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES))
- {
- level= MYSQL_ERROR::WARN_LEVEL_ERROR;
- null_value= 1;
- str= 0;
- }
- else
- level= MYSQL_ERROR::WARN_LEVEL_WARN;
- push_warning_printf(thd, level, ER_INVALID_CHARACTER_STRING,
- ER(ER_INVALID_CHARACTER_STRING), cs->csname, hexbuf);
- }
- return str;
-}
bool Item_str_func::fix_fields(THD *thd, Item **ref)
@@ -2229,11 +2199,13 @@ String *Item_func_char::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
str->length(0);
+ str->set_charset(collation.collation);
for (uint i=0 ; i < arg_count ; i++)
{
int32 num=(int32) args[i]->val_int();
if (!args[i]->null_value)
{
+ char char_num= (char) num;
if (num&0xFF000000L) {
str->append((char)(num>>24));
goto b2;
@@ -2243,10 +2215,9 @@ String *Item_func_char::val_str(String *str)
} else if (num&0xFF00L) {
b1: str->append((char)(num>>8));
}
- str->append((char) num);
+ str->append(&char_num, 1);
}
}
- str->set_charset(collation.collation);
str->realloc(str->length()); // Add end 0 (for Purify)
return check_well_formed_result(str);
}
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 6ca0b89a22b..3648438a69b 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -35,7 +35,6 @@ public:
my_decimal *val_decimal(my_decimal *);
enum Item_result result_type () const { return STRING_RESULT; }
void left_right_max_length();
- String *check_well_formed_result(String *str);
bool fix_fields(THD *thd, Item **ref);
};
@@ -535,7 +534,7 @@ public:
String *val_str(String *);
void fix_length_and_dec()
{
- max_length= arg_count * collation.collation->mbmaxlen;
+ max_length= arg_count * 4;
}
const char *func_name() const { return "char"; }
};
@@ -585,7 +584,8 @@ public:
void fix_length_and_dec()
{
collation.set(default_charset());
- max_length= 64;
+ max_length=64;
+ maybe_null= 1;
}
};
@@ -683,7 +683,12 @@ public:
}
String* val_str(String* str);
const char *func_name() const { return "inet_ntoa"; }
- void fix_length_and_dec() { decimals = 0; max_length=3*8+7; }
+ void fix_length_and_dec()
+ {
+ decimals= 0;
+ max_length= 3 * 8 + 7;
+ maybe_null= 1;
+ }
};
class Item_func_quote :public Item_str_func
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 0020dd35c61..57c3b391507 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -1717,7 +1717,7 @@ void subselect_engine::set_row(List<Item> &item_list, Item_cache **row)
item->decimals= sel_item->decimals;
item->unsigned_flag= sel_item->unsigned_flag;
maybe_null= sel_item->maybe_null;
- if (!(row[i]= Item_cache::get_cache(res_type)))
+ if (!(row[i]= Item_cache::get_cache(sel_item)))
return;
row[i]->setup(sel_item);
}
@@ -2178,6 +2178,7 @@ int subselect_indexsubquery_engine::exec()
((Item_in_subselect *) item)->value= 0;
empty_result_set= TRUE;
null_keypart= 0;
+ table->status= 0;
if (check_null)
{
@@ -2190,6 +2191,16 @@ int subselect_indexsubquery_engine::exec()
if (copy_ref_key())
DBUG_RETURN(1);
+ if (table->status)
+ {
+ /*
+ We know that there will be no rows even if we scan.
+ Can be set in copy_ref_key.
+ */
+ ((Item_in_subselect *) item)->value= 0;
+ DBUG_RETURN(0);
+ }
+
if (null_keypart)
DBUG_RETURN(scan_table());
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index 118609671b8..51dcd3ca175 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -306,6 +306,7 @@ public:
double val_real();
String *val_str(String*);
my_decimal *val_decimal(my_decimal *);
+ void update_null_value () { (void) val_bool(); }
bool val_bool();
void top_level_item() { abort_on_null=1; }
inline bool is_top_level_item() { return abort_on_null; }
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index c20d3fba705..ad8ebd0791c 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -905,7 +905,9 @@ bool Item_sum_distinct::setup(THD *thd)
List<create_field> field_list;
create_field field_def; /* field definition */
DBUG_ENTER("Item_sum_distinct::setup");
- DBUG_ASSERT(tree == 0);
+ /* It's legal to call setup() more than once when in a subquery */
+ if (tree)
+ DBUG_RETURN(FALSE);
/*
Virtual table and the tree are created anew on each re-execution of
@@ -913,7 +915,7 @@ bool Item_sum_distinct::setup(THD *thd)
mem_root.
*/
if (field_list.push_back(&field_def))
- return TRUE;
+ DBUG_RETURN(TRUE);
null_value= maybe_null= 1;
quick_group= 0;
@@ -925,7 +927,7 @@ bool Item_sum_distinct::setup(THD *thd)
args[0]->unsigned_flag);
if (! (table= create_virtual_tmp_table(thd, field_list)))
- return TRUE;
+ DBUG_RETURN(TRUE);
/* XXX: check that the case of CHAR(0) works OK */
tree_key_length= table->s->reclength - table->s->null_bytes;
@@ -2443,6 +2445,7 @@ bool Item_sum_count_distinct::setup(THD *thd)
/*
Setup can be called twice for ROLLUP items. This is a bug.
Please add DBUG_ASSERT(tree == 0) here when it's fixed.
+ It's legal to call setup() more than once when in a subquery
*/
if (tree || table || tmp_table_param)
return FALSE;
@@ -3307,15 +3310,34 @@ bool Item_func_group_concat::setup(THD *thd)
count_field_types(select_lex, tmp_table_param, all_fields, 0);
tmp_table_param->force_copy_fields= force_copy_fields;
DBUG_ASSERT(table == 0);
- /*
- Currently we have to force conversion of BLOB values to VARCHAR's
- if we are to store them in TREE objects used for ORDER BY and
- DISTINCT. This leads to truncation if the BLOB's size exceeds
- Field_varstring::MAX_SIZE.
- */
if (arg_count_order > 0 || distinct)
+ {
+ /*
+ Currently we have to force conversion of BLOB values to VARCHAR's
+ if we are to store them in TREE objects used for ORDER BY and
+ DISTINCT. This leads to truncation if the BLOB's size exceeds
+ Field_varstring::MAX_SIZE.
+ */
set_if_smaller(tmp_table_param->convert_blob_length,
Field_varstring::MAX_SIZE);
+
+ /*
+ Force the create_tmp_table() to convert BIT columns to INT
+ as we cannot compare two table records containg BIT fields
+ stored in the the tree used for distinct/order by.
+ Moreover we don't even save in the tree record null bits
+ where BIT fields store parts of their data.
+ */
+ List_iterator_fast<Item> li(all_fields);
+ Item *item;
+ while ((item= li++))
+ {
+ if (item->type() == Item::FIELD_ITEM &&
+ ((Item_field*) item)->field->type() == FIELD_TYPE_BIT)
+ item->marker= 4;
+ }
+ }
+
/*
We have to create a temporary table to get descriptions of fields
(types, sizes and so on).
@@ -3384,7 +3406,7 @@ String* Item_func_group_concat::val_str(String* str)
DBUG_ASSERT(fixed == 1);
if (null_value)
return 0;
- if (!result.length() && tree)
+ if (no_appended && tree)
/* Tree is used for sorting as in ORDER BY */
tree_walk(tree, (tree_walk_action)&dump_leaf_key, (void*)this,
left_root_right);
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index b9a923fcb0f..4ddc788b182 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -2645,6 +2645,13 @@ bool Item_date_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
}
+bool Item_date_typecast::get_time(MYSQL_TIME *ltime)
+{
+ bzero((char *)ltime, sizeof(MYSQL_TIME));
+ return args[0]->null_value;
+}
+
+
String *Item_date_typecast::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
@@ -3305,38 +3312,42 @@ Field *Item_func_str_to_date::tmp_table_field(TABLE *t_arg)
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;
+ cached_field_type= MYSQL_TYPE_DATETIME;
max_length= MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
cached_timestamp_type= MYSQL_TIMESTAMP_NONE;
- format= args[1]->val_str(&format_str);
- if (!args[1]->null_value && (const_item= args[1]->const_item()))
+ if ((const_item= args[1]->const_item()))
{
- cached_format_type= get_date_time_result_type(format->ptr(),
- format->length());
- switch (cached_format_type) {
- case DATE_ONLY:
- cached_timestamp_type= MYSQL_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= MYSQL_TIMESTAMP_TIME;
- cached_field_type= MYSQL_TYPE_TIME;
- max_length= MAX_TIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
- break;
- default:
- cached_timestamp_type= MYSQL_TIMESTAMP_DATETIME;
- cached_field_type= MYSQL_TYPE_DATETIME;
- break;
+ char format_buff[64];
+ String format_str(format_buff, sizeof(format_buff), &my_charset_bin);
+ String *format= args[1]->val_str(&format_str);
+ if (!args[1]->null_value)
+ {
+ cached_format_type= get_date_time_result_type(format->ptr(),
+ format->length());
+ switch (cached_format_type) {
+ case DATE_ONLY:
+ cached_timestamp_type= MYSQL_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= MYSQL_TIMESTAMP_TIME;
+ cached_field_type= MYSQL_TYPE_TIME;
+ max_length= MAX_TIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN;
+ break;
+ default:
+ cached_timestamp_type= MYSQL_TIMESTAMP_DATETIME;
+ cached_field_type= MYSQL_TYPE_DATETIME;
+ break;
+ }
}
}
}
+
bool Item_func_str_to_date::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
{
DATE_TIME_FORMAT date_time_format;
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index 8e925a0156f..b647e93b700 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -779,6 +779,7 @@ public:
const char *func_name() const { return "cast_as_date"; }
String *val_str(String *str);
bool get_date(MYSQL_TIME *ltime, uint fuzzy_date);
+ bool get_time(MYSQL_TIME *ltime);
const char *cast_type() const { return "date"; }
enum_field_types field_type() const { return MYSQL_TYPE_DATE; }
Field *tmp_table_field(TABLE *t_arg)
@@ -844,7 +845,9 @@ public:
enum_field_types field_type() const { return MYSQL_TYPE_DATETIME; }
void fix_length_and_dec()
{
- Item_typecast_maybe_null::fix_length_and_dec();
+ collation.set(&my_charset_bin);
+ maybe_null= 1;
+ max_length= MAX_DATETIME_FULL_WIDTH * MY_CHARSET_BIN_MB_MAXLEN;
decimals= DATETIME_DEC;
}
@@ -962,7 +965,10 @@ class Item_func_maketime :public Item_str_timefunc
{
public:
Item_func_maketime(Item *a, Item *b, Item *c)
- :Item_str_timefunc(a, b ,c) {}
+ :Item_str_timefunc(a, b, c)
+ {
+ maybe_null= TRUE;
+ }
String *val_str(String *str);
const char *func_name() const { return "maketime"; }
};
@@ -1030,7 +1036,7 @@ class Item_func_str_to_date :public Item_str_func
bool const_item;
public:
Item_func_str_to_date(Item *a, Item *b)
- :Item_str_func(a, b)
+ :Item_str_func(a, b), const_item(false)
{}
String *val_str(String *str);
bool get_date(MYSQL_TIME *ltime, uint fuzzy_date);
diff --git a/sql/log.cc b/sql/log.cc
index e9aa273676a..af03cecd462 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -448,13 +448,10 @@ const char *MYSQL_LOG::generate_name(const char *log_name,
{
if (!log_name || !log_name[0])
{
- /*
- 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(buff, pidfile_name,FN_REFLEN-5);
- strmov(fn_ext(buff),suffix);
- return (const char *)buff;
+ strmake(buff, pidfile_name, FN_REFLEN - strlen(suffix) - 1);
+ return (const char *)
+ fn_format(buff, buff, "", suffix, MYF(MY_REPLACE_EXT|MY_REPLACE_DIR));
+
}
// get rid of extension if the log is binary to avoid problems
if (strip_ext)
diff --git a/sql/log_event.cc b/sql/log_event.cc
index d8bab9380a8..12d861cc126 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -27,6 +27,10 @@
#define log_cs &my_charset_latin1
+#ifndef DBUG_OFF
+uint debug_not_change_ts_if_art_event= 1; // bug#29309 simulation
+#endif
+
/*
pretty_print_str()
*/
@@ -481,6 +485,18 @@ int Log_event::exec_event(struct st_relay_log_info* rli)
rli->inc_event_relay_log_pos();
else
{
+ /*
+ bug#29309 simulation: resetting the flag to force
+ wrong behaviour of artificial event to update
+ rli->last_master_timestamp for only one time -
+ the first FLUSH LOGS in the test.
+ */
+ DBUG_EXECUTE_IF("let_first_flush_log_change_timestamp",
+ if (debug_not_change_ts_if_art_event == 1
+ && is_artificial_event())
+ {
+ debug_not_change_ts_if_art_event= 0;
+ });
rli->inc_group_relay_log_pos(log_pos);
flush_relay_log_info(rli);
/*
@@ -491,7 +507,21 @@ int Log_event::exec_event(struct st_relay_log_info* rli)
rare cases, only consequence is that value may take some time to
display in Seconds_Behind_Master - not critical).
*/
- rli->last_master_timestamp= when;
+#ifndef DBUG_OFF
+ if (!(is_artificial_event() && debug_not_change_ts_if_art_event > 0))
+#else
+ if (!is_artificial_event())
+#endif
+ rli->last_master_timestamp= when;
+ /*
+ The flag is set back to be positive so that
+ any further FLUSH LOGS will be handled as prescribed.
+ */
+ DBUG_EXECUTE_IF("let_first_flush_log_change_timestamp",
+ if (debug_not_change_ts_if_art_event == 0)
+ {
+ debug_not_change_ts_if_art_event= 2;
+ });
}
}
DBUG_RETURN(0);
@@ -1370,18 +1400,48 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
/* 2 utility functions for the next method */
-/*
- Get the pointer for a string (src) that contains the length in
- the first byte. Set the output string (dst) to the string value
- and place the length of the string in the byte after the string.
+/**
+ Read a string with length from memory.
+
+ This function reads the string-with-length stored at
+ <code>src</code> and extract the length into <code>*len</code> and
+ a pointer to the start of the string into <code>*dst</code>. The
+ string can then be copied using <code>memcpy()</code> with the
+ number of bytes given in <code>*len</code>.
+
+ @param src Pointer to variable holding a pointer to the memory to
+ read the string from.
+ @param dst Pointer to variable holding a pointer where the actual
+ string starts. Starting from this position, the string
+ can be copied using @c memcpy().
+ @param len Pointer to variable where the length will be stored.
+ @param end One-past-the-end of the memory where the string is
+ stored.
+
+ @return Zero if the entire string can be copied successfully,
+ @c UINT_MAX if the length could not be read from memory
+ (that is, if <code>*src >= end</code>), otherwise the
+ number of bytes that are missing to read the full
+ string, which happends <code>*dst + *len >= end</code>.
*/
-static void get_str_len_and_pointer(const Log_event::Byte **src,
- const char **dst,
- uint *len)
-{
- if ((*len= **src))
- *dst= (char *)*src + 1; // Will be copied later
- (*src)+= *len + 1;
+static int
+get_str_len_and_pointer(const Log_event::Byte **src,
+ const char **dst,
+ uint *len,
+ const Log_event::Byte *end)
+{
+ if (*src >= end)
+ return -1; // Will be UINT_MAX in two-complement arithmetics
+ uint length= **src;
+ if (length > 0)
+ {
+ if (*src + length >= end)
+ return *src + length - end + 1; // Number of bytes missing
+ *dst= (char *)*src + 1; // Will be copied later
+ }
+ *len= length;
+ *src+= length + 1;
+ return 0;
}
static void copy_str_and_move(const char **src,
@@ -1394,6 +1454,46 @@ static void copy_str_and_move(const char **src,
*(*dst)++= 0;
}
+
+#ifndef DBUG_OFF
+static char const *
+code_name(int code)
+{
+ static char buf[255];
+ switch (code) {
+ case Q_FLAGS2_CODE: return "Q_FLAGS2_CODE";
+ case Q_SQL_MODE_CODE: return "Q_SQL_MODE_CODE";
+ case Q_CATALOG_CODE: return "Q_CATALOG_CODE";
+ case Q_AUTO_INCREMENT: return "Q_AUTO_INCREMENT";
+ case Q_CHARSET_CODE: return "Q_CHARSET_CODE";
+ case Q_TIME_ZONE_CODE: return "Q_TIME_ZONE_CODE";
+ case Q_CATALOG_NZ_CODE: return "Q_CATALOG_NZ_CODE";
+ case Q_LC_TIME_NAMES_CODE: return "Q_LC_TIME_NAMES_CODE";
+ case Q_CHARSET_DATABASE_CODE: return "Q_CHARSET_DATABASE_CODE";
+ }
+ sprintf(buf, "CODE#%d", code);
+ return buf;
+}
+#endif
+
+/**
+ Macro to check that there is enough space to read from memory.
+
+ @param PTR Pointer to memory
+ @param END End of memory
+ @param CNT Number of bytes that should be read.
+ */
+#define CHECK_SPACE(PTR,END,CNT) \
+ do { \
+ DBUG_PRINT("info", ("Read %s", code_name(pos[-1]))); \
+ DBUG_ASSERT((PTR) + (CNT) <= (END)); \
+ if ((PTR) + (CNT) > (END)) { \
+ DBUG_PRINT("info", ("query= 0")); \
+ query= 0; \
+ DBUG_VOID_RETURN; \
+ } \
+ } while (0)
+
/*
Query_log_event::Query_log_event()
This is used by the SQL slave thread to prepare the event before execution.
@@ -1445,6 +1545,19 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
if (tmp)
{
status_vars_len= uint2korr(buf + Q_STATUS_VARS_LEN_OFFSET);
+ /*
+ Check if status variable length is corrupt and will lead to very
+ wrong data. We could be even more strict and require data_len to
+ be even bigger, but this will suffice to catch most corruption
+ errors that can lead to a crash.
+ */
+ if (status_vars_len > min(data_len, MAX_SIZE_LOG_EVENT_STATUS))
+ {
+ DBUG_PRINT("info", ("status_vars_len (%u) > data_len (%lu); query= 0",
+ status_vars_len, data_len));
+ query= 0;
+ DBUG_VOID_RETURN;
+ }
data_len-= status_vars_len;
DBUG_PRINT("info", ("Query_log_event has status_vars_len: %u",
(uint) status_vars_len));
@@ -1464,6 +1577,7 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
{
switch (*pos++) {
case Q_FLAGS2_CODE:
+ CHECK_SPACE(pos, end, 4);
flags2_inited= 1;
flags2= uint4korr(pos);
DBUG_PRINT("info",("In Query_log_event, read flags2: %lu", (ulong) flags2));
@@ -1474,6 +1588,7 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
#ifndef DBUG_OFF
char buff[22];
#endif
+ CHECK_SPACE(pos, end, 8);
sql_mode_inited= 1;
sql_mode= (ulong) uint8korr(pos); // QQ: Fix when sql_mode is ulonglong
DBUG_PRINT("info",("In Query_log_event, read sql_mode: %s",
@@ -1482,15 +1597,24 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
break;
}
case Q_CATALOG_NZ_CODE:
- get_str_len_and_pointer(&pos, &catalog, &catalog_len);
+ DBUG_PRINT("info", ("case Q_CATALOG_NZ_CODE; pos: 0x%lx; end: 0x%lx",
+ (ulong) pos, (ulong) end));
+ if (get_str_len_and_pointer(&pos, &catalog, &catalog_len, end))
+ {
+ DBUG_PRINT("info", ("query= 0"));
+ query= 0;
+ DBUG_VOID_RETURN;
+ }
break;
case Q_AUTO_INCREMENT:
+ CHECK_SPACE(pos, end, 4);
auto_increment_increment= uint2korr(pos);
auto_increment_offset= uint2korr(pos+2);
pos+= 4;
break;
case Q_CHARSET_CODE:
{
+ CHECK_SPACE(pos, end, 6);
charset_inited= 1;
memcpy(charset, pos, 6);
pos+= 6;
@@ -1498,20 +1622,29 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
}
case Q_TIME_ZONE_CODE:
{
- get_str_len_and_pointer(&pos, &time_zone_str, &time_zone_len);
+ if (get_str_len_and_pointer(&pos, &time_zone_str, &time_zone_len, end))
+ {
+ DBUG_PRINT("info", ("Q_TIME_ZONE_CODE: query= 0"));
+ query= 0;
+ DBUG_VOID_RETURN;
+ }
break;
}
case Q_CATALOG_CODE: /* for 5.0.x where 0<=x<=3 masters */
+ CHECK_SPACE(pos, end, 1);
if ((catalog_len= *pos))
catalog= (char*) pos+1; // Will be copied later
+ CHECK_SPACE(pos, end, catalog_len + 2);
pos+= catalog_len+2; // leap over end 0
catalog_nz= 0; // catalog has end 0 in event
break;
case Q_LC_TIME_NAMES_CODE:
+ CHECK_SPACE(pos, end, 2);
lc_time_names_number= uint2korr(pos);
pos+= 2;
break;
case Q_CHARSET_DATABASE_CODE:
+ CHECK_SPACE(pos, end, 2);
charset_database_number= uint2korr(pos);
pos+= 2;
break;
@@ -2021,6 +2154,7 @@ end:
*/
thd->catalog= 0;
thd->set_db(NULL, 0); /* will free the current database */
+ DBUG_PRINT("info", ("end: query= 0"));
thd->query= 0; // just to be sure
thd->query_length= 0;
VOID(pthread_mutex_unlock(&LOCK_thread_count));
@@ -4964,12 +5098,13 @@ int Begin_load_query_log_event::get_create_or_append() const
#ifndef MYSQL_CLIENT
Execute_load_query_log_event::
Execute_load_query_log_event(THD* thd_arg, const char* query_arg,
- ulong query_length_arg, uint fn_pos_start_arg,
- uint fn_pos_end_arg,
- enum_load_dup_handling dup_handling_arg,
- bool using_trans, bool suppress_use):
+ ulong query_length_arg, uint fn_pos_start_arg,
+ uint fn_pos_end_arg,
+ enum_load_dup_handling dup_handling_arg,
+ bool using_trans, bool suppress_use,
+ THD::killed_state killed_err_arg):
Query_log_event(thd_arg, query_arg, query_length_arg, using_trans,
- suppress_use),
+ suppress_use, killed_err_arg),
file_id(thd_arg->file_id), fn_pos_start(fn_pos_start_arg),
fn_pos_end(fn_pos_end_arg), dup_handling(dup_handling_arg)
{
diff --git a/sql/log_event.h b/sql/log_event.h
index 04aac5d08fc..5b065a33dd1 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -1619,10 +1619,12 @@ public:
#ifndef MYSQL_CLIENT
Execute_load_query_log_event(THD* thd, const char* query_arg,
- ulong query_length, uint fn_pos_start_arg,
- uint fn_pos_end_arg,
- enum_load_dup_handling dup_handling_arg,
- bool using_trans, bool suppress_use);
+ ulong query_length, uint fn_pos_start_arg,
+ uint fn_pos_end_arg,
+ enum_load_dup_handling dup_handling_arg,
+ bool using_trans, bool suppress_use,
+ THD::killed_state
+ killed_err_arg= THD::KILLED_NO_VALUE);
#ifdef HAVE_REPLICATION
void pack_info(Protocol* protocol);
int exec_event(struct st_relay_log_info* rli);
diff --git a/sql/my_decimal.cc b/sql/my_decimal.cc
index 4ef2ae5cf95..31a5b09370a 100644
--- a/sql/my_decimal.cc
+++ b/sql/my_decimal.cc
@@ -68,24 +68,43 @@ int decimal_operation_results(int result)
}
-/*
- Converting decimal to string
-
- SYNOPSIS
- my_decimal2string()
-
- return
- E_DEC_OK
- E_DEC_TRUNCATED
- E_DEC_OVERFLOW
- E_DEC_OOM
+/**
+ @brief Converting decimal to string
+
+ @details Convert given my_decimal to String; allocate buffer as needed.
+
+ @param[in] mask what problems to warn on (mask of E_DEC_* values)
+ @param[in] d the decimal to print
+ @param[in] fixed_prec overall number of digits if ZEROFILL, 0 otherwise
+ @param[in] fixed_dec number of decimal places (if fixed_prec != 0)
+ @param[in] filler what char to pad with (ZEROFILL et al.)
+ @param[out] *str where to store the resulting string
+
+ @return error coce
+ @retval E_DEC_OK
+ @retval E_DEC_TRUNCATED
+ @retval E_DEC_OVERFLOW
+ @retval E_DEC_OOM
*/
int my_decimal2string(uint mask, const my_decimal *d,
uint fixed_prec, uint fixed_dec,
char filler, String *str)
{
- int length= (fixed_prec ? (fixed_prec + 1) : my_decimal_string_length(d));
+ /*
+ Calculate the size of the string: For DECIMAL(a,b), fixed_prec==a
+ holds true iff the type is also ZEROFILL, which in turn implies
+ UNSIGNED. Hence the buffer for a ZEROFILLed value is the length
+ the user requested, plus one for a possible decimal point, plus
+ one if the user only wanted decimal places, but we force a leading
+ zero on them. Because the type is implicitly UNSIGNED, we do not
+ need to reserve a character for the sign. For all other cases,
+ fixed_prec will be 0, and my_decimal_string_length() will be called
+ instead to calculate the required size of the buffer.
+ */
+ int length= (fixed_prec
+ ? (fixed_prec + ((fixed_prec == fixed_dec) ? 1 : 0) + 1)
+ : my_decimal_string_length(d));
int result;
if (str->alloc(length))
return check_result(mask, E_DEC_OOM);
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 20e4dacaded..e41aaa2e1fa 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -247,8 +247,13 @@ MY_LOCALE *my_locale_by_number(uint number);
#define PRECISION_FOR_DOUBLE 53
#define PRECISION_FOR_FLOAT 24
+/*
+ Default time to wait before aborting a new client connection
+ that does not respond to "initial server greeting" timely
+*/
+#define CONNECT_TIMEOUT 10
+
/* The following can also be changed from the command line */
-#define CONNECT_TIMEOUT 5 // Do not wait long for connect
#define DEFAULT_CONCURRENCY 10
#define DELAYED_LIMIT 100 /* pause after xxx inserts */
#define DELAYED_QUEUE_SIZE 1000
@@ -744,7 +749,6 @@ pthread_handler_t handle_bootstrap(void *arg);
void end_thread(THD *thd,bool put_in_cache);
void flush_thread_cache();
bool mysql_execute_command(THD *thd);
-bool do_command(THD *thd);
bool dispatch_command(enum enum_server_command command, THD *thd,
char* packet, uint packet_length);
void log_slow_statement(THD *thd);
@@ -1240,6 +1244,7 @@ my_bool mysql_rm_tmp_tables(void);
/* item_func.cc */
extern bool check_reserved_words(LEX_STRING *name);
+extern enum_field_types agg_field_type(Item **items, uint nitems);
/* strfunc.cc */
ulonglong find_set(TYPELIB *lib, const char *x, uint length, CHARSET_INFO *cs,
@@ -1325,8 +1330,8 @@ extern bool opt_endinfo, using_udf_functions;
extern my_bool locked_in_memory;
extern bool opt_using_transactions, mysqld_embedded;
extern bool using_update_log, opt_large_files, server_id_supplied;
-extern bool opt_log, opt_update_log, opt_bin_log, opt_slow_log, opt_error_log;
-extern my_bool opt_log_queries_not_using_indexes;
+extern bool opt_update_log, opt_bin_log, opt_error_log;
+extern my_bool opt_log, opt_slow_log, opt_log_queries_not_using_indexes;
extern bool opt_disable_networking, opt_skip_show_db;
extern my_bool opt_character_set_client_handshake;
extern bool volatile abort_loop, shutdown_in_progress, grant_option;
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 5093a0a4978..5f5c6a9859b 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -339,8 +339,8 @@ static my_bool opt_sync_bdb_logs;
/* Global variables */
-bool opt_log, opt_update_log, opt_bin_log, opt_slow_log;
-my_bool opt_log_queries_not_using_indexes= 0;
+bool opt_update_log, opt_bin_log;
+my_bool opt_log, opt_slow_log, opt_log_queries_not_using_indexes= 0;
bool opt_error_log= IF_WIN(1,0);
bool opt_disable_networking=0, opt_skip_show_db=0;
my_bool opt_character_set_client_handshake= 1;
@@ -1300,8 +1300,21 @@ static void set_ports()
{ // Get port if not from commandline
struct servent *serv_ptr;
mysqld_port= MYSQL_PORT;
+
+ /*
+ if builder specifically requested a default port, use that
+ (even if it coincides with our factory default).
+ only if they didn't do we check /etc/services (and, failing
+ on that, fall back to the factory default of 3306).
+ either default can be overridden by the environment variable
+ MYSQL_TCP_PORT, which in turn can be overridden with command
+ line options.
+ */
+
+#if MYSQL_PORT_DEFAULT == 0
if ((serv_ptr= getservbyname("mysql", "tcp")))
mysqld_port= ntohs((u_short) serv_ptr->s_port); /* purecov: inspected */
+#endif
if ((env = getenv("MYSQL_TCP_PORT")))
mysqld_port= (uint) atoi(env); /* purecov: inspected */
}
@@ -2130,7 +2143,7 @@ bytes of memory\n", ((ulong) dflt_key_cache->key_cache_mem_size +
You seem to be running 32-bit Linux and have %d concurrent connections.\n\
If you have not changed STACK_SIZE in LinuxThreads and built the binary \n\
yourself, LinuxThreads is quite likely to steal a part of the global heap for\n\
-the thread stack. Please read http://www.mysql.com/doc/en/Linux.html\n\n",
+the thread stack. Please read http://dev.mysql.com/doc/mysql/en/linux.html\n\n",
thread_count);
}
#endif /* HAVE_LINUXTHREADS */
@@ -2150,7 +2163,7 @@ Some pointers may be invalid and cause the dump to abort...\n");
fprintf(stderr, "thd->thread_id=%lu\n", (ulong) thd->thread_id);
}
fprintf(stderr, "\
-The manual page at http://www.mysql.com/doc/en/Crashing.html contains\n\
+The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains\n\
information that should help you find out what is causing the crash.\n");
fflush(stderr);
#endif /* HAVE_STACKTRACE */
@@ -2489,7 +2502,12 @@ static int my_message_sql(uint error, const char *str, myf MyFlags)
thd->query_error= 1; // needed to catch query errors during replication
if (!thd->no_warnings_for_error)
+ {
+ thd->no_warnings_for_error= TRUE;
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, error, str);
+ thd->no_warnings_for_error= FALSE;
+ }
+
/*
thd->lex->current_select == 0 if lex structure is not inited
(not query command (COM_QUERY))
@@ -2849,7 +2867,6 @@ static int init_common_variables(const char *conf_file_name, int argc,
global_system_variables.collation_connection= default_charset_info;
global_system_variables.character_set_results= default_charset_info;
global_system_variables.character_set_client= default_charset_info;
- global_system_variables.collation_connection= default_charset_info;
if (!(character_set_filesystem=
get_charset_by_csname(character_set_filesystem_name,
@@ -4295,8 +4312,13 @@ pthread_handler_t handle_connections_sockets(void *arg __attribute__((unused)))
sock == unix_sock ? VIO_LOCALHOST: 0)) ||
my_net_init(&thd->net,vio_tmp))
{
- if (vio_tmp)
- vio_delete(vio_tmp);
+ /*
+ Only delete the temporary vio if we didn't already attach it to the
+ NET object. The destructor in THD will delete any initialized net
+ structure.
+ */
+ if (vio_tmp && thd->net.vio != vio_tmp)
+ vio_delete(vio_tmp);
else
{
(void) shutdown(new_sock, SHUT_RDWR);
@@ -4830,7 +4852,8 @@ enum options_mysqld
OPT_PROFILING,
OPT_INNODB_ROLLBACK_ON_TIMEOUT,
OPT_SECURE_FILE_PRIV,
- OPT_KEEP_FILES_ON_CREATE
+ OPT_KEEP_FILES_ON_CREATE,
+ OPT_INNODB_ADAPTIVE_HASH_INDEX
};
@@ -5058,6 +5081,12 @@ Disable with --skip-innodb-checksums.", (gptr*) &innobase_use_checksums,
"The common part for InnoDB table spaces.", (gptr*) &innobase_data_home_dir,
(gptr*) &innobase_data_home_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0,
0},
+ {"innodb_adaptive_hash_index", OPT_INNODB_ADAPTIVE_HASH_INDEX,
+ "Enable InnoDB adaptive hash index (enabled by default). "
+ "Disable with --skip-innodb-adaptive-hash-index.",
+ (gptr*) &innobase_adaptive_hash_index,
+ (gptr*) &innobase_adaptive_hash_index,
+ 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"innodb_doublewrite", OPT_INNODB_DOUBLEWRITE, "Enable InnoDB doublewrite buffer (enabled by default). \
Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite,
(gptr*) &innobase_use_doublewrite, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
@@ -5401,7 +5430,13 @@ Disable with --skip-ndbcluster (will save memory).",
{"pid-file", OPT_PID_FILE, "Pid file used by safe_mysqld.",
(gptr*) &pidfile_name_ptr, (gptr*) &pidfile_name_ptr, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"port", 'P', "Port number to use for connection.", (gptr*) &mysqld_port,
+ {"port", 'P', "Port number to use for connection or 0 for default to, in "
+ "order of preference, my.cnf, $MYSQL_TCP_PORT, "
+#if MYSQL_PORT_DEFAULT == 0
+ "/etc/services, "
+#endif
+ "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
+ (gptr*) &mysqld_port,
(gptr*) &mysqld_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port-open-timeout", OPT_PORT_OPEN_TIMEOUT,
"Maximum time in seconds to wait for the port to become free. "
@@ -5836,7 +5871,7 @@ log and this option does nothing anymore.",
"The size of the buffer that is used for full joins.",
(gptr*) &global_system_variables.join_buff_size,
(gptr*) &max_system_variables.join_buff_size, 0, GET_ULONG,
- REQUIRED_ARG, 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ~0L, MALLOC_OVERHEAD,
+ REQUIRED_ARG, 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, UINT_MAX32, MALLOC_OVERHEAD,
IO_SIZE, 0},
{"keep_files_on_create", OPT_KEEP_FILES_ON_CREATE,
"Don't overwrite stale .MYD and .MYI even if no directory is specified.",
@@ -6005,7 +6040,7 @@ The minimum value for this variable is 4096.",
"The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE.",
(gptr*) &global_system_variables.myisam_sort_buff_size,
(gptr*) &max_system_variables.myisam_sort_buff_size, 0,
- GET_ULONG, REQUIRED_ARG, 8192*1024, 4, ~0L, 0, 1, 0},
+ GET_ULONG, REQUIRED_ARG, 8192*1024, 4, UINT_MAX32, 0, 1, 0},
{"myisam_stats_method", OPT_MYISAM_STATS_METHOD,
"Specifies how MyISAM index statistics collection code should threat NULLs. "
"Possible values of name are \"nulls_unequal\" (default behavior for 4.1/5.0), "
@@ -6098,7 +6133,7 @@ The minimum value for this variable is 4096.",
"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,
(gptr*) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG,
- 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, SSIZE_MAX, MALLOC_OVERHEAD, IO_SIZE,
+ 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, INT_MAX32, MALLOC_OVERHEAD, IO_SIZE,
0},
{"read_only", OPT_READONLY,
"Make all non-temporary tables read-only, with the exception for replication (slave) threads and users with the SUPER privilege",
@@ -6110,12 +6145,12 @@ The minimum value for this variable is 4096.",
(gptr*) &global_system_variables.read_rnd_buff_size,
(gptr*) &max_system_variables.read_rnd_buff_size, 0,
GET_ULONG, REQUIRED_ARG, 256*1024L, IO_SIZE*2+MALLOC_OVERHEAD,
- SSIZE_MAX, MALLOC_OVERHEAD, IO_SIZE, 0},
+ INT_MAX32, MALLOC_OVERHEAD, IO_SIZE, 0},
{"record_buffer", OPT_RECORD_BUFFER,
"Alias for read_buffer_size",
(gptr*) &global_system_variables.read_buff_size,
(gptr*) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG,
- 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, SSIZE_MAX, MALLOC_OVERHEAD, IO_SIZE, 0},
+ 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, INT_MAX32, MALLOC_OVERHEAD, IO_SIZE, 0},
#ifdef HAVE_REPLICATION
{"relay_log_purge", OPT_RELAY_LOG_PURGE,
"0 = do not purge relay logs. 1 = purge them as soon as they are no more needed.",
@@ -6151,7 +6186,7 @@ The minimum value for this variable is 4096.",
"Each thread that needs to do a sort allocates a buffer of this size.",
(gptr*) &global_system_variables.sortbuff_size,
(gptr*) &max_system_variables.sortbuff_size, 0, GET_ULONG, REQUIRED_ARG,
- MAX_SORT_MEMORY, MIN_SORT_MEMORY+MALLOC_OVERHEAD*2, ~0L, MALLOC_OVERHEAD,
+ MAX_SORT_MEMORY, MIN_SORT_MEMORY+MALLOC_OVERHEAD*2, UINT_MAX32, MALLOC_OVERHEAD,
1, 0},
#ifdef HAVE_BERKELEY_DB
{"sync-bdb-logs", OPT_BDB_SYNC,
@@ -6526,7 +6561,8 @@ static void mysql_init_variables(void)
/* Things reset to zero */
opt_skip_slave_start= opt_reckless_slave = 0;
mysql_home[0]= pidfile_name[0]= log_error_file[0]= 0;
- opt_log= opt_update_log= opt_slow_log= 0;
+ opt_log= opt_slow_log= 0;
+ opt_update_log= 0;
opt_bin_log= 0;
opt_disable_networking= opt_skip_show_db=0;
opt_logname= opt_update_logname= opt_binlog_index_name= opt_slow_logname= 0;
@@ -7154,6 +7190,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
have_merge_db= SHOW_OPTION_YES;
else
have_merge_db= SHOW_OPTION_DISABLED;
+ break;
#ifdef HAVE_BERKELEY_DB
case OPT_BDB_NOSYNC:
/* Deprecated option */
@@ -7293,6 +7330,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
fprintf(stderr, "Unknown option to tc-heuristic-recover: %s\n",argument);
exit(1);
}
+ break;
}
case OPT_MYISAM_STATS_METHOD:
{
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 04e2816d553..facc8e09c27 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -2206,7 +2206,7 @@ double get_sweep_read_cost(const PARAM *param, ha_rows records)
if (param->table->file->primary_key_is_clustered())
{
result= param->table->file->read_time(param->table->s->primary_key,
- records, records);
+ (uint)records, records);
}
else
{
@@ -2414,7 +2414,7 @@ TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge,
/* Add Unique operations cost */
unique_calc_buff_size=
- Unique::get_cost_calc_buff_size(non_cpk_scan_records,
+ Unique::get_cost_calc_buff_size((ulong)non_cpk_scan_records,
param->table->file->ref_length,
param->thd->variables.sortbuff_size);
if (param->imerge_cost_buff_size < unique_calc_buff_size)
@@ -2426,7 +2426,7 @@ TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge,
}
imerge_cost +=
- Unique::get_use_cost(param->imerge_cost_buff, non_cpk_scan_records,
+ Unique::get_use_cost(param->imerge_cost_buff, (uint)non_cpk_scan_records,
param->table->file->ref_length,
param->thd->variables.sortbuff_size);
DBUG_PRINT("info",("index_merge total cost: %g (wanted: less then %g)",
@@ -2765,7 +2765,7 @@ ROR_INTERSECT_INFO* ror_intersect_init(const PARAM *param)
info->is_covering= FALSE;
info->index_scan_costs= 0.0;
info->index_records= 0;
- info->out_rows= param->table->file->records;
+ info->out_rows= (double) param->table->file->records;
bitmap_clear_all(&info->covered_fields);
return info;
}
@@ -3159,8 +3159,8 @@ TRP_ROR_INTERSECT *get_best_ror_intersect(const PARAM *param, SEL_TREE *tree,
ROR_SCAN_INFO's.
Step 2: Get best ROR-intersection using an approximate algorithm.
*/
- qsort(tree->ror_scans, tree->n_ror_scans, sizeof(ROR_SCAN_INFO*),
- (qsort_cmp)cmp_ror_scan_info);
+ my_qsort(tree->ror_scans, tree->n_ror_scans, sizeof(ROR_SCAN_INFO*),
+ (qsort_cmp)cmp_ror_scan_info);
DBUG_EXECUTE("info",print_ror_scans_arr(param->table, "ordered",
tree->ror_scans,
tree->ror_scans_end););
@@ -3349,8 +3349,8 @@ TRP_ROR_INTERSECT *get_best_covering_ror_intersect(PARAM *param,
bitmap_get_first(&(*scan)->covered_fields);
}
- qsort(ror_scan_mark, ror_scans_end-ror_scan_mark, sizeof(ROR_SCAN_INFO*),
- (qsort_cmp)cmp_ror_scan_info_covering);
+ my_qsort(ror_scan_mark, ror_scans_end-ror_scan_mark, sizeof(ROR_SCAN_INFO*),
+ (qsort_cmp)cmp_ror_scan_info_covering);
DBUG_EXECUTE("info", print_ror_scans_arr(param->table,
"remaining scans",
@@ -6757,7 +6757,7 @@ int QUICK_RANGE_SELECT::reset()
if (file->table_flags() & HA_NEED_READ_RANGE_BUFFER)
{
mrange_bufsiz= min(multi_range_bufsiz,
- (QUICK_SELECT_I::records + 1)* head->s->reclength);
+ ((uint)QUICK_SELECT_I::records + 1)* head->s->reclength);
while (mrange_bufsiz &&
! my_multi_malloc(MYF(MY_WME),
@@ -8359,7 +8359,7 @@ void cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts,
bool have_min, bool have_max,
double *read_cost, ha_rows *records)
{
- uint table_records;
+ ha_rows table_records;
uint num_groups;
uint num_blocks;
uint keys_per_block;
@@ -8376,14 +8376,14 @@ void cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts,
keys_per_block= (table->file->block_size / 2 /
(index_info->key_length + table->file->ref_length)
+ 1);
- num_blocks= (table_records / keys_per_block) + 1;
+ num_blocks= (uint)(table_records / keys_per_block) + 1;
/* Compute the number of keys in a group. */
keys_per_group= index_info->rec_per_key[group_key_parts - 1];
if (keys_per_group == 0) /* If there is no statistics try to guess */
/* each group contains 10% of all records */
- keys_per_group= (table_records / 10) + 1;
- num_groups= (table_records / keys_per_group) + 1;
+ keys_per_group= (uint)(table_records / 10) + 1;
+ num_groups= (uint)(table_records / keys_per_group) + 1;
/* Apply the selectivity of the quick select for group prefixes. */
if (range_tree && (quick_prefix_records != HA_POS_ERROR))
@@ -8427,9 +8427,9 @@ void cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts,
*records= num_groups;
DBUG_PRINT("info",
- ("table rows: %u keys/block: %u keys/group: %u result rows: %lu blocks: %u",
- table_records, keys_per_block, keys_per_group, (ulong) *records,
- num_blocks));
+ ("table rows: %lu keys/block: %u keys/group: %u result rows: %lu blocks: %u",
+ (ulong)table_records, keys_per_block, keys_per_group,
+ (ulong) *records, num_blocks));
DBUG_VOID_RETURN;
}
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index b9de54dbf5c..3fc62d05ae5 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -249,20 +249,20 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
Check if case 1 from above holds. If it does, we should read
the skipped tuple.
*/
- if (ref.key_buff[prefix_len] == 1 &&
- /*
+ if (item_field->field->real_maybe_null() &&
+ ref.key_buff[prefix_len] == 1 &&
+ /*
Last keypart (i.e. the argument to MIN) is set to NULL by
find_key_for_maxmin only if all other keyparts are bound
to constants in a conjunction of equalities. Hence, we
can detect this by checking only if the last keypart is
NULL.
- */
+ */
(error == HA_ERR_KEY_NOT_FOUND ||
key_cmp_if_same(table, ref.key_buff, ref.key, prefix_len)))
{
- DBUG_ASSERT(item_field->field->real_maybe_null());
error= table->file->index_read(table->record[0], ref.key_buff,
- ref.key_length,
+ ref.key_length,
HA_READ_KEY_EXACT);
}
}
diff --git a/sql/protocol.cc b/sql/protocol.cc
index ced6d78519a..2bdbe83eea1 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -824,6 +824,7 @@ bool Protocol_simple::store(const char *from, uint length,
field_types[field_pos] == MYSQL_TYPE_DECIMAL ||
field_types[field_pos] == MYSQL_TYPE_BIT ||
field_types[field_pos] == MYSQL_TYPE_NEWDECIMAL ||
+ field_types[field_pos] == MYSQL_TYPE_NEWDATE ||
(field_types[field_pos] >= MYSQL_TYPE_ENUM &&
field_types[field_pos] <= MYSQL_TYPE_GEOMETRY));
field_pos++;
diff --git a/sql/records.cc b/sql/records.cc
index 3a833c87b7b..f61efc13034 100644
--- a/sql/records.cc
+++ b/sql/records.cc
@@ -497,7 +497,8 @@ static int rr_from_cache(READ_RECORD *info)
int3store(ref_position,(long) i);
ref_position+=3;
}
- qsort(info->read_positions,length,info->struct_length,(qsort_cmp) rr_cmp);
+ my_qsort(info->read_positions, length, info->struct_length,
+ (qsort_cmp) rr_cmp);
position=info->read_positions;
for (i=0 ; i < length ; i++)
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 1c91fb9cbca..df78fc58f09 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -201,6 +201,7 @@ sys_var_key_cache_long sys_key_cache_age_threshold("key_cache_age_threshold",
param_age_threshold));
sys_var_bool_ptr sys_local_infile("local_infile",
&opt_local_infile);
+sys_var_bool_const_ptr sys_log("log", &opt_log);
sys_var_trust_routine_creators
sys_trust_routine_creators("log_bin_trust_routine_creators",
&trust_function_creators);
@@ -213,6 +214,7 @@ sys_var_bool_ptr
sys_var_thd_ulong sys_log_warnings("log_warnings", &SV::log_warnings);
sys_var_thd_ulong sys_long_query_time("long_query_time",
&SV::long_query_time);
+sys_var_bool_const_ptr sys_log_slow("log_slow_queries", &opt_slow_log);
sys_var_thd_bool sys_low_priority_updates("low_priority_updates",
&SV::low_priority_updates,
fix_low_priority_updates);
@@ -671,9 +673,11 @@ sys_var *sys_variables[]=
&sys_lc_time_names,
&sys_license,
&sys_local_infile,
+ &sys_log,
&sys_log_binlog,
&sys_log_off,
&sys_log_queries_not_using_indexes,
+ &sys_log_slow,
&sys_log_update,
&sys_log_warnings,
&sys_long_query_time,
@@ -794,7 +798,6 @@ sys_var *sys_variables[]=
&sys_innodb_max_purge_lag,
&sys_innodb_table_locks,
&sys_innodb_support_xa,
- &sys_innodb_max_purge_lag,
&sys_innodb_autoextend_increment,
&sys_innodb_sync_spin_loops,
&sys_innodb_concurrency_tickets,
@@ -911,6 +914,7 @@ struct show_var_st init_vars[]= {
{sys_innodb_concurrency_tickets.name, (char*) &sys_innodb_concurrency_tickets, SHOW_SYS},
{"innodb_data_file_path", (char*) &innobase_data_file_path, SHOW_CHAR_PTR},
{"innodb_data_home_dir", (char*) &innobase_data_home_dir, SHOW_CHAR_PTR},
+ {"innodb_adaptive_hash_index", (char*) &innobase_adaptive_hash_index, SHOW_MY_BOOL},
{"innodb_doublewrite", (char*) &innobase_use_doublewrite, SHOW_MY_BOOL},
{sys_innodb_fast_shutdown.name,(char*) &sys_innodb_fast_shutdown, SHOW_SYS},
{"innodb_file_io_threads", (char*) &innobase_file_io_threads, SHOW_LONG },
@@ -956,7 +960,7 @@ struct show_var_st init_vars[]= {
#ifdef HAVE_MLOCKALL
{"locked_in_memory", (char*) &locked_in_memory, SHOW_BOOL},
#endif
- {"log", (char*) &opt_log, SHOW_BOOL},
+ {sys_log.name, (char*) &sys_log, SHOW_SYS},
{"log_bin", (char*) &opt_bin_log, SHOW_BOOL},
{sys_trust_function_creators.name,(char*) &sys_trust_function_creators, SHOW_SYS},
{"log_error", (char*) log_error_file, SHOW_CHAR},
@@ -965,7 +969,7 @@ struct show_var_st init_vars[]= {
#ifdef HAVE_REPLICATION
{"log_slave_updates", (char*) &opt_log_slave_updates, SHOW_MY_BOOL},
#endif
- {"log_slow_queries", (char*) &opt_slow_log, SHOW_BOOL},
+ {sys_log_slow.name, (char*) &sys_log_slow, SHOW_SYS},
{sys_log_warnings.name, (char*) &sys_log_warnings, SHOW_SYS},
{sys_long_query_time.name, (char*) &sys_long_query_time, SHOW_SYS},
{sys_low_priority_updates.name, (char*) &sys_low_priority_updates, SHOW_SYS},
@@ -1054,6 +1058,9 @@ struct show_var_st init_vars[]= {
{sys_readonly.name, (char*) &sys_readonly, SHOW_SYS},
{sys_read_rnd_buff_size.name,(char*) &sys_read_rnd_buff_size, SHOW_SYS},
#ifdef HAVE_REPLICATION
+ {"relay_log" , (char*) &opt_relay_logname, SHOW_CHAR_PTR},
+ {"relay_log_index", (char*) &opt_relaylog_index_name, SHOW_CHAR_PTR},
+ {"relay_log_info_file", (char*) &relay_log_info_file, SHOW_CHAR_PTR},
{sys_relay_log_purge.name, (char*) &sys_relay_log_purge, SHOW_SYS},
{"relay_log_space_limit", (char*) &relay_log_space_limit, SHOW_LONGLONG},
#endif
@@ -1546,16 +1553,31 @@ bool sys_var_thd_ulong::check(THD *thd, set_var *var)
bool sys_var_thd_ulong::update(THD *thd, set_var *var)
{
ulonglong tmp= var->save_result.ulonglong_value;
+ char buf[22];
+ bool truncated= false;
/* Don't use bigger value than given with --maximum-variable-name=.. */
if ((ulong) tmp > max_system_variables.*offset)
+ {
+ truncated= true;
+ llstr(tmp, buf);
tmp= max_system_variables.*offset;
+ }
#if SIZEOF_LONG == 4
/* Avoid overflows on 32 bit systems */
if (tmp > (ulonglong) ~(ulong) 0)
+ {
+ truncated= true;
+ llstr(tmp, buf);
tmp= ((ulonglong) ~(ulong) 0);
+ }
#endif
+ if (truncated)
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_TRUNCATED_WRONG_VALUE,
+ ER(ER_TRUNCATED_WRONG_VALUE), name,
+ buf);
if (option_limits)
tmp= (ulong) getopt_ull_limit_value(tmp, option_limits);
@@ -1763,7 +1785,7 @@ bool sys_var::check_set(THD *thd, set_var *var, TYPELIB *enum_names)
&not_used));
if (error_len)
{
- strmake(buff, error, min(sizeof(buff), error_len));
+ strmake(buff, error, min(sizeof(buff) - 1, error_len));
goto err;
}
}
@@ -2221,6 +2243,21 @@ sys_var_character_set_filesystem::set_default(THD *thd, enum_var_type type)
}
+bool sys_var_character_set_client::check(THD *thd, set_var *var)
+{
+ if (sys_var_character_set::check(thd, var))
+ return 1;
+ /* Currently, UCS-2 cannot be used as a client character set */
+ if (var->save_result.charset->mbminlen > 1)
+ {
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name,
+ var->save_result.charset->csname);
+ return 1;
+ }
+ return 0;
+}
+
+
CHARSET_INFO **
sys_var_character_set_results::ci_ptr(THD *thd, enum_var_type type)
{
@@ -2560,6 +2597,13 @@ end:
int set_var_collation_client::check(THD *thd)
{
+ /* Currently, UCS-2 cannot be used as a client character set */
+ if (character_set_client->mbminlen > 1)
+ {
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), "character_set_client",
+ character_set_client->csname);
+ return 1;
+ }
return 0;
}
diff --git a/sql/set_var.h b/sql/set_var.h
index 6000e155db9..99db38933c2 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -160,6 +160,28 @@ public:
};
+class sys_var_bool_const_ptr : public sys_var
+{
+public:
+ my_bool *value;
+ sys_var_bool_const_ptr(const char *name_arg, my_bool *value_arg)
+ :sys_var(name_arg),value(value_arg)
+ {}
+ bool check(THD *thd, set_var *var)
+ {
+ return 1;
+ }
+ bool update(THD *thd, set_var *var)
+ {
+ return 1;
+ }
+ SHOW_TYPE show_type() { return SHOW_MY_BOOL; }
+ byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
+ { return (byte*) value; }
+ bool check_update_type(Item_result type) { return 0; }
+ bool is_readonly() const { return 1; }
+};
+
class sys_var_str :public sys_var
{
public:
@@ -613,6 +635,7 @@ public:
sys_var_character_set(name_arg) {}
void set_default(THD *thd, enum_var_type type);
CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type);
+ bool check(THD *thd, set_var *var);
};
class sys_var_character_set_results :public sys_var_character_set
diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt
index 709cd1fc0a9..9e6cf462113 100644
--- a/sql/share/errmsg.txt
+++ b/sql/share/errmsg.txt
@@ -5639,3 +5639,5 @@ ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT
eng "Too high level of nesting for select"
ER_NAME_BECOMES_EMPTY
eng "Name '%-.64s' has become ''"
+ER_AMBIGUOUS_FIELD_TERM
+ eng "First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BY"
diff --git a/sql/slave.cc b/sql/slave.cc
index 53d44816666..d90779cec02 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -3279,7 +3279,43 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli)
now the relay log starts with its Format_desc, has a Rotate etc).
*/
- DBUG_PRINT("info",("type_code=%d, server_id=%d",type_code,ev->server_id));
+ DBUG_PRINT("info",("type_code: %d; server_id: %d; slave_skip_counter: %d",
+ type_code, ev->server_id, rli->slave_skip_counter));
+
+ /*
+ If the slave skip counter is positive, we still need to set the
+ OPTION_BEGIN flag correctly and not skip the log events that
+ start or end a transaction. If we do this, the slave will not
+ notice that it is inside a transaction, and happily start
+ executing from inside the transaction.
+
+ Note that the code block below is strictly 5.0.
+ */
+#if MYSQL_VERSION_ID < 50100
+ if (unlikely(rli->slave_skip_counter > 0))
+ {
+ switch (type_code)
+ {
+ case QUERY_EVENT:
+ {
+ Query_log_event* const qev= (Query_log_event*) ev;
+ DBUG_PRINT("info", ("QUERY_EVENT { query: '%s', q_len: %u }",
+ qev->query, qev->q_len));
+ if (memcmp("BEGIN", qev->query, qev->q_len+1) == 0)
+ thd->options|= OPTION_BEGIN;
+ else if (memcmp("COMMIT", qev->query, qev->q_len+1) == 0 ||
+ memcmp("ROLLBACK", qev->query, qev->q_len+1) == 0)
+ thd->options&= ~OPTION_BEGIN;
+ }
+ break;
+
+ case XID_EVENT:
+ DBUG_PRINT("info", ("XID_EVENT"));
+ thd->options&= ~OPTION_BEGIN;
+ break;
+ }
+ }
+#endif
if ((ev->server_id == (uint32) ::server_id &&
!replicate_same_server_id &&
@@ -3301,6 +3337,9 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli)
flush_relay_log_info(rli);
}
+ DBUG_PRINT("info", ("thd->options: %s",
+ (thd->options & OPTION_BEGIN) ? "OPTION_BEGIN" : ""))
+
/*
Protect against common user error of setting the counter to 1
instead of 2 while recovering from an insert which used auto_increment,
@@ -3311,6 +3350,15 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli)
type_code == RAND_EVENT ||
type_code == USER_VAR_EVENT) &&
rli->slave_skip_counter == 1) &&
+#if MYSQL_VERSION_ID < 50100
+ /*
+ Decrease the slave skip counter only if we are not inside
+ a transaction or the slave skip counter is more than
+ 1. The slave skip counter will be decreased from 1 to 0
+ when reaching the final ROLLBACK, COMMIT, or XID_EVENT.
+ */
+ (!(thd->options & OPTION_BEGIN) || rli->slave_skip_counter > 1) &&
+#endif
/*
The events from ourselves which have something to do with the relay
log itself must be skipped, true, but they mustn't decrement
@@ -3321,8 +3369,10 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli)
would not be skipped.
*/
!(ev->server_id == (uint32) ::server_id &&
- (type_code == ROTATE_EVENT || type_code == STOP_EVENT ||
- type_code == START_EVENT_V3 || type_code == FORMAT_DESCRIPTION_EVENT)))
+ (type_code == ROTATE_EVENT ||
+ type_code == STOP_EVENT ||
+ type_code == START_EVENT_V3 ||
+ type_code == FORMAT_DESCRIPTION_EVENT)))
--rli->slave_skip_counter;
pthread_mutex_unlock(&rli->data_lock);
delete ev;
@@ -3530,7 +3580,7 @@ connected:
on with life.
*/
thd_proc_info(thd, "Registering slave on master");
- if (register_slave_on_master(mysql) || update_slave_list(mysql, mi))
+ if (register_slave_on_master(mysql))
goto err;
}
@@ -4931,7 +4981,16 @@ Log_event* next_event(RELAY_LOG_INFO* rli)
a new event and is queuing it; the false "0" will exist until SQL
finishes executing the new event; it will be look abnormal only if
the events have old timestamps (then you get "many", 0, "many").
- Transient phases like this can't really be fixed.
+
+ Transient phases like this can be fixed with implemeting
+ Heartbeat event which provides the slave the status of the
+ master at time the master does not have any new update to send.
+ Seconds_Behind_Master would be zero only when master has no
+ more updates in binlog for slave. The heartbeat can be sent
+ in a (small) fraction of slave_net_timeout. Until it's done
+ rli->last_master_timestamp is temporarely (for time of
+ waiting for the following event) reset whenever EOF is
+ reached.
*/
time_t save_timestamp= rli->last_master_timestamp;
rli->last_master_timestamp= 0;
diff --git a/sql/sp.cc b/sql/sp.cc
index 75d6fa4618f..0b84e1ad07f 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -1405,12 +1405,12 @@ static bool add_used_routine(LEX *lex, Query_arena *arena,
{
Sroutine_hash_entry *rn=
(Sroutine_hash_entry *)arena->alloc(sizeof(Sroutine_hash_entry) +
- key->length);
+ key->length + 1);
if (!rn) // OOM. Error will be reported using fatal_error().
return FALSE;
rn->key.length= key->length;
rn->key.str= (char *)rn + sizeof(Sroutine_hash_entry);
- memcpy(rn->key.str, key->str, key->length);
+ memcpy(rn->key.str, key->str, key->length + 1);
my_hash_insert(&lex->sroutines, (byte *)rn);
lex->sroutines_list.link_in_list((byte *)rn, (byte **)&rn->next);
rn->belong_to_view= belong_to_view;
@@ -1595,7 +1595,7 @@ sp_cache_routines_and_add_tables_aux(THD *thd, LEX *lex,
for (Sroutine_hash_entry *rt= start; rt; rt= rt->next)
{
- sp_name name(rt->key.str, rt->key.length);
+ sp_name name(thd, rt->key.str, rt->key.length);
int type= rt->key.str[0];
sp_head *sp;
@@ -1603,13 +1603,6 @@ sp_cache_routines_and_add_tables_aux(THD *thd, LEX *lex,
&thd->sp_func_cache : &thd->sp_proc_cache),
&name)))
{
- name.m_name.str= strchr(name.m_qname.str, '.');
- name.m_db.length= name.m_name.str - name.m_qname.str;
- name.m_db.str= strmake_root(thd->mem_root, name.m_qname.str,
- name.m_db.length);
- name.m_name.str+= 1;
- name.m_name.length= name.m_qname.length - name.m_db.length - 1;
-
switch ((ret= db_find_routine(thd, type, &name, &sp)))
{
case SP_OK:
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 2c02b07206f..2b98e08fd73 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -100,8 +100,9 @@ sp_get_item_value(THD *thd, Item *item, String *str)
case REAL_RESULT:
case INT_RESULT:
case DECIMAL_RESULT:
- return item->val_str(str);
-
+ if (item->field_type() != MYSQL_TYPE_BIT)
+ return item->val_str(str);
+ else {/* Bit type is handled as binary string */}
case STRING_RESULT:
{
String *result= item->val_str(str);
@@ -369,17 +370,42 @@ sp_eval_expr(THD *thd, Field *result_field, Item **expr_item_ptr)
*
*/
+sp_name::sp_name(THD *thd, char *key, uint key_len)
+{
+ m_sroutines_key.str= key;
+ m_sroutines_key.length= key_len;
+ m_qname.str= ++key;
+ m_qname.length= key_len - 1;
+ if ((m_name.str= strchr(m_qname.str, '.')))
+ {
+ m_db.length= m_name.str - key;
+ m_db.str= strmake_root(thd->mem_root, key, m_db.length);
+ m_name.str++;
+ m_name.length= m_qname.length - m_db.length - 1;
+ }
+ else
+ {
+ m_name.str= m_qname.str;
+ m_name.length= m_qname.length;
+ m_db.str= 0;
+ m_db.length= 0;
+ }
+ m_explicit_name= false;
+}
+
void
sp_name::init_qname(THD *thd)
{
- m_sroutines_key.length= m_db.length + m_name.length + 2;
+ const uint dot= !!m_db.length;
+ /* m_sroutines format: m_type + [database + dot] + name + nul */
+ m_sroutines_key.length= 1 + m_db.length + dot + m_name.length;
if (!(m_sroutines_key.str= thd->alloc(m_sroutines_key.length + 1)))
return;
m_qname.length= m_sroutines_key.length - 1;
m_qname.str= m_sroutines_key.str + 1;
- sprintf(m_qname.str, "%.*s.%.*s",
+ sprintf(m_qname.str, "%.*s%.*s%.*s",
m_db.length, (m_db.length ? m_db.str : ""),
- m_name.length, m_name.str);
+ dot, ".", m_name.length, m_name.str);
}
@@ -411,14 +437,16 @@ check_routine_name(LEX_STRING ident)
*/
void *
-sp_head::operator new(size_t size)
+sp_head::operator new(size_t size) throw()
{
DBUG_ENTER("sp_head::operator new");
MEM_ROOT own_root;
sp_head *sp;
- init_alloc_root(&own_root, MEM_ROOT_BLOCK_SIZE, MEM_ROOT_PREALLOC);
+ init_sql_alloc(&own_root, MEM_ROOT_BLOCK_SIZE, MEM_ROOT_PREALLOC);
sp= (sp_head *) alloc_root(&own_root, size);
+ if (sp == NULL)
+ return NULL;
sp->main_mem_root= own_root;
DBUG_PRINT("info", ("mem_root 0x%lx", (ulong) &sp->mem_root));
DBUG_RETURN(sp);
@@ -429,6 +457,10 @@ sp_head::operator delete(void *ptr, size_t size)
{
DBUG_ENTER("sp_head::operator delete");
MEM_ROOT own_root;
+
+ if (ptr == NULL)
+ DBUG_VOID_RETURN;
+
sp_head *sp= (sp_head *) ptr;
/* Make a copy of main_mem_root as free_root will free the sp */
@@ -472,6 +504,9 @@ sp_head::init(LEX *lex)
lex->spcont= m_pcont= new sp_pcontext();
+ if (!lex->spcont)
+ DBUG_VOID_RETURN;
+
/*
Altough trg_table_fields list is used only in triggers we init for all
types of stored procedures to simplify reset_lex()/restore_lex() code.
@@ -973,7 +1008,7 @@ sp_head::execute(THD *thd)
DBUG_RETURN(TRUE);
/* init per-instruction memroot */
- init_alloc_root(&execute_mem_root, MEM_ROOT_BLOCK_SIZE, 0);
+ init_sql_alloc(&execute_mem_root, MEM_ROOT_BLOCK_SIZE, 0);
DBUG_ASSERT(!(m_flags & IS_INVOKED));
m_flags|= IS_INVOKED;
@@ -1820,16 +1855,29 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
}
-// Reset lex during parsing, before we parse a sub statement.
-void
+/**
+ @brief Reset lex during parsing, before we parse a sub statement.
+
+ @param thd Thread handler.
+
+ @return Error state
+ @retval true An error occurred.
+ @retval false Success.
+*/
+
+bool
sp_head::reset_lex(THD *thd)
{
DBUG_ENTER("sp_head::reset_lex");
LEX *sublex;
LEX *oldlex= thd->lex;
+ sublex= new (thd->mem_root)st_lex_local;
+ if (sublex == 0)
+ DBUG_RETURN(TRUE);
+
+ thd->lex= sublex;
(void)m_lex.push_front(oldlex);
- thd->lex= sublex= new st_lex;
/* Reset most stuff. */
lex_start(thd);
@@ -1852,7 +1900,7 @@ sp_head::reset_lex(THD *thd)
sublex->interval_list.empty();
sublex->type= 0;
- DBUG_VOID_RETURN;
+ DBUG_RETURN(FALSE);
}
// Restore lex during parsing, after we have parsed a sub statement.
@@ -3732,7 +3780,7 @@ sp_add_to_query_tables(THD *thd, LEX *lex,
if (!(table= (TABLE_LIST *)thd->calloc(sizeof(TABLE_LIST))))
{
- my_error(ER_OUTOFMEMORY, MYF(0), sizeof(TABLE_LIST));
+ thd->fatal_error();
return NULL;
}
table->db_length= strlen(db);
diff --git a/sql/sp_head.h b/sql/sp_head.h
index ebe40ce9c87..a46ec9433d7 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -72,16 +72,7 @@ public:
Creates temporary sp_name object from key, used mainly
for SP-cache lookups.
*/
- sp_name(char *key, uint key_len)
- {
- m_sroutines_key.str= key;
- m_sroutines_key.length= key_len;
- m_name.str= m_qname.str= key + 1;
- m_name.length= m_qname.length= key_len - 1;
- m_db.str= 0;
- m_db.length= 0;
- m_explicit_name= false;
- }
+ sp_name(THD *thd, char *key, uint key_len);
// Init. the qualified name from the db and name.
void init_qname(THD *thd); // thd for memroot allocation
@@ -191,10 +182,10 @@ public:
Security_context m_security_ctx;
static void *
- operator new(size_t size);
+ operator new(size_t size) throw ();
static void
- operator delete(void *ptr, size_t size);
+ operator delete(void *ptr, size_t size) throw ();
sp_head();
@@ -254,7 +245,7 @@ public:
}
// Resets lex in 'thd' and keeps a copy of the old one.
- void
+ bool
reset_lex(THD *thd);
// Restores lex in 'thd' from our copy, but keeps some status from the
diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc
index ac7c46c9fe5..54e016f6099 100644
--- a/sql/sp_rcontext.cc
+++ b/sql/sp_rcontext.cc
@@ -503,14 +503,14 @@ sp_cursor::fetch(THD *thd, List<struct sp_variable> *vars)
*/
Item_cache *
-sp_rcontext::create_case_expr_holder(THD *thd, Item_result result_type)
+sp_rcontext::create_case_expr_holder(THD *thd, const Item *item)
{
Item_cache *holder;
Query_arena current_arena;
thd->set_n_backup_active_arena(thd->spcont->callers_arena, &current_arena);
- holder= Item_cache::get_cache(result_type);
+ holder= Item_cache::get_cache(item);
thd->restore_active_arena(thd->spcont->callers_arena, &current_arena);
@@ -559,7 +559,7 @@ sp_rcontext::set_case_expr(THD *thd, int case_expr_id, Item **case_expr_item_ptr
case_expr_item->result_type())
{
m_case_expr_holders[case_expr_id]=
- create_case_expr_holder(thd, case_expr_item->result_type());
+ create_case_expr_holder(thd, case_expr_item);
}
m_case_expr_holders[case_expr_id]->store(case_expr_item);
diff --git a/sql/sp_rcontext.h b/sql/sp_rcontext.h
index 0104b71a648..43102cfeeb2 100644
--- a/sql/sp_rcontext.h
+++ b/sql/sp_rcontext.h
@@ -261,7 +261,7 @@ private:
bool init_var_table(THD *thd);
bool init_var_items();
- Item_cache *create_case_expr_holder(THD *thd, Item_result result_type);
+ Item_cache *create_case_expr_holder(THD *thd, const Item *item);
int set_variable(THD *thd, Field *field, Item **value);
}; // class sp_rcontext : public Sql_alloc
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index f9bd2c6ba0d..134541368e9 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -248,8 +248,8 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
#endif
VOID(push_dynamic(&acl_hosts,(gptr) &host));
}
- qsort((gptr) dynamic_element(&acl_hosts,0,ACL_HOST*),acl_hosts.elements,
- sizeof(ACL_HOST),(qsort_cmp) acl_compare);
+ my_qsort((gptr) dynamic_element(&acl_hosts,0,ACL_HOST*),acl_hosts.elements,
+ sizeof(ACL_HOST),(qsort_cmp) acl_compare);
end_read_record(&read_record_info);
freeze_size(&acl_hosts);
@@ -311,7 +311,7 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
continue;
}
- const char *password= get_field(&mem, table->field[2]);
+ const char *password= get_field(thd->mem_root, table->field[2]);
uint password_len= password ? strlen(password) : 0;
set_user_salt(&user, password, password_len);
if (user.salt_len == 0 && password_len != 0)
@@ -364,7 +364,7 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
/* Starting from 4.0.2 we have more fields */
if (table->s->fields >= 31)
{
- char *ssl_type=get_field(&mem, table->field[next_field++]);
+ char *ssl_type=get_field(thd->mem_root, table->field[next_field++]);
if (!ssl_type)
user.ssl_type=SSL_TYPE_NONE;
else if (!strcmp(ssl_type, "ANY"))
@@ -378,11 +378,11 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
user.x509_issuer= get_field(&mem, table->field[next_field++]);
user.x509_subject= get_field(&mem, table->field[next_field++]);
- char *ptr = get_field(&mem, table->field[next_field++]);
+ char *ptr = get_field(thd->mem_root, table->field[next_field++]);
user.user_resource.questions=ptr ? atoi(ptr) : 0;
- ptr = get_field(&mem, table->field[next_field++]);
+ ptr = get_field(thd->mem_root, table->field[next_field++]);
user.user_resource.updates=ptr ? atoi(ptr) : 0;
- ptr = get_field(&mem, table->field[next_field++]);
+ ptr = get_field(thd->mem_root, table->field[next_field++]);
user.user_resource.conn_per_hour= ptr ? atoi(ptr) : 0;
if (user.user_resource.questions || user.user_resource.updates ||
user.user_resource.conn_per_hour)
@@ -391,7 +391,7 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
if (table->s->fields >= 36)
{
/* Starting from 5.0.3 we have max_user_connections field */
- ptr= get_field(&mem, table->field[next_field++]);
+ ptr= get_field(thd->mem_root, table->field[next_field++]);
user.user_resource.user_conn= ptr ? atoi(ptr) : 0;
}
else
@@ -421,8 +421,8 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
allow_all_hosts=1; // Anyone can connect
}
}
- qsort((gptr) dynamic_element(&acl_users,0,ACL_USER*),acl_users.elements,
- sizeof(ACL_USER),(qsort_cmp) acl_compare);
+ my_qsort((gptr) dynamic_element(&acl_users,0,ACL_USER*),acl_users.elements,
+ sizeof(ACL_USER),(qsort_cmp) acl_compare);
end_read_record(&read_record_info);
freeze_size(&acl_users);
@@ -479,8 +479,8 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
#endif
VOID(push_dynamic(&acl_dbs,(gptr) &db));
}
- qsort((gptr) dynamic_element(&acl_dbs,0,ACL_DB*),acl_dbs.elements,
- sizeof(ACL_DB),(qsort_cmp) acl_compare);
+ my_qsort((gptr) dynamic_element(&acl_dbs,0,ACL_DB*),acl_dbs.elements,
+ sizeof(ACL_DB),(qsort_cmp) acl_compare);
end_read_record(&read_record_info);
freeze_size(&acl_dbs);
init_check_host();
@@ -1110,8 +1110,8 @@ static void acl_insert_user(const char *user, const char *host,
if (!acl_user.host.hostname ||
(acl_user.host.hostname[0] == wild_many && !acl_user.host.hostname[1]))
allow_all_hosts=1; // Anyone can connect /* purecov: tested */
- qsort((gptr) dynamic_element(&acl_users,0,ACL_USER*),acl_users.elements,
- sizeof(ACL_USER),(qsort_cmp) acl_compare);
+ my_qsort((gptr) dynamic_element(&acl_users,0,ACL_USER*),acl_users.elements,
+ sizeof(ACL_USER),(qsort_cmp) acl_compare);
/* Rebuild 'acl_check_hosts' since 'acl_users' has been modified */
rebuild_check_host();
@@ -1132,7 +1132,7 @@ static void acl_update_db(const char *user, const char *host, const char *db,
{
if (!acl_db->host.hostname && !host[0] ||
acl_db->host.hostname &&
- !my_strcasecmp(system_charset_info, host, acl_db->host.hostname))
+ !strcmp(host, acl_db->host.hostname))
{
if (!acl_db->db && !db[0] ||
acl_db->db && !strcmp(db,acl_db->db))
@@ -1173,8 +1173,8 @@ static void acl_insert_db(const char *user, const char *host, const char *db,
acl_db.access=privileges;
acl_db.sort=get_sort(3,acl_db.host.hostname,acl_db.db,acl_db.user);
VOID(push_dynamic(&acl_dbs,(gptr) &acl_db));
- qsort((gptr) dynamic_element(&acl_dbs,0,ACL_DB*),acl_dbs.elements,
- sizeof(ACL_DB),(qsort_cmp) acl_compare);
+ my_qsort((gptr) dynamic_element(&acl_dbs,0,ACL_DB*),acl_dbs.elements,
+ sizeof(ACL_DB),(qsort_cmp) acl_compare);
}
@@ -3835,50 +3835,83 @@ bool check_column_grant_in_table_ref(THD *thd, TABLE_LIST * table_ref,
}
-bool check_grant_all_columns(THD *thd, ulong want_access, GRANT_INFO *grant,
- const char* db_name, const char *table_name,
- Field_iterator *fields)
+/**
+ @brief check if a query can access a set of columns
+
+ @param thd the current thread
+ @param want_access_arg the privileges requested
+ @param fields an iterator over the fields of a table reference.
+ @return Operation status
+ @retval 0 Success
+ @retval 1 Falure
+ @details This function walks over the columns of a table reference
+ The columns may originate from different tables, depending on the kind of
+ table reference, e.g. join.
+ For each table it will retrieve the grant information and will use it
+ to check the required access privileges for the fields requested from it.
+*/
+bool check_grant_all_columns(THD *thd, ulong want_access_arg,
+ Field_iterator_table_ref *fields)
{
Security_context *sctx= thd->security_ctx;
- GRANT_TABLE *grant_table;
- GRANT_COLUMN *grant_column;
+ ulong want_access= want_access_arg;
+ const char *table_name= NULL;
- want_access &= ~grant->privilege;
- if (!want_access)
- return 0; // Already checked
- if (!grant_option)
- goto err2;
+ if (grant_option)
+ {
+ const char* db_name;
+ GRANT_INFO *grant;
+ /* Initialized only to make gcc happy */
+ GRANT_TABLE *grant_table= NULL;
- rw_rdlock(&LOCK_grant);
+ rw_rdlock(&LOCK_grant);
- /* reload table if someone has modified any grants */
+ for (; !fields->end_of_fields(); fields->next())
+ {
+ const char *field_name= fields->name();
- if (grant->version != grant_version)
- {
- grant->grant_table=
- table_hash_search(sctx->host, sctx->ip, db_name,
- sctx->priv_user,
- table_name, 0); /* purecov: inspected */
- grant->version= grant_version; /* purecov: inspected */
- }
- /* The following should always be true */
- if (!(grant_table= grant->grant_table))
- goto err; /* purecov: inspected */
+ if (table_name != fields->table_name())
+ {
+ table_name= fields->table_name();
+ db_name= fields->db_name();
+ grant= fields->grant();
+ /* get a fresh one for each table */
+ want_access= want_access_arg & ~grant->privilege;
+ if (want_access)
+ {
+ /* reload table if someone has modified any grants */
+ if (grant->version != grant_version)
+ {
+ grant->grant_table=
+ table_hash_search(sctx->host, sctx->ip, db_name,
+ sctx->priv_user,
+ table_name, 0); /* purecov: inspected */
+ grant->version= grant_version; /* purecov: inspected */
+ }
- for (; !fields->end_of_fields(); fields->next())
- {
- const char *field_name= fields->name();
- grant_column= column_hash_search(grant_table, field_name,
- (uint) strlen(field_name));
- if (!grant_column || (~grant_column->rights & want_access))
- goto err;
- }
- rw_unlock(&LOCK_grant);
- return 0;
+ grant_table= grant->grant_table;
+ DBUG_ASSERT (grant_table);
+ }
+ }
+
+ if (want_access)
+ {
+ GRANT_COLUMN *grant_column=
+ column_hash_search(grant_table, field_name,
+ (uint) strlen(field_name));
+ if (!grant_column || (~grant_column->rights & want_access))
+ goto err;
+ }
+ }
+ rw_unlock(&LOCK_grant);
+ return 0;
err:
- rw_unlock(&LOCK_grant);
-err2:
+ rw_unlock(&LOCK_grant);
+ }
+ else
+ table_name= fields->table_name();
+
char command[128];
get_privilege_desc(command, sizeof(command), want_access);
my_error(ER_COLUMNACCESS_DENIED_ERROR, MYF(0),
@@ -4344,6 +4377,13 @@ bool mysql_show_grants(THD *thd,LEX_USER *lex_user)
if (!(host=acl_db->host.hostname))
host= "";
+ /*
+ We do not make SHOW GRANTS case-sensitive here (like REVOKE),
+ but make it case-insensitive because that's the way they are
+ actually applied, and showing fewer privileges than are applied
+ would be wrong from a security point of view.
+ */
+
if (!strcmp(lex_user->user.str,user) &&
!my_strcasecmp(system_charset_info, lex_user->host.str, host))
{
@@ -4379,8 +4419,8 @@ bool mysql_show_grants(THD *thd,LEX_USER *lex_user)
db.append(lex_user->user.str, lex_user->user.length,
system_charset_info);
db.append (STRING_WITH_LEN("'@'"));
- db.append(lex_user->host.str, lex_user->host.length,
- system_charset_info);
+ // host and lex_user->host are equal except for case
+ db.append(host, strlen(host), system_charset_info);
db.append ('\'');
if (want_access & GRANT_ACL)
db.append(STRING_WITH_LEN(" WITH GRANT OPTION"));
@@ -4407,6 +4447,13 @@ bool mysql_show_grants(THD *thd,LEX_USER *lex_user)
if (!(host= grant_table->host.hostname))
host= "";
+ /*
+ We do not make SHOW GRANTS case-sensitive here (like REVOKE),
+ but make it case-insensitive because that's the way they are
+ actually applied, and showing fewer privileges than are applied
+ would be wrong from a security point of view.
+ */
+
if (!strcmp(lex_user->user.str,user) &&
!my_strcasecmp(system_charset_info, lex_user->host.str, host))
{
@@ -4487,8 +4534,8 @@ bool mysql_show_grants(THD *thd,LEX_USER *lex_user)
global.append(lex_user->user.str, lex_user->user.length,
system_charset_info);
global.append(STRING_WITH_LEN("'@'"));
- global.append(lex_user->host.str,lex_user->host.length,
- system_charset_info);
+ // host and lex_user->host are equal except for case
+ global.append(host, strlen(host), system_charset_info);
global.append('\'');
if (table_access & GRANT_ACL)
global.append(STRING_WITH_LEN(" WITH GRANT OPTION"));
@@ -4543,6 +4590,13 @@ static int show_routine_grants(THD* thd, LEX_USER *lex_user, HASH *hash,
if (!(host= grant_proc->host.hostname))
host= "";
+ /*
+ We do not make SHOW GRANTS case-sensitive here (like REVOKE),
+ but make it case-insensitive because that's the way they are
+ actually applied, and showing fewer privileges than are applied
+ would be wrong from a security point of view.
+ */
+
if (!strcmp(lex_user->user.str,user) &&
!my_strcasecmp(system_charset_info, lex_user->host.str, host))
{
@@ -4586,8 +4640,8 @@ static int show_routine_grants(THD* thd, LEX_USER *lex_user, HASH *hash,
global.append(lex_user->user.str, lex_user->user.length,
system_charset_info);
global.append(STRING_WITH_LEN("'@'"));
- global.append(lex_user->host.str,lex_user->host.length,
- system_charset_info);
+ // host and lex_user->host are equal except for case
+ global.append(host, strlen(host), system_charset_info);
global.append('\'');
if (proc_access & GRANT_ACL)
global.append(STRING_WITH_LEN(" WITH GRANT OPTION"));
@@ -4844,6 +4898,7 @@ static int handle_grant_table(TABLE_LIST *tables, uint table_no, bool drop,
byte user_key[MAX_KEY_LENGTH];
uint key_prefix_length;
DBUG_ENTER("handle_grant_table");
+ THD *thd= current_thd;
if (! table_no) // mysql.user table
{
@@ -4911,17 +4966,18 @@ static int handle_grant_table(TABLE_LIST *tables, uint table_no, bool drop,
DBUG_PRINT("info",("scan error: %d", error));
continue;
}
- if (! (host= get_field(&mem, host_field)))
+ if (! (host= get_field(thd->mem_root, host_field)))
host= "";
- if (! (user= get_field(&mem, user_field)))
+ if (! (user= get_field(thd->mem_root, user_field)))
user= "";
#ifdef EXTRA_DEBUG
DBUG_PRINT("loop",("scan fields: '%s'@'%s' '%s' '%s' '%s'",
user, host,
- get_field(&mem, table->field[1]) /*db*/,
- get_field(&mem, table->field[3]) /*table*/,
- get_field(&mem, table->field[4]) /*column*/));
+ get_field(thd->mem_root, table->field[1]) /*db*/,
+ get_field(thd->mem_root, table->field[3]) /*table*/,
+ get_field(thd->mem_root,
+ table->field[4]) /*column*/));
#endif
if (strcmp(user_str, user) ||
my_strcasecmp(system_charset_info, host_str, host))
@@ -5541,7 +5597,7 @@ bool mysql_revoke_all(THD *thd, List <LEX_USER> &list)
host= "";
if (!strcmp(lex_user->user.str,user) &&
- !my_strcasecmp(system_charset_info, lex_user->host.str, host))
+ !strcmp(lex_user->host.str, host))
{
if (!replace_db_table(tables[1].table, acl_db->db, *lex_user, ~(ulong)0, 1))
{
@@ -5572,7 +5628,7 @@ bool mysql_revoke_all(THD *thd, List <LEX_USER> &list)
host= "";
if (!strcmp(lex_user->user.str,user) &&
- !my_strcasecmp(system_charset_info, lex_user->host.str, host))
+ !strcmp(lex_user->host.str, host))
{
if (replace_table_table(thd,grant_table,tables[2].table,*lex_user,
grant_table->db,
@@ -5618,7 +5674,7 @@ bool mysql_revoke_all(THD *thd, List <LEX_USER> &list)
host= "";
if (!strcmp(lex_user->user.str,user) &&
- !my_strcasecmp(system_charset_info, lex_user->host.str, host))
+ !strcmp(lex_user->host.str, host))
{
if (!replace_routine_table(thd,grant_proc,tables[4].table,*lex_user,
grant_proc->db,
diff --git a/sql/sql_acl.h b/sql/sql_acl.h
index d08f2663af5..b2007ccdf47 100644
--- a/sql/sql_acl.h
+++ b/sql/sql_acl.h
@@ -205,9 +205,8 @@ bool check_grant_column (THD *thd, GRANT_INFO *grant,
const char *name, uint length, Security_context *sctx);
bool check_column_grant_in_table_ref(THD *thd, TABLE_LIST * table_ref,
const char *name, uint length);
-bool check_grant_all_columns(THD *thd, ulong want_access, GRANT_INFO *grant,
- const char* db_name, const char *table_name,
- Field_iterator *fields);
+bool check_grant_all_columns(THD *thd, ulong want_access,
+ Field_iterator_table_ref *fields);
bool check_grant_routine(THD *thd, ulong want_access,
TABLE_LIST *procs, bool is_proc, bool no_error);
bool check_grant_db(THD *thd,const char *db);
diff --git a/sql/sql_array.h b/sql/sql_array.h
index e2e12bee241..dcef457dce7 100644
--- a/sql/sql_array.h
+++ b/sql/sql_array.h
@@ -62,7 +62,7 @@ public:
void sort(CMP_FUNC cmp_func)
{
- qsort(array.buffer, array.elements, sizeof(Elem), (qsort_cmp)cmp_func);
+ my_qsort(array.buffer, array.elements, sizeof(Elem), (qsort_cmp)cmp_func);
}
};
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index b6042f9b1e1..e68e651bacf 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -80,7 +80,6 @@ bool Prelock_error_handler::safely_trapped_errors()
return ((m_handled_errors > 0) && (m_unhandled_errors == 0));
}
-
TABLE *unused_tables; /* Used by mysql_test */
HASH open_cache; /* Used by mysql_test */
@@ -1745,7 +1744,13 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
DBUG_RETURN(0);
}
- /* close handler tables which are marked for flush */
+ /*
+ In order for the back off and re-start process to work properly,
+ handler tables having old versions (due to FLUSH TABLES or pending
+ name-lock) MUST be closed. This is specially important if a name-lock
+ is pending for any table of the handler_tables list, otherwise a
+ deadlock may occur.
+ */
if (thd->handler_tables)
mysql_ha_flush(thd, (TABLE_LIST*) NULL, MYSQL_HA_REOPEN_ON_USAGE, TRUE);
@@ -1810,6 +1815,10 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
table->db_stat == 0 signals wait_for_locked_table_names
that the tables in question are not used any more. See
table_is_used call for details.
+
+ Notice that HANDLER tables were already taken care of by
+ the earlier call to mysql_ha_flush() in this same critical
+ section.
*/
close_old_data_files(thd,thd->open_tables,0,0);
/*
@@ -2643,7 +2652,7 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
temporary mem_root for new .frm parsing.
TODO: variables for size
*/
- init_alloc_root(&new_frm_mem, 8024, 8024);
+ init_sql_alloc(&new_frm_mem, 8024, 8024);
thd->current_tablenr= 0;
restart:
@@ -3958,7 +3967,9 @@ find_field_in_tables(THD *thd, Item_ident *item,
{
Field *cur_field= find_field_in_table_ref(thd, cur_table, name, length,
item->name, db, table_name, ref,
- check_privileges,
+ (thd->lex->sql_command ==
+ SQLCOM_SHOW_FIELDS)
+ ? false : check_privileges,
allow_rowid,
&(item->cached_field_index),
register_tree_change,
@@ -4152,7 +4163,8 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
if (item_field->field_name && item_field->table_name &&
!my_strcasecmp(system_charset_info, item_field->field_name,
field_name) &&
- !strcmp(item_field->table_name, table_name) &&
+ !my_strcasecmp(table_alias_charset, item_field->table_name,
+ table_name) &&
(!db_name || (item_field->db_name &&
!strcmp(item_field->db_name, db_name))))
{
@@ -5414,10 +5426,7 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name,
!any_privileges)
{
field_iterator.set(tables);
- if (check_grant_all_columns(thd, SELECT_ACL, field_iterator.grant(),
- field_iterator.db_name(),
- field_iterator.table_name(),
- &field_iterator))
+ if (check_grant_all_columns(thd, SELECT_ACL, &field_iterator))
DBUG_RETURN(TRUE);
}
#endif
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index a8725923624..4ceb4270945 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1211,6 +1211,7 @@ int
select_export::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
{
bool blob_flag=0;
+ bool string_results= FALSE, non_string_results= FALSE;
unit= u;
if ((uint) strlen(exchange->file_name) + NAME_LEN >= FN_REFLEN)
strmake(path,exchange->file_name,FN_REFLEN-1);
@@ -1228,13 +1229,18 @@ select_export::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
blob_flag=1;
break;
}
+ if (item->result_type() == STRING_RESULT)
+ string_results= TRUE;
+ else
+ non_string_results= TRUE;
}
}
field_term_length=exchange->field_term->length();
+ field_term_char= field_term_length ? (*exchange->field_term)[0] : INT_MAX;
if (!exchange->line_term->length())
exchange->line_term=exchange->field_term; // Use this if it exists
field_sep_char= (exchange->enclosed->length() ? (*exchange->enclosed)[0] :
- field_term_length ? (*exchange->field_term)[0] : INT_MAX);
+ field_term_char);
escape_char= (exchange->escaped->length() ? (*exchange->escaped)[0] : -1);
is_ambiguous_field_sep= test(strchr(ESCAPE_CHARS, field_sep_char));
is_unsafe_field_sep= test(strchr(NUMERIC_CHARS, field_sep_char));
@@ -1246,12 +1252,25 @@ select_export::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
exchange->opt_enclosed=1; // A little quicker loop
fixed_row_size= (!field_term_length && !exchange->enclosed->length() &&
!blob_flag);
+ if ((is_ambiguous_field_sep && exchange->enclosed->is_empty() &&
+ (string_results || is_unsafe_field_sep)) ||
+ (exchange->opt_enclosed && non_string_results &&
+ field_term_length && strchr(NUMERIC_CHARS, field_term_char)))
+ {
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_AMBIGUOUS_FIELD_TERM, ER(ER_AMBIGUOUS_FIELD_TERM));
+ is_ambiguous_field_term= TRUE;
+ }
+ else
+ is_ambiguous_field_term= FALSE;
+
return 0;
}
#define NEED_ESCAPING(x) ((int) (uchar) (x) == escape_char || \
- (int) (uchar) (x) == field_sep_char || \
+ (enclosed ? (int) (uchar) (x) == field_sep_char \
+ : (int) (uchar) (x) == field_term_char) || \
(int) (uchar) (x) == line_sep_char || \
!(x))
@@ -1280,8 +1299,10 @@ bool select_export::send_data(List<Item> &items)
while ((item=li++))
{
Item_result result_type=item->result_type();
+ bool enclosed = (exchange->enclosed->length() &&
+ (!exchange->opt_enclosed || result_type == STRING_RESULT));
res=item->str_result(&tmp);
- if (res && (!exchange->opt_enclosed || result_type == STRING_RESULT))
+ if (res && enclosed)
{
if (my_b_write(&cache,(byte*) exchange->enclosed->ptr(),
exchange->enclosed->length()))
@@ -1372,11 +1393,16 @@ bool select_export::send_data(List<Item> &items)
DBUG_ASSERT before the loop makes that sure.
*/
- if (NEED_ESCAPING(*pos) ||
- (check_second_byte &&
- my_mbcharlen(character_set_client, (uchar) *pos) == 2 &&
- pos + 1 < end &&
- NEED_ESCAPING(pos[1])))
+ if ((NEED_ESCAPING(*pos) ||
+ (check_second_byte &&
+ my_mbcharlen(character_set_client, (uchar) *pos) == 2 &&
+ pos + 1 < end &&
+ NEED_ESCAPING(pos[1]))) &&
+ /*
+ Don't escape field_term_char by doubling - doubling is only
+ valid for ENCLOSED BY characters:
+ */
+ (enclosed || !is_ambiguous_field_term || *pos != field_term_char))
{
char tmp_buff[2];
tmp_buff[0]= ((int) *pos == field_sep_char &&
@@ -1415,7 +1441,7 @@ bool select_export::send_data(List<Item> &items)
goto err;
}
}
- if (res && (!exchange->opt_enclosed || result_type == STRING_RESULT))
+ if (res && enclosed)
{
if (my_b_write(&cache, (byte*) exchange->enclosed->ptr(),
exchange->enclosed->length()))
@@ -1544,7 +1570,7 @@ bool select_max_min_finder_subselect::send_data(List<Item> &items)
{
if (!cache)
{
- cache= Item_cache::get_cache(val_item->result_type());
+ cache= Item_cache::get_cache(val_item);
switch (val_item->result_type())
{
case REAL_RESULT:
@@ -2258,8 +2284,11 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup)
void mark_transaction_to_rollback(THD *thd, bool all)
{
- thd->is_fatal_sub_stmt_error= TRUE;
- thd->transaction_rollback_request= all;
+ if (thd)
+ {
+ thd->is_fatal_sub_stmt_error= TRUE;
+ thd->transaction_rollback_request= all;
+ }
}
/***************************************************************************
Handling of XA id cacheing
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 2aeae0d7748..56dca05854e 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -159,7 +159,13 @@ typedef struct st_log_info
my_off_t pos;
bool fatal; // if the purge happens to give us a negative offset
pthread_mutex_t lock;
- st_log_info():fatal(0) { pthread_mutex_init(&lock, MY_MUTEX_INIT_FAST);}
+ st_log_info()
+ : index_file_offset(0), index_file_start_offset(0),
+ pos(0), fatal(0)
+ {
+ log_file_name[0] = '\0';
+ pthread_mutex_init(&lock, MY_MUTEX_INIT_FAST);
+ }
~st_log_info() { pthread_mutex_destroy(&lock);}
} LOG_INFO;
@@ -1372,9 +1378,20 @@ public:
ulonglong limit_found_rows;
ulonglong options; /* Bitmap of states */
- longlong row_count_func; /* For the ROW_COUNT() function */
- ha_rows cuted_fields,
- sent_row_count, examined_row_count;
+ longlong row_count_func; /* For the ROW_COUNT() function */
+ ha_rows cuted_fields;
+
+ /*
+ number of rows we actually sent to the client, including "synthetic"
+ rows in ROLLUP etc.
+ */
+ ha_rows sent_row_count;
+
+ /*
+ number of rows we read, sent or not, including in create_sort_index()
+ */
+ ha_rows examined_row_count;
+
/*
The set of those tables whose fields are referenced in all subqueries
of the query.
@@ -1411,7 +1428,11 @@ public:
/* Statement id is thread-wide. This counter is used to generate ids */
ulong statement_id_counter;
ulong rand_saved_seed1, rand_saved_seed2;
- ulong row_count; // Row counter, mainly for errors and warnings
+ /*
+ Row counter, mainly for errors and warnings. Not increased in
+ create_sort_index(); may differ from examined_row_count.
+ */
+ ulong row_count;
long dbug_thread_id;
pthread_t real_id;
uint tmp_table, global_read_lock;
@@ -2000,6 +2021,7 @@ public:
class select_export :public select_to_file {
uint field_term_length;
int field_sep_char,escape_char,line_sep_char;
+ int field_term_char; // first char of FIELDS TERMINATED BY or MAX_INT
/*
The is_ambiguous_field_sep field is true if a value of the field_sep_char
field is one of the 'n', 't', 'r' etc characters
@@ -2007,6 +2029,12 @@ class select_export :public select_to_file {
*/
bool is_ambiguous_field_sep;
/*
+ The is_ambiguous_field_term is true if field_sep_char contains the first
+ char of the FIELDS TERMINATED BY (ENCLOSED BY is empty), and items can
+ contain this character.
+ */
+ bool is_ambiguous_field_term;
+ /*
The is_unsafe_field_sep field is true if a value of the field_sep_char
field is one of the '0'..'9', '+', '-', '.' and 'e' characters
(see the NUMERIC_CHARS constant value).
@@ -2037,7 +2065,7 @@ class select_insert :public select_result_interceptor {
ulonglong last_insert_id;
COPY_INFO info;
bool insert_into_view;
-
+ bool is_bulk_insert_mode;
select_insert(TABLE_LIST *table_list_par,
TABLE *table_par, List<Item> *fields_par,
List<Item> *update_fields, List<Item> *update_values,
@@ -2358,6 +2386,11 @@ class multi_delete :public select_result_interceptor
/* True if at least one table we delete from is not transactional */
bool normal_tables;
bool delete_while_scanning;
+ /*
+ error handling (rollback and binlogging) can happen in send_eof()
+ so that afterward send_error() needs to find out that.
+ */
+ bool error_handled;
public:
multi_delete(TABLE_LIST *dt, uint num_of_tables);
@@ -2393,6 +2426,11 @@ class multi_update :public select_result_interceptor
/* True if the update operation has made a change in a transactional table */
bool transactional_tables;
bool ignore;
+ /*
+ error handling (rollback and binlogging) can happen in send_eof()
+ so that afterward send_error() needs to find out that.
+ */
+ bool error_handled;
public:
multi_update(TABLE_LIST *ut, TABLE_LIST *leaves_list,
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 163a274f139..1b7d26b6a00 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -38,6 +38,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
ha_rows deleted;
uint usable_index= MAX_KEY;
SELECT_LEX *select_lex= &thd->lex->select_lex;
+ THD::killed_state killed_status= THD::NOT_KILLED;
DBUG_ENTER("mysql_delete");
if (open_and_lock_tables(thd, table_list))
@@ -280,8 +281,8 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
else
table->file->unlock_row(); // Row failed selection, release lock on it
}
- if (thd->killed && !error)
- error= 1; // Aborted
+ killed_status= thd->killed;
+ error= (killed_status == THD::NOT_KILLED)? error : 1;
thd_proc_info(thd, "end");
end_read_record(&info);
free_io_cache(table); // Will not do any harm
@@ -319,14 +320,14 @@ cleanup:
thd->transaction.stmt.modified_non_trans_table= TRUE;
/* See similar binlogging code in sql_update.cc, for comments */
- if ((error < 0) || (deleted && !transactional_table))
+ if ((error < 0) || thd->transaction.stmt.modified_non_trans_table)
{
if (mysql_bin_log.is_open())
{
if (error < 0)
thd->clear_error();
Query_log_event qinfo(thd, thd->query, thd->query_length,
- transactional_table, FALSE);
+ transactional_table, FALSE, killed_status);
if (mysql_bin_log.write(&qinfo) && transactional_table)
error=1;
}
@@ -504,7 +505,7 @@ bool mysql_multi_delete_prepare(THD *thd)
multi_delete::multi_delete(TABLE_LIST *dt, uint num_of_tables_arg)
: delete_tables(dt), deleted(0), found(0),
num_of_tables(num_of_tables_arg), error(0),
- do_delete(0), transactional_tables(0), normal_tables(0)
+ do_delete(0), transactional_tables(0), normal_tables(0), error_handled(0)
{
tempfiles= (Unique **) sql_calloc(sizeof(Unique *) * num_of_tables);
}
@@ -685,12 +686,14 @@ void multi_delete::send_error(uint errcode,const char *err)
/* First send error what ever it is ... */
my_message(errcode, err, MYF(0));
- /* If nothing deleted return */
- if (!deleted)
+ /* the error was handled or nothing deleted and no side effects return */
+ if (error_handled ||
+ !thd->transaction.stmt.modified_non_trans_table && !deleted)
DBUG_VOID_RETURN;
/* Something already deleted so we have to invalidate cache */
- query_cache_invalidate3(thd, delete_tables, 1);
+ if (deleted)
+ query_cache_invalidate3(thd, delete_tables, 1);
/*
If rows from the first table only has been deleted and it is
@@ -710,12 +713,30 @@ void multi_delete::send_error(uint errcode,const char *err)
*/
error= 1;
send_eof();
+ DBUG_ASSERT(error_handled);
+ DBUG_VOID_RETURN;
}
- DBUG_ASSERT(!normal_tables || !deleted || thd->transaction.stmt.modified_non_trans_table);
+
+ if (thd->transaction.stmt.modified_non_trans_table)
+ {
+ /*
+ there is only side effects; to binlog with the error
+ */
+ if (mysql_bin_log.is_open())
+ {
+ Query_log_event qinfo(thd, thd->query, thd->query_length,
+ transactional_tables, FALSE);
+ mysql_bin_log.write(&qinfo);
+ }
+ thd->transaction.all.modified_non_trans_table= true;
+ }
+ DBUG_ASSERT(!normal_tables || !deleted ||
+ thd->transaction.stmt.modified_non_trans_table);
DBUG_VOID_RETURN;
}
+
/*
Do delete from other tables.
Returns values:
@@ -798,6 +819,7 @@ int multi_delete::do_deletes()
bool multi_delete::send_eof()
{
+ THD::killed_state killed_status= THD::NOT_KILLED;
thd_proc_info(thd, "deleting from reference tables");
/* Does deletes for the last n - 1 tables, returns 0 if ok */
@@ -805,7 +827,7 @@ bool multi_delete::send_eof()
/* compute a total error to know if something failed */
local_error= local_error || error;
-
+ killed_status= (local_error == 0)? THD::NOT_KILLED : thd->killed;
/* reset used flags */
thd_proc_info(thd, "end");
@@ -817,21 +839,24 @@ bool multi_delete::send_eof()
{
query_cache_invalidate3(thd, delete_tables, 1);
}
- if ((local_error == 0) || (deleted && normal_tables))
+ DBUG_ASSERT(!normal_tables || !deleted ||
+ thd->transaction.stmt.modified_non_trans_table);
+ if ((local_error == 0) || thd->transaction.stmt.modified_non_trans_table)
{
if (mysql_bin_log.is_open())
{
if (local_error == 0)
thd->clear_error();
Query_log_event qinfo(thd, thd->query, thd->query_length,
- transactional_tables, FALSE);
+ transactional_tables, FALSE, killed_status);
if (mysql_bin_log.write(&qinfo) && !normal_tables)
local_error=1; // Log write failed: roll back the SQL statement
}
if (thd->transaction.stmt.modified_non_trans_table)
thd->transaction.all.modified_non_trans_table= TRUE;
}
- DBUG_ASSERT(!normal_tables || !deleted || thd->transaction.stmt.modified_non_trans_table);
+ if (local_error != 0)
+ error_handled= TRUE; // to force early leave from ::send_error()
/* Commit or rollback the current SQL statement */
if (transactional_tables)
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 9aefa71647e..822f2b2c419 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -65,11 +65,6 @@
static enum enum_ha_read_modes rkey_to_rnext[]=
{ RNEXT_SAME, RNEXT, RPREV, RNEXT, RPREV, RNEXT, RPREV, RPREV };
-#define HANDLER_TABLES_HACK(thd) { \
- TABLE *tmp=thd->open_tables; \
- thd->open_tables=thd->handler_tables; \
- thd->handler_tables=tmp; }
-
static int mysql_ha_flush_table(THD *thd, TABLE **table_ptr, uint mode_flags);
@@ -187,6 +182,7 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
char *db, *name, *alias;
uint dblen, namelen, aliaslen, counter;
int error;
+ TABLE *backup_open_tables;
DBUG_ENTER("mysql_ha_open");
DBUG_PRINT("enter",("'%s'.'%s' as '%s' reopen: %d",
tables->db, tables->table_name, tables->alias,
@@ -216,17 +212,39 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
}
/*
+ Save and reset the open_tables list so that open_tables() won't
+ be able to access (or know about) the previous list. And on return
+ from open_tables(), thd->open_tables will contain only the opened
+ table.
+
+ The thd->handler_tables list is kept as-is to avoid deadlocks if
+ open_table(), called by open_tables(), needs to back-off because
+ of a pending name-lock on the table being opened.
+
+ See open_table() back-off comments for more details.
+ */
+ backup_open_tables= thd->open_tables;
+ thd->open_tables= NULL;
+
+ /*
open_tables() will set 'tables->table' if successful.
It must be NULL for a real open when calling open_tables().
*/
DBUG_ASSERT(! tables->table);
- HANDLER_TABLES_HACK(thd);
/* for now HANDLER can be used only for real TABLES */
tables->required_type= FRMTYPE_TABLE;
error= open_tables(thd, &tables, &counter, 0);
- HANDLER_TABLES_HACK(thd);
+ /* restore the state and merge the opened table into handler_tables list */
+ if (thd->open_tables)
+ {
+ thd->open_tables->next= thd->handler_tables;
+ thd->handler_tables= thd->open_tables;
+ }
+
+ thd->open_tables= backup_open_tables;
+
if (error)
goto err;
@@ -351,7 +369,7 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables,
ha_rows select_limit_cnt, ha_rows offset_limit_cnt)
{
TABLE_LIST *hash_tables;
- TABLE *table;
+ TABLE *table, *backup_open_tables;
MYSQL_LOCK *lock;
List<Item> list;
Protocol *protocol= thd->protocol;
@@ -361,7 +379,7 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables,
uint num_rows;
byte *key;
uint key_len;
- bool not_used;
+ bool need_reopen;
DBUG_ENTER("mysql_ha_read");
DBUG_PRINT("enter",("'%s'.'%s' as '%s'",
tables->db, tables->table_name, tables->alias));
@@ -375,6 +393,7 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables,
List_iterator<Item> it(list);
it++;
+retry:
if ((hash_tables= (TABLE_LIST*) hash_search(&thd->handler_tables_hash,
(byte*) tables->alias,
strlen(tables->alias) + 1)))
@@ -427,9 +446,34 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables,
}
tables->table=table;
- HANDLER_TABLES_HACK(thd);
- lock= mysql_lock_tables(thd, &tables->table, 1, 0, &not_used);
- HANDLER_TABLES_HACK(thd);
+ /* save open_tables state */
+ backup_open_tables= thd->open_tables;
+ /*
+ mysql_lock_tables() needs thd->open_tables to be set correctly to
+ be able to handle aborts properly. When the abort happens, it's
+ safe to not protect thd->handler_tables because it won't close any
+ tables.
+ */
+ thd->open_tables= thd->handler_tables;
+
+ lock= mysql_lock_tables(thd, &tables->table, 1,
+ MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN, &need_reopen);
+
+ /* restore previous context */
+ thd->open_tables= backup_open_tables;
+
+ if (need_reopen)
+ {
+ mysql_ha_close_table(thd, tables);
+ hash_tables->table= NULL;
+ /*
+ The lock might have been aborted, we need to manually reset
+ thd->some_tables_deleted because handler's tables are closed
+ in a non-standard way. Otherwise we might loop indefinitely.
+ */
+ thd->some_tables_deleted= 0;
+ goto retry;
+ }
if (!lock)
goto err0; // mysql_lock_tables() printed error message already
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index ba7f1a534ea..69a257a9d37 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.cc
@@ -524,7 +524,7 @@ int send_variant_2_list(MEM_ROOT *mem_root, Protocol *protocol,
List_iterator<String> it(*names);
for (pos= pointers; pos!=end; (*pos++= it++));
- qsort(pointers,names->elements,sizeof(String*),string_ptr_cmp);
+ my_qsort(pointers,names->elements,sizeof(String*),string_ptr_cmp);
for (pos= pointers; pos!=end; pos++)
{
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index dee0052973c..e00995e923a 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -189,11 +189,9 @@ static int check_insert_fields(THD *thd, TABLE_LIST *table_list,
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (grant_option)
{
- Field_iterator_table field_it;
- field_it.set_table(table);
- if (check_grant_all_columns(thd, INSERT_ACL, &table->grant,
- table->s->db, table->s->table_name,
- &field_it))
+ Field_iterator_table_ref field_it;
+ field_it.set(table_list);
+ if (check_grant_all_columns(thd, INSERT_ACL, &field_it))
return -1;
}
#endif
@@ -866,8 +864,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
transactional_table= table->file->has_transactions();
- if ((changed= (info.copied || info.deleted || info.updated)) ||
- was_insert_delayed)
+ if ((changed= (info.copied || info.deleted || info.updated)))
{
/*
Invalidate the table in the query cache if something changed.
@@ -876,46 +873,47 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
*/
if (changed)
query_cache_invalidate3(thd, table_list, 1);
- if (error <= 0 || !transactional_table)
+ }
+ if (changed && error <= 0 || thd->transaction.stmt.modified_non_trans_table
+ || was_insert_delayed)
+ {
+ if (mysql_bin_log.is_open())
{
- if (mysql_bin_log.is_open())
+ if (error <= 0)
{
- if (error <= 0)
- {
- /*
- [Guilhem wrote] Temporary errors may have filled
- thd->net.last_error/errno. For example if there has
- been a disk full error when writing the row, and it was
- MyISAM, then thd->net.last_error/errno will be set to
- "disk full"... and the my_pwrite() will wait until free
- space appears, and so when it finishes then the
- write_row() was entirely successful
- */
- /* todo: consider removing */
- thd->clear_error();
- }
- /* bug#22725:
-
- A query which per-row-loop can not be interrupted with
- KILLED, like INSERT, and that does not invoke stored
- routines can be binlogged with neglecting the KILLED error.
-
- If there was no error (error == zero) until after the end of
- inserting loop the KILLED flag that appeared later can be
- disregarded since previously possible invocation of stored
- routines did not result in any error due to the KILLED. In
- such case the flag is ignored for constructing binlog event.
+ /*
+ [Guilhem wrote] Temporary errors may have filled
+ thd->net.last_error/errno. For example if there has
+ been a disk full error when writing the row, and it was
+ MyISAM, then thd->net.last_error/errno will be set to
+ "disk full"... and the my_pwrite() will wait until free
+ space appears, and so when it finishes then the
+ write_row() was entirely successful
*/
- Query_log_event qinfo(thd, thd->query, thd->query_length,
- transactional_table, FALSE,
- (error>0) ? thd->killed : THD::NOT_KILLED);
- DBUG_ASSERT(thd->killed != THD::KILL_BAD_DATA || error > 0);
- if (mysql_bin_log.write(&qinfo) && transactional_table)
- error=1;
+ /* todo: consider removing */
+ thd->clear_error();
}
- if (thd->transaction.stmt.modified_non_trans_table)
- thd->transaction.all.modified_non_trans_table= TRUE;
+ /* bug#22725:
+
+ A query which per-row-loop can not be interrupted with
+ KILLED, like INSERT, and that does not invoke stored
+ routines can be binlogged with neglecting the KILLED error.
+
+ If there was no error (error == zero) until after the end of
+ inserting loop the KILLED flag that appeared later can be
+ disregarded since previously possible invocation of stored
+ routines did not result in any error due to the KILLED. In
+ such case the flag is ignored for constructing binlog event.
+ */
+ Query_log_event qinfo(thd, thd->query, thd->query_length,
+ transactional_table, FALSE,
+ (error>0) ? thd->killed : THD::NOT_KILLED);
+ DBUG_ASSERT(thd->killed != THD::KILL_BAD_DATA || error > 0);
+ if (mysql_bin_log.write(&qinfo) && transactional_table)
+ error=1;
}
+ if (thd->transaction.stmt.modified_non_trans_table)
+ thd->transaction.all.modified_non_trans_table= TRUE;
}
DBUG_ASSERT(transactional_table || !changed ||
thd->transaction.stmt.modified_non_trans_table);
@@ -2647,7 +2645,8 @@ select_insert::select_insert(TABLE_LIST *table_list_par, TABLE *table_par,
bool ignore_check_option_errors)
:table_list(table_list_par), table(table_par), fields(fields_par),
last_insert_id(0),
- insert_into_view(table_list_par && table_list_par->view != 0)
+ insert_into_view(table_list_par && table_list_par->view != 0),
+ is_bulk_insert_mode(FALSE)
{
bzero((char*) &info,sizeof(info));
info.handle_duplicates= duplic;
@@ -2832,8 +2831,11 @@ int select_insert::prepare2(void)
{
DBUG_ENTER("select_insert::prepare2");
if (thd->lex->current_select->options & OPTION_BUFFER_RESULT &&
- !thd->prelocked_mode)
+ !thd->prelocked_mode && !is_bulk_insert_mode)
+ {
table->file->start_bulk_insert((ha_rows) 0);
+ is_bulk_insert_mode= TRUE;
+ }
DBUG_RETURN(0);
}
@@ -2936,9 +2938,11 @@ bool select_insert::send_eof()
{
int error, error2;
bool changed, transactional_table= table->file->has_transactions();
+ THD::killed_state killed_status= thd->killed;
DBUG_ENTER("select_insert::send_eof");
error= (!thd->prelocked_mode) ? table->file->end_bulk_insert():0;
+ is_bulk_insert_mode= FALSE;
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
@@ -2964,7 +2968,7 @@ bool select_insert::send_eof()
if (!error)
thd->clear_error();
Query_log_event qinfo(thd, thd->query, thd->query_length,
- transactional_table, FALSE);
+ transactional_table, FALSE, killed_status);
mysql_bin_log.write(&qinfo);
}
if ((error2=ha_autocommit_or_rollback(thd,error)) && ! error)
@@ -3001,6 +3005,7 @@ void select_insert::abort()
*/
DBUG_VOID_RETURN;
}
+ changed= (info.copied || info.deleted || info.updated);
transactional_table= table->file->has_transactions();
if (!thd->prelocked_mode)
table->file->end_bulk_insert();
@@ -3010,8 +3015,7 @@ void select_insert::abort()
error while inserting into a MyISAM table) we must write to the binlog (and
the error code will make the slave stop).
*/
- if ((changed= info.copied || info.deleted || info.updated) &&
- !transactional_table)
+ if (thd->transaction.stmt.modified_non_trans_table)
{
if (last_insert_id)
thd->insert_id(last_insert_id); // For binary log
@@ -3129,7 +3133,10 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
create_field *cr_field;
Field *field, *def_field;
if (item->type() == Item::FUNC_ITEM)
- field= item->tmp_table_field(&tmp_table);
+ if (item->result_type() != STRING_RESULT)
+ field= item->tmp_table_field(&tmp_table);
+ else
+ field= item->tmp_table_field_from_field_type(&tmp_table);
else
field= create_tmp_field(thd, &tmp_table, item, item->type(),
(Item ***) 0, &tmp_field, &def_field, 0, 0, 0, 0,
@@ -3271,7 +3278,10 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
if (info.handle_duplicates == DUP_UPDATE)
table->file->extra(HA_EXTRA_INSERT_WITH_UPDATE);
if (!thd->prelocked_mode)
+ {
table->file->start_bulk_insert((ha_rows) 0);
+ is_bulk_insert_mode= TRUE;
+ }
thd->abort_on_warning= (!info.ignore &&
(thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES |
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index fb806271e76..890c18121bd 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -1291,11 +1291,11 @@ typedef struct st_lex : public Query_tables_list
struct st_lex_local: public st_lex
{
- static void *operator new(size_t size)
+ static void *operator new(size_t size) throw()
{
return (void*) sql_alloc((uint) size);
}
- static void *operator new(size_t size, MEM_ROOT *mem_root)
+ static void *operator new(size_t size, MEM_ROOT *mem_root) throw()
{
return (void*) alloc_root(mem_root, (uint) size);
}
@@ -1311,3 +1311,4 @@ extern void lex_start(THD *thd);
extern void lex_end(LEX *lex);
extern int MYSQLlex(void *arg, void *yythd);
extern char *skip_rear_comments(CHARSET_INFO *cs, char *begin, char *end);
+
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 55cbbf1c540..d687ceff393 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -85,7 +85,8 @@ static int read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
#ifndef EMBEDDED_LIBRARY
static bool write_execute_load_query_log_event(THD *thd,
bool duplicates, bool ignore,
- bool transactional_table);
+ bool transactional_table,
+ THD::killed_state killed_status);
#endif /* EMBEDDED_LIBRARY */
/*
@@ -135,6 +136,7 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
char *tdb= thd->db ? thd->db : db; // Result is never null
ulong skip_lines= ex->skip_lines;
bool transactional_table;
+ THD::killed_state killed_status= THD::NOT_KILLED;
DBUG_ENTER("mysql_load");
#ifdef EMBEDDED_LIBRARY
@@ -404,7 +406,16 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
free_blobs(table); /* if pack_blob was used */
table->copy_blobs=0;
thd->count_cuted_fields= CHECK_FIELD_IGNORE;
-
+ /*
+ simulated killing in the middle of per-row loop
+ must be effective for binlogging
+ */
+ DBUG_EXECUTE_IF("simulate_kill_bug27571",
+ {
+ error=1;
+ thd->killed= THD::KILL_QUERY;
+ };);
+ killed_status= (error == 0)? THD::NOT_KILLED : thd->killed;
/*
We must invalidate the table in query cache before binlog writing and
ha_autocommit_...
@@ -444,9 +455,10 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
/* If the file was not empty, wrote_create_file is true */
if (lf_info.wrote_create_file)
{
- if ((info.copied || info.deleted) && !transactional_table)
+ if (thd->transaction.stmt.modified_non_trans_table)
write_execute_load_query_log_event(thd, handle_duplicates,
- ignore, transactional_table);
+ ignore, transactional_table,
+ killed_status);
else
{
Delete_file_log_event d(thd, db, transactional_table);
@@ -477,7 +489,8 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
read_info.end_io_cache();
if (lf_info.wrote_create_file)
write_execute_load_query_log_event(thd, handle_duplicates,
- ignore, transactional_table);
+ ignore, transactional_table,
+ killed_status);
}
#endif /*!EMBEDDED_LIBRARY*/
if (transactional_table)
@@ -504,7 +517,8 @@ err:
/* Not a very useful function; just to avoid duplication of code */
static bool write_execute_load_query_log_event(THD *thd,
bool duplicates, bool ignore,
- bool transactional_table)
+ bool transactional_table,
+ THD::killed_state killed_err_arg)
{
Execute_load_query_log_event
e(thd, thd->query, thd->query_length,
@@ -512,7 +526,7 @@ static bool write_execute_load_query_log_event(THD *thd,
(char*)thd->lex->fname_end - (char*)thd->query,
(duplicates == DUP_REPLACE) ? LOAD_DUP_REPLACE :
(ignore ? LOAD_DUP_IGNORE : LOAD_DUP_ERROR),
- transactional_table, FALSE);
+ transactional_table, FALSE, killed_err_arg);
return mysql_bin_log.write(&e);
}
diff --git a/sql/sql_map.cc b/sql/sql_map.cc
index 03dc091b9b7..282716c6151 100644
--- a/sql/sql_map.cc
+++ b/sql/sql_map.cc
@@ -41,7 +41,7 @@ mapped_files::mapped_files(const my_string filename,byte *magic,uint magic_lengt
struct stat stat_buf;
if (!fstat(file,&stat_buf))
{
- if (!(map=(byte*) my_mmap(0,(size=(ulong) stat_buf.st_size),PROT_READ,
+ if (!(map=(byte*) my_mmap(0,(size_t)(size=(ulong) stat_buf.st_size),PROT_READ,
MAP_SHARED | MAP_NORESERVE,file,
0L)))
{
@@ -52,7 +52,7 @@ mapped_files::mapped_files(const my_string filename,byte *magic,uint magic_lengt
if (map && memcmp(map,magic,magic_length))
{
my_error(ER_WRONG_MAGIC, MYF(0), name);
- VOID(my_munmap(map,size));
+ VOID(my_munmap(map,(size_t)size));
map=0;
}
if (!map)
@@ -70,7 +70,7 @@ mapped_files::~mapped_files()
#ifdef HAVE_MMAP
if (file >= 0)
{
- VOID(my_munmap(map,size));
+ VOID(my_munmap(map,(size_t)size));
VOID(my_close(file,MYF(0)));
file= -1; map=0;
}
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index e3166c07cbd..d52c8197ea7 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -93,6 +93,10 @@ const char *xa_state_names[]={
"NON-EXISTING", "ACTIVE", "IDLE", "PREPARED"
};
+#ifndef EMBEDDED_LIBRARY
+static bool do_command(THD *thd);
+#endif // EMBEDDED_LIBRARY
+
#ifdef __WIN__
static void test_signal(int sig_ptr)
{
@@ -1199,23 +1203,28 @@ pthread_handler_t handle_one_connection(void *arg)
}
if (thd->user_connect)
decrease_user_connections(thd->user_connect);
+
+ if (thd->killed ||
+ net->vio && net->error && net->report_error)
+ {
+ statistic_increment(aborted_threads, &LOCK_status);
+ }
+
if (net->error && net->vio != 0 && net->report_error)
{
if (!thd->killed && thd->variables.log_warnings > 1)
- sql_print_warning(ER(ER_NEW_ABORTING_CONNECTION),
+ {
+ sql_print_warning(ER(ER_NEW_ABORTING_CONNECTION),
thd->thread_id,(thd->db ? thd->db : "unconnected"),
sctx->user ? sctx->user : "unauthenticated",
sctx->host_or_ip,
(net->last_errno ? ER(net->last_errno) :
ER(ER_UNKNOWN_ERROR)));
+ }
+
net_send_error(thd, net->last_errno, NullS);
- statistic_increment(aborted_threads,&LOCK_status);
- }
- else if (thd->killed)
- {
- statistic_increment(aborted_threads,&LOCK_status);
}
-
+
end_thread:
close_connection(thd, 0, 1);
end_thread(thd,1);
@@ -1524,7 +1533,7 @@ int end_trans(THD *thd, enum enum_mysql_completiontype completion)
1 request of thread shutdown (see dispatch_command() description)
*/
-bool do_command(THD *thd)
+static bool do_command(THD *thd)
{
bool return_value;
char *packet= 0;
@@ -1560,13 +1569,13 @@ bool do_command(THD *thd)
DBUG_PRINT("info",("Got error %d reading command from socket %s",
net->error,
vio_description(net->vio)));
+
/* Check if we can continue without closing the connection */
+
if (net->error != 3)
- {
- statistic_increment(aborted_threads,&LOCK_status);
return_value= TRUE; // We have to close it.
goto out;
- }
+
net_send_error(thd, net->last_errno, NullS);
net->error= 0;
return_value= FALSE;
@@ -2895,7 +2904,16 @@ mysql_execute_command(THD *thd)
if (check_global_access(thd, SUPER_ACL | REPL_CLIENT_ACL))
goto error;
pthread_mutex_lock(&LOCK_active_mi);
- res = show_master_info(thd,active_mi);
+ if (active_mi != NULL)
+ {
+ res = show_master_info(thd, active_mi);
+ }
+ else
+ {
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
+ "the master info structure does not exist");
+ send_ok(thd);
+ }
pthread_mutex_unlock(&LOCK_active_mi);
break;
}
@@ -3743,6 +3761,13 @@ end_with_restore_list:
SELECT_NO_JOIN_CACHE | SELECT_NO_UNLOCK |
OPTION_SETUP_TABLES_DONE,
del_result, unit, select_lex);
+ res|= thd->net.report_error;
+ if (unlikely(res))
+ {
+ /* If we had a another error reported earlier then this will be ignored */
+ del_result->send_error(ER_UNKNOWN_ERROR, "Execution of the query failed");
+ del_result->abort();
+ }
delete del_result;
}
else
@@ -4058,12 +4083,6 @@ end_with_restore_list:
if (check_access(thd,INSERT_ACL,"mysql",0,1,0,0))
break;
#ifdef HAVE_DLOPEN
- if (sp_find_routine(thd, TYPE_ENUM_FUNCTION, lex->spname,
- &thd->sp_func_cache, FALSE))
- {
- my_error(ER_UDF_EXISTS, MYF(0), lex->spname->m_name.str);
- goto error;
- }
if (!(res = mysql_create_function(thd, &lex->udf)))
send_ok(thd);
#else
@@ -6480,7 +6499,12 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
ST_SCHEMA_TABLE *schema_table= find_schema_table(thd, ptr->table_name);
if (!schema_table ||
(schema_table->hidden &&
- lex->orig_sql_command == SQLCOM_END)) // not a 'show' command
+ (lex->orig_sql_command == SQLCOM_END || // not a 'show' command
+ /*
+ this check is used for show columns|keys from I_S hidden table
+ */
+ lex->orig_sql_command == SQLCOM_SHOW_FIELDS ||
+ lex->orig_sql_command == SQLCOM_SHOW_KEYS)))
{
my_error(ER_UNKNOWN_TABLE, MYF(0),
ptr->table_name, INFORMATION_SCHEMA_NAME.str);
@@ -7099,7 +7123,7 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
for (; lock_p < end_p; lock_p++)
{
- if ((*lock_p)->type == TL_WRITE)
+ if ((*lock_p)->type >= TL_WRITE_ALLOW_WRITE)
{
my_error(ER_LOCK_OR_ACTIVE_TRANSACTION, MYF(0));
return 1;
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 5635d87de0c..d06b3386e5a 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -2662,7 +2662,7 @@ Prepared_statement::Prepared_statement(THD *thd_arg, Protocol *protocol_arg)
last_errno(0),
flags((uint) IS_IN_USE)
{
- init_alloc_root(&main_mem_root, thd_arg->variables.query_alloc_block_size,
+ init_sql_alloc(&main_mem_root, thd_arg->variables.query_alloc_block_size,
thd_arg->variables.query_prealloc_size);
*last_error= '\0';
}
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 1fcc9e49548..6c0df1a9427 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -364,7 +364,6 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
name=0; // Find first log
linfo.index_file_offset = 0;
- thd->current_linfo = &linfo;
if (mysql_bin_log.find_log_pos(&linfo, name, 1))
{
@@ -373,6 +372,10 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
goto err;
}
+ pthread_mutex_lock(&LOCK_thread_count);
+ thd->current_linfo = &linfo;
+ pthread_mutex_unlock(&LOCK_thread_count);
+
if ((file=open_binlog(&log, log_file_name, &errmsg)) < 0)
{
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
@@ -1338,7 +1341,6 @@ bool mysql_show_binlog_events(THD* thd)
name=0; // Find first log
linfo.index_file_offset = 0;
- thd->current_linfo = &linfo;
if (mysql_bin_log.find_log_pos(&linfo, name, 1))
{
@@ -1346,6 +1348,10 @@ bool mysql_show_binlog_events(THD* thd)
goto err;
}
+ pthread_mutex_lock(&LOCK_thread_count);
+ thd->current_linfo = &linfo;
+ pthread_mutex_unlock(&LOCK_thread_count);
+
if ((file=open_binlog(&log, linfo.log_file_name, &errmsg)) < 0)
goto err;
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 2f01c144aa6..3c33bbf5d7c 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -565,11 +565,12 @@ JOIN::prepare(Item ***rref_pointer_array,
/*
- Check if one one uses a not constant column with group functions
- and no GROUP BY.
+ Check if there are references to un-aggregated columns when computing
+ aggregate functions with implicit grouping (there is no GROUP BY).
TODO: Add check of calculation of GROUP functions and fields:
SELECT COUNT(*)+table.col1 from table1;
*/
+ if (thd->variables.sql_mode & MODE_ONLY_FULL_GROUP_BY)
{
if (!group_list)
{
@@ -583,6 +584,13 @@ JOIN::prepare(Item ***rref_pointer_array,
else if (!(flag & 2) && !item->const_during_execution())
flag|=2;
}
+ if (having)
+ {
+ if (having->with_sum_func)
+ flag |= 1;
+ else if (!having->const_during_execution())
+ flag |= 2;
+ }
if (flag == 3)
{
my_message(ER_MIX_OF_GROUP_FUNC_AND_FIELDS,
@@ -1065,10 +1073,19 @@ JOIN::optimize()
We have found that grouping can be removed since groups correspond to
only one row anyway, but we still have to guarantee correct result
order. The line below effectively rewrites the query from GROUP BY
- <fields> to ORDER BY <fields>. One exception is if skip_sort_order is
- set (see above), then we can simply skip GROUP BY.
+ <fields> to ORDER BY <fields>. There are two exceptions:
+ - if skip_sort_order is set (see above), then we can simply skip
+ GROUP BY;
+ - we can only rewrite ORDER BY if the ORDER BY fields are 'compatible'
+ with the GROUP BY ones, i.e. either one is a prefix of another.
+ We only check if the ORDER BY is a prefix of GROUP BY. In this case
+ test_if_subpart() copies the ASC/DESC attributes from the original
+ ORDER BY fields.
+ If GROUP BY is a prefix of ORDER BY, then it is safe to leave
+ 'order' as is.
*/
- order= skip_sort_order ? 0 : group_list;
+ if (!order || test_if_subpart(group_list, order))
+ order= skip_sort_order ? 0 : group_list;
group_list= 0;
group= 0;
}
@@ -3677,7 +3694,7 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
{
KEYUSE key_end,*prev,*save_pos,*use;
- qsort(keyuse->buffer,keyuse->elements,sizeof(KEYUSE),
+ my_qsort(keyuse->buffer,keyuse->elements,sizeof(KEYUSE),
(qsort_cmp) sort_keyuse);
bzero((char*) &key_end,sizeof(key_end)); /* Add for easy testing */
@@ -4390,8 +4407,9 @@ choose_plan(JOIN *join, table_map join_tables)
Apply heuristic: pre-sort all access plans with respect to the number of
records accessed.
*/
- qsort(join->best_ref + join->const_tables, join->tables - join->const_tables,
- sizeof(JOIN_TAB*), straight_join?join_tab_cmp_straight:join_tab_cmp);
+ my_qsort(join->best_ref + join->const_tables,
+ join->tables - join->const_tables, sizeof(JOIN_TAB*),
+ straight_join ? join_tab_cmp_straight : join_tab_cmp);
if (straight_join)
{
@@ -4440,6 +4458,17 @@ choose_plan(JOIN *join, table_map join_tables)
ptr1 pointer to first JOIN_TAB object
ptr2 pointer to second JOIN_TAB object
+ NOTES
+ The order relation implemented by join_tab_cmp() is not transitive,
+ i.e. it is possible to choose such a, b and c that (a < b) && (b < c)
+ but (c < a). This implies that result of a sort using the relation
+ implemented by join_tab_cmp() depends on the order in which
+ elements are compared, i.e. the result is implementation-specific.
+ Example:
+ a: dependent = 0x0 table->map = 0x1 found_records = 3 ptr = 0x907e6b0
+ b: dependent = 0x0 table->map = 0x2 found_records = 3 ptr = 0x907e838
+ c: dependent = 0x6 table->map = 0x10 found_records = 2 ptr = 0x907ecd0
+
RETURN
1 if first is bigger
-1 if second is bigger
@@ -5934,7 +5963,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
/* Fix for EXPLAIN */
if (sel->quick)
- join->best_positions[i].records_read= sel->quick->records;
+ join->best_positions[i].records_read= (double)sel->quick->records;
}
else
{
@@ -6090,10 +6119,9 @@ make_join_readinfo(JOIN *join, ulonglong options)
ordered. If there is a temp table the ordering is done as a last
operation and doesn't prevent join cache usage.
*/
- if (!ordered_set && !join->need_tmp &&
- ((table == join->sort_by_table &&
- (!join->order || join->skip_sort_order)) ||
- (join->sort_by_table == (TABLE *) 1 && i != join->const_tables)))
+ if (!ordered_set && !join->need_tmp &&
+ (table == join->sort_by_table ||
+ (join->sort_by_table == (TABLE *) 1 && i != join->const_tables)))
ordered_set= 1;
switch (tab->type) {
@@ -8979,9 +9007,43 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
new_field->set_derivation(item->collation.derivation);
break;
case DECIMAL_RESULT:
- new_field= new Field_new_decimal(item->max_length, maybe_null, item->name,
- table, item->decimals, item->unsigned_flag);
+ {
+ uint8 dec= item->decimals;
+ uint8 intg= ((Item_decimal *) item)->decimal_precision() - dec;
+ uint32 len= item->max_length;
+
+ /*
+ Trying to put too many digits overall in a DECIMAL(prec,dec)
+ will always throw a warning. We must limit dec to
+ DECIMAL_MAX_SCALE however to prevent an assert() later.
+ */
+
+ if (dec > 0)
+ {
+ signed int overflow;
+
+ dec= min(dec, DECIMAL_MAX_SCALE);
+
+ /*
+ If the value still overflows the field with the corrected dec,
+ we'll throw out decimals rather than integers. This is still
+ bad and of course throws a truncation warning.
+ +1: for decimal point
+ */
+
+ overflow= my_decimal_precision_to_length(intg + dec, dec,
+ item->unsigned_flag) - len;
+
+ if (overflow > 0)
+ dec= max(0, dec - overflow); // too long, discard fract
+ else
+ len -= item->decimals - dec; // corrected value fits
+ }
+
+ new_field= new Field_new_decimal(len, maybe_null, item->name,
+ table, dec, item->unsigned_flag);
break;
+ }
case ROW_RESULT:
default:
// This case should never be choosen
@@ -10358,6 +10420,15 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
error= (*end_select)(join,join_tab,0);
if (error == NESTED_LOOP_OK || error == NESTED_LOOP_QUERY_LIMIT)
error= (*end_select)(join,join_tab,1);
+
+ /*
+ If we don't go through evaluate_join_record(), do the counting
+ here. join->send_records is increased on success in end_send(),
+ so we don't touch it here.
+ */
+ join->examined_rows++;
+ join->thd->row_count++;
+ DBUG_ASSERT(join->examined_rows <= 1);
}
else if (join->send_row_on_empty_set())
{
@@ -13085,7 +13156,8 @@ static int
join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count)
{
reg1 uint i;
- uint length,blobs,size;
+ uint length, blobs;
+ size_t size;
CACHE_FIELD *copy,**blob_ptr;
JOIN_CACHE *cache;
JOIN_TAB *join_tab;
@@ -13201,7 +13273,7 @@ store_record_in_cache(JOIN_CACHE *cache)
length=cache->length;
if (cache->blobs)
length+=used_blob_length(cache->blob_ptr);
- if ((last_record=(length+cache->length > (uint) (cache->end - pos))))
+ if ((last_record= (length + cache->length > (size_t) (cache->end - pos))))
cache->ptr_record=cache->records;
/*
@@ -13247,7 +13319,7 @@ store_record_in_cache(JOIN_CACHE *cache)
}
}
cache->pos=pos;
- return last_record || (uint) (cache->end -pos) < cache->length;
+ return last_record || (size_t) (cache->end - pos) < cache->length;
}
@@ -13920,13 +13992,31 @@ calc_group_buffer(JOIN *join,ORDER *group)
group_item->decimals);
break;
case STRING_RESULT:
+ {
+ enum enum_field_types type= group_item->field_type();
/*
- Group strings are taken as varstrings and require an length field.
- A field is not yet created by create_tmp_field()
- and the sizes should match up.
+ As items represented as DATE/TIME fields in the group buffer
+ have STRING_RESULT result type, we increase the length
+ by 8 as maximum pack length of such fields.
*/
- key_length+= group_item->max_length + HA_KEY_BLOB_LENGTH;
+ if (type == MYSQL_TYPE_TIME ||
+ type == MYSQL_TYPE_DATE ||
+ type == MYSQL_TYPE_DATETIME ||
+ type == MYSQL_TYPE_TIMESTAMP)
+ {
+ key_length+= 8;
+ }
+ else
+ {
+ /*
+ Group strings are taken as varstrings and require an length field.
+ A field is not yet created by create_tmp_field()
+ and the sizes should match up.
+ */
+ key_length+= group_item->max_length + HA_KEY_BLOB_LENGTH;
+ }
break;
+ }
default:
/* This case should never be choosen */
DBUG_ASSERT(0);
@@ -14349,6 +14439,9 @@ change_to_use_tmp_fields(THD *thd, Item **ref_pointer_array,
item_field= (Item*) new Item_field(field);
if (!item_field)
DBUG_RETURN(TRUE); // Fatal error
+
+ if (item->real_item()->type() != Item::FIELD_ITEM)
+ field->orig_table= 0;
item_field->name= item->name;
if (item->type() == Item::REF_ITEM)
{
@@ -15488,6 +15581,55 @@ static void print_join(THD *thd, String *str, List<TABLE_LIST> *tables)
}
+/**
+ @brief Print an index hint for a table
+
+ @details Prints out the USE|FORCE|IGNORE index hints for a table.
+
+ @param thd the current thread
+ @param[out] str appends the index hint here
+ @param hint what the hint is (as string : "USE INDEX"|
+ "FORCE INDEX"|"IGNORE INDEX")
+ @param hint_length the length of the string in 'hint'
+ @param indexes a list of index names for the hint
+*/
+
+void
+TABLE_LIST::print_index_hint(THD *thd, String *str,
+ const char *hint, uint32 hint_length,
+ List<String> indexes)
+{
+ List_iterator_fast<String> li(indexes);
+ String *idx;
+ bool first= 1;
+ size_t find_length= strlen(primary_key_name);
+
+ str->append (' ');
+ str->append (hint, hint_length);
+ str->append (STRING_WITH_LEN(" ("));
+ while ((idx = li++))
+ {
+ if (first)
+ first= 0;
+ else
+ str->append(',');
+ /*
+ It's safe to use ptr() here because we compare the length first
+ and we rely that my_strcasecmp will not access more than length()
+ chars from the string. See test_if_string_in_list() for similar
+ implementation.
+ */
+ if (find_length == idx->length() &&
+ !my_strcasecmp (system_charset_info, primary_key_name,
+ idx->ptr()))
+ str->append(primary_key_name);
+ else
+ append_identifier (thd, str, idx->ptr(), idx->length());
+ }
+ str->append(')');
+}
+
+
/*
Print table as it should be in join list
@@ -15552,9 +15694,33 @@ void TABLE_LIST::print(THD *thd, String *str)
}
if (my_strcasecmp(table_alias_charset, cmp_name, alias))
{
+ char t_alias_buff[MAX_ALIAS_NAME];
+ const char *t_alias= alias;
+
str->append(' ');
- append_identifier(thd, str, alias, strlen(alias));
+ if (lower_case_table_names== 1)
+ {
+ if (alias && alias[0])
+ {
+ strmov(t_alias_buff, alias);
+ my_casedn_str(files_charset_info, t_alias_buff);
+ t_alias= t_alias_buff;
+ }
+ }
+
+ append_identifier(thd, str, t_alias, strlen(t_alias));
+ }
+
+ if (use_index)
+ {
+ if (force_index)
+ print_index_hint(thd, str, STRING_WITH_LEN("FORCE INDEX"), *use_index);
+ else
+ print_index_hint(thd, str, STRING_WITH_LEN("USE INDEX"), *use_index);
}
+ if (ignore_index)
+ print_index_hint (thd, str, STRING_WITH_LEN("IGNORE INDEX"), *ignore_index);
+
}
}
diff --git a/sql/sql_select.h b/sql/sql_select.h
index d84fbcb8c2d..4fc32e7fdb3 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -521,9 +521,13 @@ public:
store_key(THD *thd, Field *field_arg, char *ptr, char *null, uint length)
:null_key(0), null_ptr(null), err(0)
{
- if (field_arg->type() == FIELD_TYPE_BLOB)
+ if (field_arg->type() == FIELD_TYPE_BLOB
+ || field_arg->type() == FIELD_TYPE_GEOMETRY)
{
- /* Key segments are always packed with a 2 byte length prefix */
+ /*
+ Key segments are always packed with a 2 byte length prefix.
+ See mi_rkey for details.
+ */
to_field=new Field_varstring(ptr, length, 2, (uchar*) null, 1,
Field::NONE, field_arg->field_name,
field_arg->table, field_arg->charset());
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 53c6dfce5ae..9dfcc9156b9 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -361,7 +361,8 @@ int quick_rm_table(enum db_type base,const char *db,
/*
Sort keys in the following order:
- PRIMARY KEY
- - UNIQUE keyws where all column are NOT NULL
+ - UNIQUE keys where all column are NOT NULL
+ - UNIQUE keys that don't contain partial segments
- Other UNIQUE keys
- Normal keys
- Fulltext keys
@@ -372,26 +373,31 @@ int quick_rm_table(enum db_type base,const char *db,
static int sort_keys(KEY *a, KEY *b)
{
- if (a->flags & HA_NOSAME)
+ ulong a_flags= a->flags, b_flags= b->flags;
+
+ if (a_flags & HA_NOSAME)
{
- if (!(b->flags & HA_NOSAME))
+ if (!(b_flags & HA_NOSAME))
return -1;
- if ((a->flags ^ b->flags) & (HA_NULL_PART_KEY | HA_END_SPACE_KEY))
+ if ((a_flags ^ b_flags) & (HA_NULL_PART_KEY | HA_END_SPACE_KEY))
{
/* Sort NOT NULL keys before other keys */
- return (a->flags & (HA_NULL_PART_KEY | HA_END_SPACE_KEY)) ? 1 : -1;
+ return (a_flags & (HA_NULL_PART_KEY | HA_END_SPACE_KEY)) ? 1 : -1;
}
if (a->name == primary_key_name)
return -1;
if (b->name == primary_key_name)
return 1;
+ /* Sort keys don't containing partial segments before others */
+ if ((a_flags ^ b_flags) & HA_KEY_HAS_PART_KEY_SEG)
+ return (a_flags & HA_KEY_HAS_PART_KEY_SEG) ? 1 : -1;
}
- else if (b->flags & HA_NOSAME)
+ else if (b_flags & HA_NOSAME)
return 1; // Prefer b
- if ((a->flags ^ b->flags) & HA_FULLTEXT)
+ if ((a_flags ^ b_flags) & HA_FULLTEXT)
{
- return (a->flags & HA_FULLTEXT) ? 1 : -1;
+ return (a_flags & HA_FULLTEXT) ? 1 : -1;
}
/*
Prefer original key order. usable_key_parts contains here
@@ -955,8 +961,8 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
sql_field->length= dup_field->char_length;
sql_field->pack_length= dup_field->pack_length;
sql_field->key_length= dup_field->key_length;
- sql_field->create_length_to_internal_length();
sql_field->decimals= dup_field->decimals;
+ sql_field->create_length_to_internal_length();
sql_field->unireg_check= dup_field->unireg_check;
/*
We're making one field from two, the result field will have
@@ -1287,7 +1293,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
}
if (f_is_geom(sql_field->pack_flag) && sql_field->geom_type ==
Field::GEOM_POINT)
- column->length= 21;
+ column->length= 25;
if (!column->length)
{
my_error(ER_BLOB_KEY_WITHOUT_LENGTH, MYF(0), column->field_name);
@@ -1421,6 +1427,10 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
else
key_info->flags|= HA_PACK_KEY;
}
+ /* Check if the key segment is partial, set the key flag accordingly */
+ if (length != sql_field->key_length)
+ key_info->flags|= HA_KEY_HAS_PART_KEY_SEG;
+
key_length+=length;
key_part_info++;
@@ -1476,7 +1486,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
DBUG_RETURN(-1);
}
/* Sort keys in optimized order */
- qsort((gptr) *key_info_buffer, *key_count, sizeof(KEY),
+ my_qsort((gptr) *key_info_buffer, *key_count, sizeof(KEY),
(qsort_cmp) sort_keys);
create_info->null_bits= null_fields;
@@ -2761,7 +2771,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST *src_table,
operations on the target table.
*/
if (lock_and_wait_for_table_name(thd, src_table))
- goto err;
+ DBUG_RETURN(res);
pthread_mutex_lock(&LOCK_open);
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc
index 077660f0bb9..34ca18d5c39 100644
--- a/sql/sql_udf.cc
+++ b/sql/sql_udf.cc
@@ -410,7 +410,12 @@ int mysql_create_function(THD *thd,udf_func *udf)
if (!initialized)
{
- my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
+ if (opt_noacl)
+ my_error(ER_CANT_INITIALIZE_UDF, MYF(0),
+ udf->name.str,
+ "UDFs are unavailable with the --skip-grant-tables option");
+ else
+ my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
DBUG_RETURN(1);
}
@@ -426,14 +431,14 @@ int mysql_create_function(THD *thd,udf_func *udf)
}
if (udf->name.length > NAME_LEN)
{
- my_error(ER_TOO_LONG_IDENT, MYF(0), udf->name);
+ my_error(ER_TOO_LONG_IDENT, MYF(0), udf->name.str);
DBUG_RETURN(1);
}
rw_wrlock(&THR_LOCK_udf);
if ((hash_search(&udf_hash,(byte*) udf->name.str, udf->name.length)))
{
- my_error(ER_UDF_EXISTS, MYF(0), udf->name);
+ my_error(ER_UDF_EXISTS, MYF(0), udf->name.str);
goto err;
}
if (!(dl = find_udf_dl(udf->dl)))
@@ -514,7 +519,10 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name)
DBUG_ENTER("mysql_drop_function");
if (!initialized)
{
- my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
+ if (opt_noacl)
+ my_error(ER_FUNCTION_NOT_DEFINED, MYF(0), udf_name->str);
+ else
+ my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
DBUG_RETURN(1);
}
rw_wrlock(&THR_LOCK_udf);
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 3796d2b1dba..ab277f63049 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -134,6 +134,7 @@ int mysql_update(THD *thd,
SELECT_LEX *select_lex= &thd->lex->select_lex;
bool need_reopen;
List<Item> all_fields;
+ THD::killed_state killed_status= THD::NOT_KILLED;
DBUG_ENTER("mysql_update");
LINT_INIT(timestamp_query_id);
@@ -362,7 +363,7 @@ int mysql_update(THD *thd,
init_read_record_idx(&info, thd, table, 1, used_index);
thd_proc_info(thd, "Searching rows for update");
- uint tmp_limit= limit;
+ ha_rows tmp_limit= limit;
while (!(error=info.read_record(&info)) && !thd->killed)
{
@@ -519,43 +520,26 @@ int mysql_update(THD *thd,
table->file->unlock_row();
thd->row_count++;
}
+ /*
+ Caching the killed status to pass as the arg to query event constuctor;
+ The cached value can not change whereas the killed status can
+ (externally) since this point and change of the latter won't affect
+ binlogging.
+ It's assumed that if an error was set in combination with an effective
+ killed status then the error is due to killing.
+ */
+ killed_status= thd->killed; // get the status of the volatile
+ // simulated killing after the loop must be ineffective for binlogging
+ DBUG_EXECUTE_IF("simulate_kill_bug27571",
+ {
+ thd->killed= THD::KILL_QUERY;
+ };);
+ error= (killed_status == THD::NOT_KILLED)? error : 1;
+
if (!transactional_table && updated > 0)
thd->transaction.stmt.modified_non_trans_table= TRUE;
-
- /*
- todo bug#27571: to avoid asynchronization of `error' and
- `error_code' of binlog event constructor
-
- The concept, which is a bit different for insert(!), is to
- replace `error' assignment with the following lines
-
- killed_status= thd->killed; // get the status of the volatile
-
- Notice: thd->killed is type of "state" whereas the lhs has
- "status" the suffix which translates according to WordNet: a state
- at a particular time - at the time of the end of per-row loop in
- our case. Binlogging ops are conducted with the status.
-
- error= (killed_status == THD::NOT_KILLED)? error : 1;
-
- which applies to most mysql_$query functions.
- Event's constructor will accept `killed_status' as an argument:
-
- Query_log_event qinfo(..., killed_status);
-
- thd->killed might be changed after killed_status had got cached and this
- won't affect binlogging event but other effects remain.
-
- Open issue: In a case the error happened not because of KILLED -
- and then KILLED was caught later still within the loop - we shall
- do something to avoid binlogging of incorrect ER_SERVER_SHUTDOWN
- error_code.
- */
-
- if (thd->killed && !error)
- error= 1; // Aborted
end_read_record(&info);
free_io_cache(table); // If ORDER BY
delete select;
@@ -580,14 +564,14 @@ int mysql_update(THD *thd,
Sometimes we want to binlog even if we updated no rows, in case user used
it to be sure master and slave are in same state.
*/
- if ((error < 0) || (updated && !transactional_table))
+ if ((error < 0) || thd->transaction.stmt.modified_non_trans_table)
{
if (mysql_bin_log.is_open())
{
if (error < 0)
thd->clear_error();
Query_log_event qinfo(thd, thd->query, thd->query_length,
- transactional_table, FALSE);
+ transactional_table, FALSE, killed_status);
if (mysql_bin_log.write(&qinfo) && transactional_table)
error=1; // Rollback update
}
@@ -994,8 +978,8 @@ multi_update::multi_update(TABLE_LIST *table_list,
:all_tables(table_list), leaves(leaves_list), update_tables(0),
tmp_tables(0), updated(0), found(0), fields(field_list),
values(value_list), table_count(0), copy_field(0),
- handle_duplicates(handle_duplicates_arg), do_update(1), trans_safe(0),
- transactional_tables(1), ignore(ignore_arg)
+ handle_duplicates(handle_duplicates_arg), do_update(1), trans_safe(1),
+ transactional_tables(1), ignore(ignore_arg), error_handled(0)
{}
@@ -1202,7 +1186,6 @@ multi_update::initialize_tables(JOIN *join)
if ((thd->options & OPTION_SAFE_UPDATES) && error_if_full_join(join))
DBUG_RETURN(1);
main_table=join->join_tab->table;
- trans_safe= transactional_tables= main_table->file->has_transactions();
table_to_update= 0;
/* Any update has at least one pair (field, value) */
@@ -1484,12 +1467,14 @@ void multi_update::send_error(uint errcode,const char *err)
/* First send error what ever it is ... */
my_error(errcode, MYF(0), err);
- /* If nothing updated return */
- if (updated == 0) /* the counter might be reset in send_eof */
- return; /* and then the query has been binlogged */
+ /* the error was handled or nothing deleted and no side effects return */
+ if (error_handled ||
+ !thd->transaction.stmt.modified_non_trans_table && !updated)
+ return;
/* Something already updated so we have to invalidate cache */
- query_cache_invalidate3(thd, update_tables, 1);
+ if (updated)
+ query_cache_invalidate3(thd, update_tables, 1);
/*
If all tables that has been updated are trans safe then just do rollback.
If not attempt to do remaining updates.
@@ -1521,12 +1506,16 @@ void multi_update::send_error(uint errcode,const char *err)
*/
if (mysql_bin_log.is_open())
{
+ /*
+ THD::killed status might not have been set ON at time of an error
+ got caught and if happens later the killed error is written
+ into repl event.
+ */
Query_log_event qinfo(thd, thd->query, thd->query_length,
transactional_tables, FALSE);
mysql_bin_log.write(&qinfo);
}
- if (!trans_safe)
- thd->transaction.all.modified_non_trans_table= TRUE;
+ thd->transaction.all.modified_non_trans_table= TRUE;
}
DBUG_ASSERT(trans_safe || !updated || thd->transaction.stmt.modified_non_trans_table);
@@ -1709,10 +1698,19 @@ err2:
bool multi_update::send_eof()
{
char buff[STRING_BUFFER_USUAL_SIZE];
+ THD::killed_state killed_status= THD::NOT_KILLED;
thd_proc_info(thd, "updating reference tables");
- /* Does updates for the last n - 1 tables, returns 0 if ok */
+ /*
+ Does updates for the last n - 1 tables, returns 0 if ok;
+ error takes into account killed status gained in do_updates()
+ */
int local_error = (table_count) ? do_updates(0) : 0;
+ /*
+ if local_error is not set ON until after do_updates() then
+ later carried out killing should not affect binlogging.
+ */
+ killed_status= (local_error == 0)? THD::NOT_KILLED : thd->killed;
thd_proc_info(thd, "end");
/* We must invalidate the query cache before binlog writing and
@@ -1739,16 +1737,16 @@ bool multi_update::send_eof()
{
if (local_error == 0)
thd->clear_error();
- else
- updated= 0; /* if there's an error binlog it here not in ::send_error */
Query_log_event qinfo(thd, thd->query, thd->query_length,
- transactional_tables, FALSE);
+ transactional_tables, FALSE, killed_status);
if (mysql_bin_log.write(&qinfo) && trans_safe)
local_error= 1; // Rollback update
}
if (thd->transaction.stmt.modified_non_trans_table)
thd->transaction.all.modified_non_trans_table= TRUE;
}
+ if (local_error != 0)
+ error_handled= TRUE; // to force early leave from ::send_error()
if (transactional_tables)
{
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index fd05d97a94a..343005651ed 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -223,9 +223,6 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
{
LEX *lex= thd->lex;
bool link_to_local;
-#ifndef NO_EMBEDDED_ACCESS_CHECKS
- bool definer_check_is_needed= mode != VIEW_ALTER || lex->definer;
-#endif
/* first table in list is target VIEW name => cut off it */
TABLE_LIST *view= lex->unlink_first_table(&link_to_local);
TABLE_LIST *tables= lex->query_tables;
@@ -280,7 +277,7 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
- same as current user
- current user has SUPER_ACL
*/
- if (definer_check_is_needed &&
+ if (lex->definer &&
(strcmp(lex->definer->user.str, thd->security_ctx->priv_user) != 0 ||
my_strcasecmp(system_charset_info,
lex->definer->host.str,
@@ -925,6 +922,15 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
DBUG_RETURN(0);
}
+ if (table->use_index || table->ignore_index)
+ {
+ my_error(ER_WRONG_USAGE, MYF(0),
+ table->ignore_index ? "IGNORE INDEX" :
+ (table->force_index ? "FORCE INDEX" : "USE INDEX"),
+ "VIEW");
+ DBUG_RETURN(TRUE);
+ }
+
/* check loop via view definition */
for (TABLE_LIST *precedent= table->referencing_view;
precedent;
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index c5d29402ad6..8f26e89e7f1 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1134,8 +1134,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%type <cast_type> cast_type
-%type <udf_type> udf_func_type
-
%type <symbol> FUNC_ARG0 FUNC_ARG1 FUNC_ARG2 FUNC_ARG3 keyword keyword_sp
%type <lex_user> user grant_user
@@ -1194,11 +1192,12 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
statement sp_suid
sp_c_chistics sp_a_chistics sp_chistic sp_c_chistic xa
load_data opt_field_or_var_spec fields_or_vars opt_load_data_set_spec
- definer view_replace_or_algorithm view_replace view_algorithm_opt
- view_algorithm view_or_trigger_or_sp view_or_trigger_or_sp_tail
+ view_replace_or_algorithm view_replace view_algorithm_opt
+ view_algorithm view_or_trigger_or_sp definer_tail
view_suid view_tail view_list_opt view_list view_select
- view_check_option trigger_tail sp_tail
+ view_check_option trigger_tail sp_tail sf_tail udf_tail
case_stmt_specification simple_case_stmt searched_case_stmt
+ definer_opt no_definer definer
END_OF_INPUT
%type <NONE> call sp_proc_stmts sp_proc_stmts1 sp_proc_stmt
@@ -1584,6 +1583,7 @@ sp_name:
{
LEX *lex= Lex;
LEX_STRING db;
+
if (check_routine_name($1))
{
my_error(ER_SP_WRONG_NAME, MYF(0), $1.str);
@@ -1595,126 +1595,8 @@ sp_name:
if ($$)
$$->init_qname(YYTHD);
}
- ;
-
-create_function_tail:
- RETURNS_SYM udf_type UDF_SONAME_SYM TEXT_STRING_sys
- {
- LEX *lex=Lex;
- if (lex->definer != NULL)
- {
- /*
- DEFINER is a concept meaningful when interpreting SQL code.
- UDF functions are compiled.
- Using DEFINER with UDF has therefore no semantic,
- and is considered a parsing error.
- */
- my_error(ER_WRONG_USAGE, MYF(0), "SONAME", "DEFINER");
- MYSQL_YYABORT;
- }
- lex->sql_command = SQLCOM_CREATE_FUNCTION;
- lex->udf.name = lex->spname->m_name;
- lex->udf.returns=(Item_result) $2;
- lex->udf.dl=$4.str;
- }
- | '('
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- Lex_input_stream *lip= thd->m_lip;
- sp_head *sp;
-
- /*
- First check if AGGREGATE was used, in that case it's a
- syntax error.
- */
- if (lex->udf.type == UDFTYPE_AGGREGATE)
- {
- my_error(ER_SP_NO_AGGREGATE, MYF(0));
- MYSQL_YYABORT;
- }
-
- if (lex->sphead)
- {
- my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "FUNCTION");
- MYSQL_YYABORT;
- }
- /* Order is important here: new - reset - init */
- sp= new sp_head();
- sp->reset_thd_mem_root(thd);
- sp->init(lex);
- sp->init_sp_name(thd, lex->spname);
-
- sp->m_type= TYPE_ENUM_FUNCTION;
- lex->sphead= sp;
- /*
- * We have to turn of CLIENT_MULTI_QUERIES while parsing a
- * stored procedure, otherwise yylex will chop it into pieces
- * at each ';'.
- */
- sp->m_old_cmq= thd->client_capabilities & CLIENT_MULTI_QUERIES;
- thd->client_capabilities &= ~CLIENT_MULTI_QUERIES;
- lex->sphead->m_param_begin= lip->tok_start+1;
- }
- sp_fdparam_list ')'
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- Lex_input_stream *lip= thd->m_lip;
-
- lex->sphead->m_param_end= lip->tok_start;
- }
- RETURNS_SYM
- {
- LEX *lex= Lex;
- lex->charset= NULL;
- lex->length= lex->dec= NULL;
- lex->interval_list.empty();
- lex->type= 0;
- }
- type
- {
- LEX *lex= Lex;
- sp_head *sp= lex->sphead;
-
- if (sp->fill_field_definition(YYTHD, lex,
- (enum enum_field_types) $8,
- &sp->m_return_field_def))
- MYSQL_YYABORT;
-
- bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
- }
- sp_c_chistics
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- Lex_input_stream *lip= thd->m_lip;
-
- lex->sphead->m_chistics= &lex->sp_chistics;
- lex->sphead->m_body_begin= lip->tok_start;
- }
- sp_proc_stmt
- {
- LEX *lex= Lex;
- sp_head *sp= lex->sphead;
-
- if (sp->is_not_allowed_in_function("function"))
- MYSQL_YYABORT;
-
- lex->sql_command= SQLCOM_CREATE_SPFUNCTION;
- sp->init_strings(YYTHD, lex);
- if (!(sp->m_flags & sp_head::HAS_RETURN))
- {
- my_error(ER_SP_NORETURN, MYF(0), sp->m_qname.str);
- MYSQL_YYABORT;
- }
- /* Restore flag if it was cleared above */
- if (sp->m_old_cmq)
- YYTHD->client_capabilities |= CLIENT_MULTI_QUERIES;
- sp->restore_thd_mem_root(YYTHD);
- }
- ;
-
+ ;
+
sp_a_chistics:
/* Empty */ {}
| sp_a_chistics sp_chistic {}
@@ -1942,7 +1824,8 @@ sp_decl:
{
LEX *lex= Lex;
- lex->sphead->reset_lex(YYTHD);
+ if (lex->sphead->reset_lex(YYTHD))
+ MYSQL_YYABORT;
lex->spcont->declare_var_boundary($2);
}
type
@@ -1950,6 +1833,10 @@ sp_decl:
{
LEX *lex= Lex;
sp_pcontext *pctx= lex->spcont;
+ if (pctx == 0)
+ {
+ MYSQL_YYABORT;
+ }
uint num_vars= pctx->context_var_count();
enum enum_field_types var_type= (enum enum_field_types) $4;
Item *dflt_value_item= $5;
@@ -2035,12 +1922,15 @@ sp_decl:
{
i= new sp_instr_hreturn(sp->instructions(), ctx,
ctx->current_var_count());
+ if (i == NULL )
+ MYSQL_YYABORT;
sp->add_instr(i);
}
else
{ /* EXIT or UNDO handler, just jump to the end of the block */
i= new sp_instr_hreturn(sp->instructions(), ctx, 0);
-
+ if (i == NULL)
+ MYSQL_YYABORT;
sp->add_instr(i);
sp->push_backpatch(i, lex->spcont->last_label()); /* Block end */
}
@@ -2068,7 +1958,9 @@ sp_decl:
}
i= new sp_instr_cpush(sp->instructions(), ctx, $5,
ctx->current_cursor_count());
- sp->add_instr(i);
+ if ( i==NULL )
+ MYSQL_YYABORT;
+ sp->add_instr(i);
ctx->push_cursor(&$2);
$$.vars= $$.conds= $$.hndlrs= 0;
$$.curs= 1;
@@ -2077,7 +1969,8 @@ sp_decl:
sp_cursor_stmt:
{
- Lex->sphead->reset_lex(YYTHD);
+ if(Lex->sphead->reset_lex(YYTHD))
+ MYSQL_YYABORT;
/* We use statement here just be able to get a better
error message. Using 'select' works too, but will then
@@ -2243,7 +2136,8 @@ sp_proc_stmt:
LEX *lex= thd->lex;
Lex_input_stream *lip= thd->m_lip;
- lex->sphead->reset_lex(thd);
+ if (lex->sphead->reset_lex(thd))
+ MYSQL_YYABORT;
lex->sphead->m_tmp_query= lip->tok_start;
}
statement
@@ -2268,9 +2162,10 @@ sp_proc_stmt:
lex->var_list.is_empty());
if (lex->sql_command != SQLCOM_SET_OPTION)
{
- sp_instr_stmt *i=new sp_instr_stmt(sp->instructions(),
+ sp_instr_stmt *i= new sp_instr_stmt(sp->instructions(),
lex->spcont, lex);
-
+ if (i == NULL)
+ MYSQL_YYABORT;
/*
Extract the query statement from the tokenizer. The
end is either lex->ptr, if there was no lookahead,
@@ -2288,7 +2183,10 @@ sp_proc_stmt:
sp->restore_lex(thd);
}
| RETURN_SYM
- { Lex->sphead->reset_lex(YYTHD); }
+ {
+ if(Lex->sphead->reset_lex(YYTHD))
+ MYSQL_YYABORT;
+ }
expr
{
LEX *lex= Lex;
@@ -2305,6 +2203,8 @@ sp_proc_stmt:
i= new sp_instr_freturn(sp->instructions(), lex->spcont, $3,
sp->m_return_field_def.sql_type, lex);
+ if (i == NULL)
+ MYSQL_YYABORT;
sp->add_instr(i);
sp->m_flags|= sp_head::HAS_RETURN;
}
@@ -2347,12 +2247,23 @@ sp_proc_stmt:
uint n;
n= ctx->diff_handlers(lab->ctx, TRUE); /* Exclusive the dest. */
+
if (n)
- sp->add_instr(new sp_instr_hpop(ip++, ctx, n));
+ {
+ sp_instr_hpop *hpop= new sp_instr_hpop(ip++, ctx, n);
+ if (hpop == NULL)
+ MYSQL_YYABORT;
+ sp->add_instr(hpop);
+ }
n= ctx->diff_cursors(lab->ctx, TRUE); /* Exclusive the dest. */
if (n)
- sp->add_instr(new sp_instr_cpop(ip++, ctx, n));
+ {
+ sp_instr_cpop *cpop= new sp_instr_cpop(ip++, ctx, n);
+ sp->add_instr(cpop);
+ }
i= new sp_instr_jump(ip, ctx);
+ if (i == NULL)
+ MYSQL_YYABORT;
sp->push_backpatch(i, lab); /* Jumping forward */
sp->add_instr(i);
}
@@ -2377,11 +2288,19 @@ sp_proc_stmt:
n= ctx->diff_handlers(lab->ctx, FALSE); /* Inclusive the dest. */
if (n)
- sp->add_instr(new sp_instr_hpop(ip++, ctx, n));
+ {
+ sp_instr_hpop *hpop= new sp_instr_hpop(ip++, ctx, n);
+ sp->add_instr(hpop);
+ }
n= ctx->diff_cursors(lab->ctx, FALSE); /* Inclusive the dest. */
if (n)
- sp->add_instr(new sp_instr_cpop(ip++, ctx, n));
+ {
+ sp_instr_cpop *cpop= new sp_instr_cpop(ip++, ctx, n);
+ sp->add_instr(cpop);
+ }
i= new sp_instr_jump(ip, ctx, lab->ip); /* Jump back */
+ if (i == NULL)
+ MYSQL_YYABORT;
sp->add_instr(i);
}
}
@@ -2398,6 +2317,8 @@ sp_proc_stmt:
MYSQL_YYABORT;
}
i= new sp_instr_copen(sp->instructions(), lex->spcont, offset);
+ if (i == NULL)
+ MYSQL_YYABORT;
sp->add_instr(i);
}
| FETCH_SYM sp_opt_fetch_noise ident INTO
@@ -2413,6 +2334,8 @@ sp_proc_stmt:
MYSQL_YYABORT;
}
i= new sp_instr_cfetch(sp->instructions(), lex->spcont, offset);
+ if (i == NULL)
+ MYSQL_YYABORT;
sp->add_instr(i);
}
sp_fetch_list
@@ -2430,6 +2353,8 @@ sp_proc_stmt:
MYSQL_YYABORT;
}
i= new sp_instr_cclose(sp->instructions(), lex->spcont, offset);
+ if (i == NULL)
+ MYSQL_YYABORT;
sp->add_instr(i);
}
;
@@ -2485,7 +2410,10 @@ sp_fetch_list:
;
sp_if:
- { Lex->sphead->reset_lex(YYTHD); }
+ {
+ if (Lex->sphead->reset_lex(YYTHD))
+ MYSQL_YYABORT;
+ }
expr THEN_SYM
{
LEX *lex= Lex;
@@ -2494,7 +2422,8 @@ sp_if:
uint ip= sp->instructions();
sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, ctx,
$2, lex);
-
+ if (i == NULL)
+ MYSQL_YYABORT;
sp->push_backpatch(i, ctx->push_label((char *)"", 0));
sp->add_cont_backpatch(i);
sp->add_instr(i);
@@ -2506,7 +2435,8 @@ sp_if:
sp_pcontext *ctx= Lex->spcont;
uint ip= sp->instructions();
sp_instr_jump *i = new sp_instr_jump(ip, ctx);
-
+ if (i == NULL)
+ MYSQL_YYABORT;
sp->add_instr(i);
sp->backpatch(ctx->pop_label());
sp->push_backpatch(i, ctx->push_label((char *)"", 0));
@@ -2535,7 +2465,8 @@ simple_case_stmt:
{
LEX *lex= Lex;
case_stmt_action_case(lex);
- lex->sphead->reset_lex(YYTHD); /* For expr $3 */
+ if (lex->sphead->reset_lex(YYTHD))
+ MYSQL_YYABORT; /* For expr $3 */
}
expr
{
@@ -2584,7 +2515,8 @@ searched_when_clause_list:
simple_when_clause:
WHEN_SYM
{
- Lex->sphead->reset_lex(YYTHD); /* For expr $3 */
+ if (Lex->sphead->reset_lex(YYTHD))
+ MYSQL_YYABORT; /* For expr $3 */
}
expr
{
@@ -2605,7 +2537,8 @@ simple_when_clause:
searched_when_clause:
WHEN_SYM
{
- Lex->sphead->reset_lex(YYTHD); /* For expr $3 */
+ if (Lex->sphead->reset_lex(YYTHD))
+ MYSQL_YYABORT; /* For expr $3 */
}
expr
{
@@ -2629,6 +2562,8 @@ else_clause_opt:
uint ip= sp->instructions();
sp_instr_error *i= new sp_instr_error(ip, lex->spcont,
ER_SP_CASE_NOT_FOUND);
+ if (i == NULL)
+ MYSQL_YYABORT;
sp->add_instr(i);
}
| ELSE sp_proc_stmts1
@@ -2698,11 +2633,21 @@ sp_unlabeled_control:
sp->backpatch(ctx->last_label()); /* We always have a label */
if ($3.hndlrs)
- sp->add_instr(new sp_instr_hpop(sp->instructions(), ctx,
- $3.hndlrs));
+ {
+ sp_instr_hpop *hpop= new sp_instr_hpop(sp->instructions(), ctx,
+ $3.hndlrs);
+ if (hpop == NULL)
+ MYSQL_YYABORT;
+ sp->add_instr(hpop);
+ }
if ($3.curs)
- sp->add_instr(new sp_instr_cpop(sp->instructions(), ctx,
- $3.curs));
+ {
+ sp_instr_cpop *cpop= new sp_instr_cpop(sp->instructions(), ctx,
+ $3.curs);
+ if (cpop == NULL)
+ MYSQL_YYABORT;
+ sp->add_instr(cpop);
+ }
lex->spcont= ctx->pop_context();
}
| LOOP_SYM
@@ -2712,11 +2657,15 @@ sp_unlabeled_control:
uint ip= lex->sphead->instructions();
sp_label_t *lab= lex->spcont->last_label(); /* Jumping back */
sp_instr_jump *i = new sp_instr_jump(ip, lex->spcont, lab->ip);
-
+ if (i == NULL)
+ MYSQL_YYABORT;
lex->sphead->add_instr(i);
}
| WHILE_SYM
- { Lex->sphead->reset_lex(YYTHD); }
+ {
+ if (Lex->sphead->reset_lex(YYTHD))
+ MYSQL_YYABORT;
+ }
expr DO_SYM
{
LEX *lex= Lex;
@@ -2724,7 +2673,8 @@ sp_unlabeled_control:
uint ip= sp->instructions();
sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, lex->spcont,
$3, lex);
-
+ if (i == NULL)
+ MYSQL_YYABORT;
/* Jumping forward */
sp->push_backpatch(i, lex->spcont->last_label());
sp->new_cont_backpatch(i);
@@ -2737,12 +2687,16 @@ sp_unlabeled_control:
uint ip= lex->sphead->instructions();
sp_label_t *lab= lex->spcont->last_label(); /* Jumping back */
sp_instr_jump *i = new sp_instr_jump(ip, lex->spcont, lab->ip);
-
+ if (i == NULL)
+ MYSQL_YYABORT;
lex->sphead->add_instr(i);
lex->sphead->do_cont_backpatch();
}
| REPEAT_SYM sp_proc_stmts1 UNTIL_SYM
- { Lex->sphead->reset_lex(YYTHD); }
+ {
+ if (Lex->sphead->reset_lex(YYTHD))
+ MYSQL_YYABORT;
+ }
expr END REPEAT_SYM
{
LEX *lex= Lex;
@@ -2751,6 +2705,8 @@ sp_unlabeled_control:
sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, lex->spcont,
$5, lab->ip,
lex);
+ if (i == NULL)
+ MYSQL_YYABORT;
lex->sphead->add_instr(i);
lex->sphead->restore_lex(YYTHD);
/* We can shortcut the cont_backpatch here */
@@ -3015,10 +2971,6 @@ opt_select_from:
opt_limit_clause {}
| select_from select_lock_type;
-udf_func_type:
- /* empty */ { $$ = UDFTYPE_FUNCTION; }
- | AGGREGATE_SYM { $$ = UDFTYPE_AGGREGATE; };
-
udf_type:
STRING_SYM {$$ = (int) STRING_RESULT; }
| REAL {$$ = (int) REAL_RESULT; }
@@ -3229,7 +3181,7 @@ type:
spatial_type:
GEOMETRY_SYM { $$= Field::GEOM_GEOMETRY; }
| GEOMETRYCOLLECTION { $$= Field::GEOM_GEOMETRYCOLLECTION; }
- | POINT_SYM { Lex->length= (char*)"21";
+ | POINT_SYM { Lex->length= (char*)"25";
$$= Field::GEOM_POINT;
}
| MULTIPOINT { $$= Field::GEOM_MULTIPOINT; }
@@ -3682,7 +3634,7 @@ alter:
lex->sql_command= SQLCOM_ALTER_FUNCTION;
lex->spname= $3;
}
- | ALTER view_algorithm_opt definer view_suid
+ | ALTER view_algorithm_opt definer_opt view_suid
VIEW_SYM table_ident
{
THD *thd= YYTHD;
@@ -4056,7 +4008,7 @@ analyze:
lex->no_write_to_binlog= $2;
lex->check_opt.init();
}
- table_list opt_mi_check_type
+ table_list
{}
;
@@ -4101,7 +4053,7 @@ optimize:
lex->no_write_to_binlog= $2;
lex->check_opt.init();
}
- table_list opt_mi_check_type
+ table_list
{}
;
@@ -4284,6 +4236,8 @@ select_init2:
select_part2
{
LEX *lex= Lex;
+ if (lex == NULL)
+ MYSQL_YYABORT;
SELECT_LEX * sel= lex->current_select;
if (lex->current_select->set_braces(0))
{
@@ -4440,6 +4394,12 @@ select_item:
MYSQL_YYABORT;
if ($4.str)
{
+ if (Lex->sql_command == SQLCOM_CREATE_VIEW &&
+ check_column_name($4.str))
+ {
+ my_error(ER_WRONG_COLUMN_NAME, MYF(0), $4.str);
+ MYSQL_YYABORT;
+ }
$2->is_autogenerated_name= FALSE;
$2->set_name($4.str, $4.length, system_charset_info);
}
@@ -4637,6 +4597,8 @@ predicate:
$7->push_front($5);
$7->push_front($1);
Item_func_in *item = new (YYTHD->mem_root) Item_func_in(*$7);
+ if (item == NULL)
+ MYSQL_YYABORT;
item->negate();
$$= item;
}
@@ -5097,7 +5059,8 @@ simple_expr:
{
LEX *lex= Lex;
sp_name *name= new sp_name($1, $3, true);
-
+ if (name == NULL)
+ MYSQL_YYABORT;
name->init_qname(YYTHD);
sp_add_used_routine(lex, YYTHD, name, TYPE_ENUM_FUNCTION);
if ($5)
@@ -5209,11 +5172,34 @@ simple_expr:
{
THD *thd= lex->thd;
LEX_STRING db;
+ if (! thd->db && ! lex->sphead)
+ {
+ /*
+ The proper error message should be in the lines of:
+ Can't resolve <name>() to a function call,
+ because this function:
+ - is not a native function,
+ - is not a user defined function,
+ - can not match a stored function since no database is selected.
+ Reusing ER_SP_DOES_NOT_EXIST have a message consistent with
+ the case when a default database exist, see below.
+ */
+ my_error(ER_SP_DOES_NOT_EXIST, MYF(0),
+ "FUNCTION", $1.str);
+ MYSQL_YYABORT;
+ }
+
if (lex->copy_db_to(&db.str, &db.length))
MYSQL_YYABORT;
+
+ /*
+ From here, the parser assumes <name>() is a stored function,
+ as a last choice. This later can lead to ER_SP_DOES_NOT_EXIST.
+ */
sp_name *name= new sp_name(db, $1, false);
- if (name)
- name->init_qname(thd);
+ if (name == NULL)
+ MYSQL_YYABORT;
+ name->init_qname(thd);
sp_add_used_routine(lex, YYTHD, name, TYPE_ENUM_FUNCTION);
if ($4)
@@ -6512,9 +6498,11 @@ drop:
lex->drop_if_exists=$3;
lex->name=$4.str;
}
- | DROP FUNCTION_SYM if_exists sp_name
+ | DROP FUNCTION_SYM if_exists ident '.' ident
{
- LEX *lex=Lex;
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ sp_name *spname;
if (lex->sphead)
{
my_error(ER_SP_NO_DROP_SP, MYF(0), "FUNCTION");
@@ -6522,7 +6510,28 @@ drop:
}
lex->sql_command = SQLCOM_DROP_FUNCTION;
lex->drop_if_exists= $3;
- lex->spname= $4;
+ spname= new sp_name($4, $6, true);
+ spname->init_qname(thd);
+ lex->spname= spname;
+ }
+ | DROP FUNCTION_SYM if_exists ident
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ LEX_STRING db= {0, 0};
+ sp_name *spname;
+ if (lex->sphead)
+ {
+ my_error(ER_SP_NO_DROP_SP, MYF(0), "FUNCTION");
+ MYSQL_YYABORT;
+ }
+ if (thd->db && lex->copy_db_to(&db.str, &db.length))
+ MYSQL_YYABORT;
+ lex->sql_command = SQLCOM_DROP_FUNCTION;
+ lex->drop_if_exists= $3;
+ spname= new sp_name(db, $4, false);
+ spname->init_qname(thd);
+ lex->spname= spname;
}
| DROP PROCEDURE if_exists sp_name
{
@@ -7797,11 +7806,15 @@ literal:
String *str= tmp ?
tmp->quick_fix_field(), tmp->val_str((String*) 0) :
(String*) 0;
- $$= new Item_string(str ? str->ptr() : "",
+ $$= new Item_string(NULL, /* name will be set in select_item */
+ str ? str->ptr() : "",
str ? str->length() : 0,
Lex->underscore_charset);
- if ($$)
- ((Item_string *) $$)->set_repertoire_from_value();
+ if (!$$ || !$$->check_well_formed_result(&$$->str_value, TRUE))
+ {
+ MYSQL_YYABORT;
+ }
+ ((Item_string *) $$)->set_repertoire_from_value();
}
| UNDERSCORE_CHARSET BIN_NUM
{
@@ -7813,9 +7826,14 @@ literal:
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);
+ $$= new Item_string(NULL, /* name will be set in select_item */
+ str ? str->ptr() : "",
+ str ? str->length() : 0,
+ Lex->underscore_charset);
+ if (!$$ || !$$->check_well_formed_result(&$$->str_value, TRUE))
+ {
+ MYSQL_YYABORT;
+ }
}
| DATE_SYM text_literal { $$ = $2; }
| TIME_SYM text_literal { $$ = $2; }
@@ -8516,7 +8534,8 @@ option_type_value:
QQ: May be we should simply prohibit group assignments in SP?
*/
- Lex->sphead->reset_lex(thd);
+ if (Lex->sphead->reset_lex(thd))
+ MYSQL_YYABORT;
lex= thd->lex;
/* Set new LEX as if we at start of set rule. */
@@ -8681,6 +8700,8 @@ sys_option_value:
it= spv->dflt;
else
it= new Item_null();
+ if (it == NULL)
+ MYSQL_YYABORT;
sp_set= new sp_instr_set(lex->sphead->instructions(), ctx,
spv->offset, it, spv->type, lex, TRUE);
lex->sphead->add_instr(sp_set);
@@ -9652,19 +9673,27 @@ subselect_end:
**************************************************************************/
view_or_trigger_or_sp:
- definer view_or_trigger_or_sp_tail
- {}
- | view_replace_or_algorithm definer view_tail
- {}
+ definer definer_tail
+ {}
+ | no_definer no_definer_tail
+ {}
+ | view_replace_or_algorithm definer_opt view_tail
+ {}
;
-view_or_trigger_or_sp_tail:
- view_tail
- {}
+definer_tail:
+ view_tail
| trigger_tail
- {}
| sp_tail
- {}
+ | sf_tail
+ ;
+
+no_definer_tail:
+ view_tail
+ | trigger_tail
+ | sp_tail
+ | sf_tail
+ | udf_tail
;
/**************************************************************************
@@ -9673,23 +9702,31 @@ view_or_trigger_or_sp_tail:
**************************************************************************/
+definer_opt:
+ no_definer
+ | definer
+ ;
+
+no_definer:
+ /* empty */
+ {
+ /*
+ We have to distinguish missing DEFINER-clause from case when
+ CURRENT_USER specified as definer explicitly in order to properly
+ handle CREATE TRIGGER statements which come to replication thread
+ from older master servers (i.e. to create non-suid trigger in this
+ case).
+ */
+ YYTHD->lex->definer= 0;
+ }
+ ;
+
definer:
- /* empty */
- {
- /*
- We have to distinguish missing DEFINER-clause from case when
- CURRENT_USER specified as definer explicitly in order to properly
- handle CREATE TRIGGER statements which come to replication thread
- from older master servers (i.e. to create non-suid trigger in this
- case).
- */
- YYTHD->lex->definer= 0;
- }
- | DEFINER_SYM EQ user
- {
- YYTHD->lex->definer= get_current_user(YYTHD, $3);
- }
- ;
+ DEFINER_SYM EQ user
+ {
+ YYTHD->lex->definer= get_current_user(YYTHD, $3);
+ }
+;
/**************************************************************************
@@ -9839,7 +9876,7 @@ trigger_tail:
my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "TRIGGER");
MYSQL_YYABORT;
}
-
+
if (!(sp= new sp_head()))
MYSQL_YYABORT;
sp->reset_thd_mem_root(thd);
@@ -9901,17 +9938,131 @@ trigger_tail:
**************************************************************************/
+udf_tail:
+ AGGREGATE_SYM remember_name FUNCTION_SYM ident
+ RETURNS_SYM udf_type UDF_SONAME_SYM TEXT_STRING_sys
+ {
+ LEX *lex=Lex;
+ lex->sql_command = SQLCOM_CREATE_FUNCTION;
+ lex->udf.type= UDFTYPE_AGGREGATE;
+ lex->stmt_definition_begin= $2;
+ lex->udf.name = $4;
+ lex->udf.returns=(Item_result) $6;
+ lex->udf.dl=$8.str;
+ }
+ | remember_name FUNCTION_SYM ident
+ RETURNS_SYM udf_type UDF_SONAME_SYM TEXT_STRING_sys
+ {
+ LEX *lex=Lex;
+ lex->sql_command = SQLCOM_CREATE_FUNCTION;
+ lex->udf.type= UDFTYPE_FUNCTION;
+ lex->stmt_definition_begin= $1;
+ lex->udf.name = $3;
+ lex->udf.returns=(Item_result) $5;
+ lex->udf.dl=$7.str;
+ }
+ ;
+
+sf_tail:
+ remember_name /* $1 */
+ FUNCTION_SYM /* $2 */
+ sp_name /* $3 */
+ '(' /* 44 */
+ { /* $5 */
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
+ sp_head *sp;
+
+ lex->stmt_definition_begin= $1;
+ lex->spname= $3;
+
+ if (lex->sphead)
+ {
+ my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "FUNCTION");
+ MYSQL_YYABORT;
+ }
+
+ /* Order is important here: new - reset - init */
+ sp= new sp_head();
+ sp->reset_thd_mem_root(thd);
+ sp->init(lex);
+ sp->init_sp_name(thd, lex->spname);
+
+ sp->m_type= TYPE_ENUM_FUNCTION;
+ lex->sphead= sp;
+ /*
+ * We have to turn of CLIENT_MULTI_QUERIES while parsing a
+ * stored procedure, otherwise yylex will chop it into pieces
+ * at each ';'.
+ */
+ sp->m_old_cmq= thd->client_capabilities & CLIENT_MULTI_QUERIES;
+ thd->client_capabilities &= ~CLIENT_MULTI_QUERIES;
+ lex->sphead->m_param_begin= lip->tok_start+1;
+ }
+ sp_fdparam_list /* $6 */
+ ')' /* $7 */
+ { /* $8 */
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
+
+ lex->sphead->m_param_end= lip->tok_start;
+ }
+ RETURNS_SYM /* $9 */
+ { /* $10 */
+ LEX *lex= Lex;
+ lex->charset= NULL;
+ lex->length= lex->dec= NULL;
+ lex->interval_list.empty();
+ lex->type= 0;
+ }
+ type /* $11 */
+ { /* $12 */
+ LEX *lex= Lex;
+ sp_head *sp= lex->sphead;
+
+ if (sp->fill_field_definition(YYTHD, lex,
+ (enum enum_field_types) $11,
+ &sp->m_return_field_def))
+ MYSQL_YYABORT;
+
+ bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
+ }
+ sp_c_chistics /* $13 */
+ { /* $14 */
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
+
+ lex->sphead->m_chistics= &lex->sp_chistics;
+ lex->sphead->m_body_begin= lip->tok_start;
+ }
+ sp_proc_stmt /* $15 */
+ {
+ LEX *lex= Lex;
+ sp_head *sp= lex->sphead;
+
+ if (sp->is_not_allowed_in_function("function"))
+ MYSQL_YYABORT;
+
+ lex->sql_command= SQLCOM_CREATE_SPFUNCTION;
+ sp->init_strings(YYTHD, lex);
+ if (!(sp->m_flags & sp_head::HAS_RETURN))
+ {
+ my_error(ER_SP_NORETURN, MYF(0), sp->m_qname.str);
+ MYSQL_YYABORT;
+ }
+ /* Restore flag if it was cleared above */
+ if (sp->m_old_cmq)
+ YYTHD->client_capabilities |= CLIENT_MULTI_QUERIES;
+ sp->restore_thd_mem_root(YYTHD);
+ }
+ ;
+
+
sp_tail:
- udf_func_type remember_name FUNCTION_SYM sp_name
- {
- LEX *lex=Lex;
- lex->udf.type= $1;
- lex->stmt_definition_begin= $2;
- lex->spname= $4;
- }
- create_function_tail
- {}
- | PROCEDURE remember_name sp_name
+ PROCEDURE remember_name sp_name
{
LEX *lex= Lex;
sp_head *sp;
@@ -9926,6 +10077,8 @@ sp_tail:
/* Order is important here: new - reset - init */
sp= new sp_head();
+ if (sp == NULL)
+ MYSQL_YYABORT;
sp->reset_thd_mem_root(YYTHD);
sp->init(lex);
sp->m_type= TYPE_ENUM_PROCEDURE;
diff --git a/sql/structs.h b/sql/structs.h
index e7072bec9c3..32bdab0bc15 100644
--- a/sql/structs.h
+++ b/sql/structs.h
@@ -87,7 +87,7 @@ typedef struct st_key_part_info { /* Info about a key part */
typedef struct st_key {
uint key_length; /* Tot length of key */
- uint flags; /* dupp key and pack flags */
+ ulong flags; /* dupp key and pack flags */
uint key_parts; /* How many key_parts */
uint extra_length;
uint usable_key_parts; /* Should normally be = key_parts */
diff --git a/sql/table.cc b/sql/table.cc
index a393f1a676b..7fe9aa774f3 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -732,9 +732,11 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
keyinfo->key_length+= HA_KEY_NULL_LENGTH;
}
if (field->type() == FIELD_TYPE_BLOB ||
- field->real_type() == MYSQL_TYPE_VARCHAR)
+ field->real_type() == MYSQL_TYPE_VARCHAR ||
+ field->type() == FIELD_TYPE_GEOMETRY)
{
- if (field->type() == FIELD_TYPE_BLOB)
+ if (field->type() == FIELD_TYPE_BLOB ||
+ field->type() == FIELD_TYPE_GEOMETRY)
key_part->key_part_flag|= HA_BLOB_PART;
else
key_part->key_part_flag|= HA_VAR_LENGTH_PART;
diff --git a/sql/table.h b/sql/table.h
index 08630a9c2a0..5842cc8b1c9 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -774,6 +774,8 @@ struct TABLE_LIST
private:
bool prep_check_option(THD *thd, uint8 check_opt_type);
bool prep_where(THD *thd, Item **conds, bool no_where_clause);
+ void print_index_hint(THD *thd, String *str, const char *hint,
+ uint32 hint_length, List<String>);
/*
Cleanup for re-execution in a prepared statement or a stored
procedure.
diff --git a/sql/udf_example.c b/sql/udf_example.c
index 0f28c2a14b0..df3a69755ad 100644
--- a/sql/udf_example.c
+++ b/sql/udf_example.c
@@ -1106,4 +1106,39 @@ char * is_const(UDF_INIT *initid, UDF_ARGS *args __attribute__((unused)),
}
+
+my_bool check_const_len_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
+{
+ if (args->arg_count != 1)
+ {
+ strmov(message, "CHECK_CONST_LEN accepts only one argument");
+ return 1;
+ }
+ if (args->args[0] == 0)
+ {
+ initid->ptr= (char*)"Not constant";
+ }
+ else if(strlen(args->args[0]) == args->lengths[0])
+ {
+ initid->ptr= (char*)"Correct length";
+ }
+ else
+ {
+ initid->ptr= (char*)"Wrong length";
+ }
+ initid->max_length = 100;
+ return 0;
+}
+
+char * check_const_len(UDF_INIT *initid, UDF_ARGS *args __attribute__((unused)),
+ char *result, unsigned long *length,
+ char *is_null, char *error __attribute__((unused)))
+{
+ strmov(result, initid->ptr);
+ *length= strlen(result);
+ *is_null= 0;
+ return result;
+}
+
+
#endif /* HAVE_DLOPEN */
diff --git a/sql/udf_example.def b/sql/udf_example.def
index 7a87147d7b6..3d569941cc8 100644
--- a/sql/udf_example.def
+++ b/sql/udf_example.def
@@ -23,3 +23,5 @@ EXPORTS
avgcost
is_const
is_const_init
+ check_const_len
+ check_const_len_init
diff --git a/sql/unireg.cc b/sql/unireg.cc
index d8e63bb78e1..9e6c77d7b62 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -394,7 +394,7 @@ static uint pack_keys(uchar *keybuff, uint key_count, KEY *keyinfo,
pos[6]=pos[7]=0; // For the future
pos+=8;
key_parts+=key->key_parts;
- DBUG_PRINT("loop", ("flags: %d key_parts: %d at 0x%lx",
+ DBUG_PRINT("loop", ("flags: %lu key_parts: %d at 0x%lx",
key->flags, key->key_parts,
(long) key->key_part));
for (key_part=key->key_part,key_part_end=key_part+key->key_parts ;
diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c
index 8bbbcac63e4..44b9951657d 100644
--- a/strings/ctype-big5.c
+++ b/strings/ctype-big5.c
@@ -6271,12 +6271,12 @@ my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t *pwc,const uchar *s,const uchar *e)
{
- int hi=s[0];
+ int hi;
if (s >= e)
return MY_CS_TOOSMALL;
- if (hi<0x80)
+ if ((hi= s[0]) < 0x80)
{
pwc[0]=hi;
return 1;
diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c
index abaa8f1a516..511a81f0cd4 100644
--- a/strings/ctype-euc_kr.c
+++ b/strings/ctype-euc_kr.c
@@ -179,20 +179,39 @@ static uchar NEAR sort_order_euc_kr[]=
/* Support for Korean(EUC_KR) characters, by powerm90@tinc.co.kr and mrpark@tinc.co.kr */
-#define iseuc_kr(c) ((0xa1<=(uchar)(c) && (uchar)(c)<=0xfe))
+/*
+ Unicode mapping is done according to:
+ ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/KSC/KSC5601.TXT
+
+ Valid multi-byte characters:
+
+ [A1..FE][41..5A,61..7A,81..FE]
+
+ Note, 0x5C is not a valid MB tail,
+ so escape_with_backslash_is_dangerous is not set.
+*/
+
+#define iseuc_kr_head(c) ((0xa1<=(uchar)(c) && (uchar)(c)<=0xfe))
+
+#define iseuc_kr_tail1(c) ((uchar) (c) >= 0x41 && (uchar) (c) <= 0x5A)
+#define iseuc_kr_tail2(c) ((uchar) (c) >= 0x61 && (uchar) (c) <= 0x7A)
+#define iseuc_kr_tail3(c) ((uchar) (c) >= 0x81 && (uchar) (c) <= 0xFE)
+#define iseuc_kr_tail(c) (iseuc_kr_tail1(c) || \
+ iseuc_kr_tail2(c) || \
+ iseuc_kr_tail3(c))
static int ismbchar_euc_kr(CHARSET_INFO *cs __attribute__((unused)),
const char* p, const char *e)
{
return ((*(uchar*)(p)<0x80)? 0:\
- iseuc_kr(*(p)) && (e)-(p)>1 && iseuc_kr(*((p)+1))? 2:\
+ iseuc_kr_head(*(p)) && (e)-(p)>1 && iseuc_kr_tail(*((p)+1))? 2:\
0);
}
static int mbcharlen_euc_kr(CHARSET_INFO *cs __attribute__((unused)),uint c)
{
- return (iseuc_kr(c) ? 2 : 1);
+ return (iseuc_kr_head(c) ? 2 : 1);
}
@@ -8613,12 +8632,12 @@ my_mb_wc_euc_kr(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e)
{
- int hi=s[0];
+ int hi;
if (s >= e)
return MY_CS_TOOSMALL;
- if (hi<0x80)
+ if ((hi= s[0]) < 0x80)
{
pwc[0]=hi;
return 1;
@@ -8653,7 +8672,7 @@ my_well_formed_len_euckr(CHARSET_INFO *cs __attribute__((unused)),
/* Single byte ascii character */
b++;
}
- else if (b < emb && iseuc_kr(*b) && iseuc_kr(b[1]))
+ else if (b < emb && iseuc_kr_head(*b) && iseuc_kr_tail(b[1]))
{
/* Double byte character */
b+= 2;
diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c
index 811394878d6..267299ace7f 100644
--- a/strings/ctype-gb2312.c
+++ b/strings/ctype-gb2312.c
@@ -5664,12 +5664,10 @@ my_mb_wc_gb2312(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e){
int hi;
- hi=(int) s[0];
-
if (s >= e)
return MY_CS_TOOSMALL;
- if (hi<0x80)
+ if ((hi= s[0]) < 0x80)
{
pwc[0]=hi;
return 1;
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index 8b1b0d6790d..99e02e02014 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -837,6 +837,7 @@ int my_long10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)),
register char *p, *e;
long int new_val;
uint sign=0;
+ unsigned long int uval = (unsigned long int) val;
e = p = &buffer[sizeof(buffer)-1];
*p= 0;
@@ -845,15 +846,16 @@ int my_long10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)),
{
if (val < 0)
{
- val= -val;
+ /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */
+ uval= (unsigned long int)0 - uval;
*dst++= '-';
len--;
sign= 1;
}
}
- new_val = (long) ((unsigned long int) val / 10);
- *--p = '0'+ (char) ((unsigned long int) val - (unsigned long) new_val * 10);
+ new_val = (long) (uval / 10);
+ *--p = '0'+ (char) (uval - (unsigned long) new_val * 10);
val = new_val;
while (val != 0)
@@ -876,12 +878,14 @@ int my_longlong10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)),
register char *p, *e;
long long_val;
uint sign= 0;
+ ulonglong uval = (ulonglong)val;
if (radix < 0)
{
if (val < 0)
{
- val = -val;
+ /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */
+ uval = (ulonglong)0 - uval;
*dst++= '-';
len--;
sign= 1;
@@ -891,22 +895,22 @@ int my_longlong10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)),
e = p = &buffer[sizeof(buffer)-1];
*p= 0;
- if (val == 0)
+ if (uval == 0)
{
*--p= '0';
len= 1;
goto cnv;
}
- while ((ulonglong) val > (ulonglong) LONG_MAX)
+ while (uval > (ulonglong) LONG_MAX)
{
- ulonglong quo=(ulonglong) val/(uint) 10;
- uint rem= (uint) (val- quo* (uint) 10);
+ ulonglong quo= uval/(uint) 10;
+ uint rem= (uint) (uval- quo* (uint) 10);
*--p = '0' + rem;
- val= quo;
+ uval= quo;
}
- long_val= (long) val;
+ long_val= (long) uval;
while (long_val != 0)
{
long quo= long_val/10;
@@ -1538,14 +1542,18 @@ my_strntoull10rnd_8bit(CHARSET_INFO *cs __attribute__((unused)),
}
else
addon= (*str >= '5');
- for ( ; str < end && (ch= (unsigned char) (*str - '0')) < 10; str++)
+ if (!dot)
{
- if (!dot)
- shift++;
+ for ( ; str < end && (ch= (unsigned char) (*str - '0')) < 10; shift++, str++);
+ if (str < end && *str == '.')
+ {
+ str++;
+ for ( ; str < end && (ch= (unsigned char) (*str - '0')) < 10; str++);
+ }
}
- if (str < end && *str == '.' && !dot)
+ else
{
- str++;
+ shift= dot - str;
for ( ; str < end && (ch= (unsigned char) (*str - '0')) < 10; str++);
}
goto exp;
diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c
index 6a7c7d7c0a0..fa00919692f 100644
--- a/strings/ctype-sjis.c
+++ b/strings/ctype-sjis.c
@@ -4526,12 +4526,12 @@ mb:
static int
my_mb_wc_sjis(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e){
- int hi=s[0];
+ int hi;
if (s >= e)
return MY_CS_TOOSMALL;
- if (hi < 0x80)
+ if ((hi= s[0]) < 0x80)
{
pwc[0]=hi;
return 1;
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index b5353c55e4c..97e5defdec1 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -1018,6 +1018,7 @@ int my_l10tostr_ucs2(CHARSET_INFO *cs,
register char *p, *db, *de;
long int new_val;
int sl=0;
+ unsigned long int uval = (unsigned long int) val;
p = &buffer[sizeof(buffer)-1];
*p='\0';
@@ -1027,12 +1028,13 @@ int my_l10tostr_ucs2(CHARSET_INFO *cs,
if (val < 0)
{
sl = 1;
- val = -val;
+ /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */
+ uval = (unsigned long int)0 - uval;
}
}
- new_val = (long) ((unsigned long int) val / 10);
- *--p = '0'+ (char) ((unsigned long int) val - (unsigned long) new_val * 10);
+ new_val = (long) (uval / 10);
+ *--p = '0'+ (char) (uval - (unsigned long) new_val * 10);
val = new_val;
while (val != 0)
@@ -1065,34 +1067,36 @@ int my_ll10tostr_ucs2(CHARSET_INFO *cs __attribute__((unused)),
register char *p, *db, *de;
long long_val;
int sl=0;
+ ulonglong uval= (ulonglong) val;
if (radix < 0)
{
if (val < 0)
{
sl=1;
- val = -val;
+ /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */
+ uval = (ulonglong)0 - uval;
}
}
p = &buffer[sizeof(buffer)-1];
*p='\0';
- if (val == 0)
+ if (uval == 0)
{
*--p='0';
goto cnv;
}
- while ((ulonglong) val > (ulonglong) LONG_MAX)
+ while (uval > (ulonglong) LONG_MAX)
{
- ulonglong quo=(ulonglong) val/(uint) 10;
- uint rem= (uint) (val- quo* (uint) 10);
+ ulonglong quo= uval/(uint) 10;
+ uint rem= (uint) (uval- quo* (uint) 10);
*--p = '0' + rem;
- val= quo;
+ uval= quo;
}
- long_val= (long) val;
+ long_val= (long) uval;
while (long_val != 0)
{
long quo= long_val/10;
diff --git a/strings/decimal.c b/strings/decimal.c
index f1f02f3a071..cbea0e340c6 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -2323,11 +2323,12 @@ static int do_div_mod(decimal_t *from1, decimal_t *from2,
}
if (unlikely(intg0+frac0 > to->len))
{
- stop1-=to->len-frac0-intg0;
+ stop1-=frac0+intg0-to->len;
frac0=to->len-intg0;
to->frac=frac0*DIG_PER_DEC1;
error=E_DEC_TRUNCATED;
}
+ DBUG_ASSERT(buf0 + (stop1 - start1) <= to->buf + to->len);
while (start1 < stop1)
*buf0++=*start1++;
}
diff --git a/strings/int2str.c b/strings/int2str.c
index 9fc53032819..fba98aac3f1 100644
--- a/strings/int2str.c
+++ b/strings/int2str.c
@@ -57,6 +57,7 @@ int2str(register long int val, register char *dst, register int radix,
register char *p;
long int new_val;
char *dig_vec= upcase ? _dig_vec_upper : _dig_vec_lower;
+ ulong uval= (ulong) val;
if (radix < 0)
{
@@ -65,7 +66,8 @@ int2str(register long int val, register char *dst, register int radix,
if (val < 0)
{
*dst++ = '-';
- val = -val;
+ /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */
+ uval = (ulong)0 - uval;
}
radix = -radix;
}
@@ -86,8 +88,8 @@ int2str(register long int val, register char *dst, register int radix,
*/
p = &buffer[sizeof(buffer)-1];
*p = '\0';
- new_val=(ulong) val / (ulong) radix;
- *--p = dig_vec[(uchar) ((ulong) val- (ulong) new_val*(ulong) radix)];
+ new_val= uval / (ulong) radix;
+ *--p = dig_vec[(uchar) (uval- (ulong) new_val*(ulong) radix)];
val = new_val;
#ifdef HAVE_LDIV
while (val != 0)
@@ -133,20 +135,22 @@ char *int10_to_str(long int val,char *dst,int radix)
char buffer[65];
register char *p;
long int new_val;
+ unsigned long int uval = (unsigned long int) val;
if (radix < 0) /* -10 */
{
if (val < 0)
{
*dst++ = '-';
- val = -val;
+ /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */
+ uval = (unsigned long int)0 - uval;
}
}
p = &buffer[sizeof(buffer)-1];
*p = '\0';
- new_val= (long) ((unsigned long int) val / 10);
- *--p = '0'+ (char) ((unsigned long int) val - (unsigned long) new_val * 10);
+ new_val= (long) (uval / 10);
+ *--p = '0'+ (char) (uval - (unsigned long) new_val * 10);
val = new_val;
while (val != 0)
diff --git a/strings/longlong2str.c b/strings/longlong2str.c
index c464abcfccd..d7de5bb0f7c 100644
--- a/strings/longlong2str.c
+++ b/strings/longlong2str.c
@@ -51,13 +51,15 @@ char *longlong2str(longlong val,char *dst,int radix)
char buffer[65];
register char *p;
long long_val;
+ ulonglong uval= (ulonglong) val;
if (radix < 0)
{
if (radix < -36 || radix > -2) return (char*) 0;
if (val < 0) {
*dst++ = '-';
- val = -val;
+ /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */
+ uval = (ulonglong)0 - uval;
}
radix = -radix;
}
@@ -65,7 +67,7 @@ char *longlong2str(longlong val,char *dst,int radix)
{
if (radix > 36 || radix < 2) return (char*) 0;
}
- if (val == 0)
+ if (uval == 0)
{
*dst++='0';
*dst='\0';
@@ -74,14 +76,14 @@ char *longlong2str(longlong val,char *dst,int radix)
p = &buffer[sizeof(buffer)-1];
*p = '\0';
- while ((ulonglong) val > (ulonglong) LONG_MAX)
+ while (uval > (ulonglong) LONG_MAX)
{
- ulonglong quo=(ulonglong) val/(uint) radix;
- uint rem= (uint) (val- quo* (uint) radix);
+ ulonglong quo= uval/(uint) radix;
+ uint rem= (uint) (uval- quo* (uint) radix);
*--p = _dig_vec_upper[rem];
- val= quo;
+ uval= quo;
}
- long_val= (long) val;
+ long_val= (long) uval;
while (long_val != 0)
{
long quo= long_val/radix;
@@ -100,17 +102,19 @@ char *longlong10_to_str(longlong val,char *dst,int radix)
char buffer[65];
register char *p;
long long_val;
+ ulonglong uval= (ulonglong) val;
if (radix < 0)
{
if (val < 0)
{
*dst++ = '-';
- val = -val;
+ /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */
+ uval = (ulonglong)0 - uval;
}
}
- if (val == 0)
+ if (uval == 0)
{
*dst++='0';
*dst='\0';
@@ -119,14 +123,14 @@ char *longlong10_to_str(longlong val,char *dst,int radix)
p = &buffer[sizeof(buffer)-1];
*p = '\0';
- while ((ulonglong) val > (ulonglong) LONG_MAX)
+ while (uval > (ulonglong) LONG_MAX)
{
- ulonglong quo=(ulonglong) val/(uint) 10;
- uint rem= (uint) (val- quo* (uint) 10);
+ ulonglong quo= uval/(uint) 10;
+ uint rem= (uint) (uval- quo* (uint) 10);
*--p = _dig_vec_upper[rem];
- val= quo;
+ uval= quo;
}
- long_val= (long) val;
+ long_val= (long) uval;
while (long_val != 0)
{
long quo= long_val/10;
diff --git a/support-files/MacOSX/ReadMe.txt b/support-files/MacOSX/ReadMe.txt
new file mode 100644
index 00000000000..485dbaeaa37
--- /dev/null
+++ b/support-files/MacOSX/ReadMe.txt
@@ -0,0 +1,8 @@
+
+You can find information about how to install on Mac OS X at
+
+ http://dev.mysql.com/doc/refman/5.0/en/mac-os-x-installation.html
+
+The MySQL Reference Manual is also available in various formats on
+http://dev.mysql.com/doc; if you're interested in the DocBook XML
+sources go to http://svn.mysql.com.
diff --git a/support-files/compiler_warnings.supp b/support-files/compiler_warnings.supp
index d6c4bcee52a..6c959daf754 100644
--- a/support-files/compiler_warnings.supp
+++ b/support-files/compiler_warnings.supp
@@ -38,6 +38,11 @@ db_vrfy.c : .*comparison is always false due to limited range of data type.*
dbm.c : .*'item.dsize' is used uninitialized in this function.*
#
+# readline is not maintained by us
+#
+.*/cmd-line-utils/readline/.* : .*
+
+#
# Ignore all conversion warnings on windows 64
# (Is safe as we are not yet supporting strings >= 2G)
#
@@ -74,6 +79,7 @@ mi_packrec.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 567
# Wrong compiler warnings
#
.* : .*no matching operator delete found; memory will not be freed if initialization throws an exception.*
+ctype-simple.c : .*unary minus operator applied to unsigned type, result still unsigned.*
#
# Viossl warnings - fixed in 5.1, disabled in 5.0. Too large to be changed
diff --git a/support-files/debian/README.debian b/support-files/debian/README.debian
deleted file mode 100644
index 9a990585854..00000000000
--- a/support-files/debian/README.debian
+++ /dev/null
@@ -1,47 +0,0 @@
-mysql for DEBIAN
-----------------------
-
-Comments regarding the Package
-
-* about patch files
- if you want to make new patch,
- write patch file and put it into debian/patches/.
- debian/rules do patch debian/patches/* automatically.
-
-* about server packages
- I use Debian alternative system, to switch next 3 type MySQL server.
-
- mysql-server :
- this is static linked MySQL server(/usr/sbin/mysqld-static) and share/mysql/ files.
- mysql-server-shared:
- this is dynamic linked MySQL server only. (/usr/sbin/mysqld-shared)
- mysql-server-debug:
- --with-debug flag. mysqld only. (/usr/sbin/mysqld-debug)
-
-* about MySQL-Max packages:
-
- mysql-max :
- this is static linked MySQL-Max server only. (/usr/sbin/mysqld-max-static).
- mysql-max-shared:
- this is dynamic linked MySQL server only. (/usr/sbin/mysqld-max-shared)
- mysql-max-debug:
- --with-debug flag. mysqld only. (/usr/sbin/mysqld-max-debug)
-
-* about charset
- I build MySQL server --with-extra-charsets=all
-
-* about location
- server programs ...... /usr/sbin/
- share files .......... /usr/share/mysql/
- client programs ...... /usr/bin/
- MySQL data directory . /var/mysql/data/
- benchmark directory .. /var/mysql/sql-bench/
- socket file ......... /tmp/mysql.sock
- include files ........ /usr/include/mysql/
- libraries ........... /usr/lib/ , /usr/lib/mysql/
- put libmysqlclient* into /usr/lib/ ,
- others, put /usr/lib/mysql/ .
-
-
-takeshi@SoftAgency.co.jp
-
diff --git a/support-files/debian/changelog b/support-files/debian/changelog
deleted file mode 100644
index e52589d7025..00000000000
--- a/support-files/debian/changelog
+++ /dev/null
@@ -1,543 +0,0 @@
-mysql (3.23.39-1) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Sat, 12 May 2001 05:07:35 +0900
-
-mysql (3.23.38-1potato) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Sat, 12 May 2001 05:07:35 +0900
-
-mysql (3.23.37-1potato.2) unstable; urgency=low
-
- * new
- * add mysql-max multi packages.
-
- -- takeshi <takeshi@softagency.co.jp> Thr, 26 Apr 2001 05:07:35 +0900
-
-mysql (3.23.37-1potato) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Thr, 26 Apr 2001 05:07:35 +0900
-
-mysql (3.23.36-1potato) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Thr, 29 Mar 2001 05:07:35 +0900
-
-mysql (3.23.35-1potato.1) unstable; urgency=low
-
- * sql fix patch
-
- -- takeshi <takeshi@softagency.co.jp> Thr, 22 Mar 2001 05:07:35 +0900
-
-mysql (3.23.35-1potato) unstable; urgency=low
-
- * new
- * --with-innobase
-
- -- takeshi <takeshi@softagency.co.jp> Sat, 17 Mar 2001 05:07:35 +0900
-
-mysql (3.23.34a-1potato) unstable; urgency=low
-
- * new
- * --with-innobase
-
- -- takeshi <takeshi@softagency.co.jp> Wed, 14 Mar 2001 05:07:35 +0900
-
-mysql (3.23.33-1potato) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Tue, 13 Feb 2001 05:07:35 +0900
-
-mysql (3.23.32-1potato) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Tue, 23 Jan 2001 05:07:35 +0900
-
-mysql (3.23.31-1potato) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Fri, 19 Jan 2001 05:07:35 +0900
-
-mysql (3.23.30-gamma-1potato) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Sat, 6 Jan 2001 05:07:35 +0900
-
-mysql (3.23.29a-gamma-1potato.3) unstable; urgency=low
-
- * server:/usr/sbin/{mysql_config, mysqltest} -> client:/usr/bin/
- * server:/usr/bin/my_print_defaults -> client:/usr/bin/
- * /usr/mysql-test -> mysql-bench /var/mysql/mysql-test
-
- -- takeshi <takeshi@softagency.co.jp> Fri, 29 Dec 2000 05:07:35 +0900
-
-mysql (3.23.29a-gamma-1potato.2) unstable; urgency=low
-
- * /usr/mysql-test -> mysql-bench /var/mysql/mysql-test
-
- -- takeshi <takeshi@softagency.co.jp> Sun, 17 Dec 2000 05:07:35 +0900
-
-mysql (3.23.29a-gamma-1potato) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Sun, 17 Dec 2000 05:07:35 +0900
-
-mysql (3.23.28-gamma-1potato) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Fri, 24 Nov 2000 05:07:35 +0900
-
-mysql (3.23.27-beta-1potato) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Fri, 28 Oct 2000 05:07:35 +0900
-
-mysql (3.23.26-beta-1potato) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Sun, 22 Oct 2000 05:07:35 +0900
-
-mysql (3.23.25-beta-1potato) unstable; urgency=low
-
- * new , libmysqlclient10
- * change debian/control file. remove Provides keyword
-
- -- takeshi <takeshi@softagency.co.jp> Fri, 29 Sep 2000 05:07:35 +0900
-
-mysql (3.23.24-1potato.2) unstable; urgency=low
-
- * fix debian/control file
- * move patch into debian/patches/
- if you want to make new patch,
- write patch file and put it into debian/patches/.
- debian/rules do patch debian/patches/* automatically.
- * change debian/rules , debian/move
- * back mysql_resolveip -> resolveip , mysql_perror -> perror
-
- -- takeshi <takeshi@softagency.co.jp> Thr, 14 Sep 2000 05:07:35 +0900
-
-mysql (3.23.24-1potato) unstable; urgency=low
-
- * move patch into debian/patches/
- if you want to make new patch,
- write patch file and put it into debian/patches/.
- debian/rules do patch debian/patches/* automatically.
- * change debian/rules , debian/move
- * back mysql_resolveip -> resolveip , mysql_perror -> perror
-
- -- takeshi <takeshi@softagency.co.jp> Sat, 9 Sep 2000 05:07:35 +0900
-
-mysql (3.23.23-1potato) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Sat, 2 Sep 2000 05:07:35 +0900
-
-mysql (3.23.22-1potato) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Tue, 1 Aug 2000 05:07:35 +0900
-
-mysql (3.23.21-1potato.2) unstable; urgency=low
-
- * MYI patch
- * /usr/lib/mysql/libmysqlclient.a -> /usr/lib/
- * libmysqlclient patch
- * fix mysql-dev conflicts libmysqlclient6
-
- -- takeshi <takeshi@softagency.co.jp> Sun, 30 Jul 2000 05:07:35 +0900
-
-mysql (3.23.21-1potato.1) unstable; urgency=low
-
- * MYI patch
- * /usr/lib/mysql/libmysqlclient.a -> /usr/lib/
-
- -- takeshi <takeshi@softagency.co.jp> Tue, 25 Jul 2000 05:07:35 +0900
-
-mysql (3.23.21-1potato) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Thr, 6 Jul 2000 05:07:35 +0900
-
-mysql (3.23.20-1potato) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Thr, 29 Jun 2000 05:07:35 +0900
-
-mysql (3.23.19-1potato) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Thr, 29 Jun 2000 05:07:35 +0900
-
-mysql (3.23.18-1) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Tue, 13 May 2000 05:07:35 +0900
-
-mysql (3.23.17-1) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Wed, 31 May 2000 05:07:35 +0900
-
-mysql (3.23.16-1) unstable; urgency=low
-
- * new
- * branch static mysqld & shared mysqld
- * no need ujis,sjis branch. 3.23 support dynamic charset
- * add conf file /etc/my.cnf
-
- -- takeshi <takeshi@softagency.co.jp> Wed, 31 May 2000 05:07:35 +0900
-
-mysql (3.22.32-2) unstable; urgency=low
-
- * fix mysqldump
- * fix sjis
-
- -- takeshi <takeshi@softagency.co.jp> Thr, 6 Apr 2000 05:07:35 +0900
-
-mysql (3.22.32-1) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Tue, 15 Feb 2000 05:07:35 +0900
-
-mysql (3.22.30-2) unstable; urgency=low
-
- * fix perl path
- * with system readline
-
- -- takeshi <takeshi@softagency.co.jp> Tue, 8 Feb 2000 05:07:35 +0900
-
-mysql (3.22.30-1) unstable; urgency=low
-
- * new
- * OOP! debian remove libreadlineg2-dev!
- --without-readline => --with-readline
-
- -- takeshi <takeshi@softagency.co.jp> Fri, 14 Jan 2000 05:07:35 +0900
-
-mysql (3.22.29-1) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Mon, 3 Jan 2000 05:07:35 +0900
-
-mysql (3.22.29-0bo) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Mon, 3 Jan 2000 05:07:35 +0900
-
-mysql (3.22.27-0bo.2) unstable; urgency=low
-
- * with linuxthread-0.71
-
- -- takeshi <takeshi@softagency.co.jp> Thr, 9 Dec 1999 05:07:35 +0900
-
-mysql (3.22.27-0bo.1) unstable; urgency=low
-
- * fix: mysqlaccess incorrect path
-
- -- takeshi <takeshi@softagency.co.jp> Sat, 13 Nov 1999 05:07:35 +0900
-
-mysql (3.22.27-0bo) unstable; urgency=low
-
- * sql/sql_parse.cc patch
-
- -- takeshi <takeshi@softagency.co.jp> Wed, 13 Oct 1999 05:07:35 +0900
-
-mysql (3.22.26a-0bo.1) unstable; urgency=low
-
- * BLOB SELECT DISTINCT patch
- * all static linked
- * fix: @sbindir@ was not changed
- * mysql_find_rows -> /usr/bin/
-
- -- takeshi <takeshi@softagency.co.jp> Mon, 20 Sep 1999 05:07:35 +0900
-
-mysql (3.22.26a-0bo) unstable; urgency=low
-
- * new upstream
- * fix incorrect path: init.d/mysql (= mysql.server.sh), msql2mysql, mysql_install_db
- * change daemon user -> mysql
-
- -- takeshi <takeshi@softagency.co.jp> Mon, 13 Sep 1999 05:07:35 +0900
-
-mysql (3.22.25-0bo) unstable; urgency=low
-
- * new
- * change : libmysql6 -> libmysqlclient6
-
- -- takeshi <takeshi@softagency.co.jp> Tue, 3 Aug 1999 05:07:35 +0900
-
-mysql (3.22.24-0bo) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Mon, 25 Jul 1999 05:07:35 +0900
-
-mysql (3.22.23b-0bo.1) unstable; urgency=low
-
- * new
- * gcc patch + sql_load patch
-
- -- takeshi <takeshi@softagency.co.jp> Thr, 24 Jun 1999 05:07:35 +0900
-
-mysql (3.22.23b-0bo) unstable; urgency=low
-
- * new
- * gcc patch
-
- -- takeshi <takeshi@softagency.co.jp> Tue, 15 Jun 1999 05:07:35 +0900
-
-mysql (3.22.22-0bo) unstable; urgency=low
-
- * new
-
- -- takeshi <takeshi@softagency.co.jp> Mon, 3 May 1999 05:07:35 +0900
-
-mysql (3.22.21-0bo.1) unstable; urgency=low
-
- * re-compile
-
- -- takeshi <takeshi@softagency.co.jp> Fri, 30 Apr 1999 05:07:35 +0900
-
-mysql (3.22.21-0bo) unstable; urgency=low
-
- * New up stream
-
- -- takeshi <takeshi@softagency.co.jp> Tue, 6 Apr 1999 05:07:35 +0900
-
-mysql (3.22.20a-0bo) unstable; urgency=low
-
- * New up stream
-
- -- takeshi <takeshi@softagency.co.jp> Fri, 19 Mar 1999 05:07:35 +0900
-
-mysql (3.22.19a-0bo) unstable; urgency=low
-
- * New up stream
-
- -- takeshi <takeshi@softagency.co.jp> Wed, 3 Mar 1999 05:07:35 +0900
-
-mysql (3.22.18-0bo) unstable; urgency=low
-
- * New up stream
-
- -- takeshi <takeshi@softagency.co.jp> Sun, 28 Feb 1999 05:07:35 +0900
-
-mysql (3.22.16a-gamma-0bo.1) unstable; urgency=low
-
- * fix libmysqlclient5 -> libmysqlclient6
-
- -- takeshi <takeshi@softagency.co.jp> Thr, 11 Feb 1999 05:07:35 +0900
-
-mysql (3.22.16a-gamma-0bo) unstable; urgency=low
-
- * new upstream
-
- -- takeshi <takeshi@softagency.co.jp> Sun, 7 Feb 1999 05:07:35 +0900
-
-mysql (3.22.15-gamma-0bo) unstable; urgency=low
-
- * new upstream
-
- -- takeshi <takeshi@softagency.co.jp> Fri, 29 Jan 1999 05:07:35 +0900
-
-mysql (3.22.14b-gamma-0bo) unstable; urgency=low
-
- * new upstream
- * apply mb problem patch
-
- -- takeshi <takeshi@softagency.co.jp> Tue, 26 Jan 1999 05:07:35 +0900
-
-mysql (3.22.14-gamma-0bo.1) unstable; urgency=low
-
- * egcs -all-static
-
- -- takeshi <takeshi@softagency.co.jp> Sun, 3 Jan 1999 05:07:35 +0900
-
-mysql (3.22.14-gamma-0bo) unstable; urgency=low
-
- * New upstream
-
- -- takeshi <takeshi@softagency.co.jp> Sun, 3 Jan 1999 05:07:35 +0900
-
-mysql (3.22.13-beta-0bo) unstable; urgency=low
-
- * New upstream
-
- -- takeshi <takeshi@softagency.co.jp> Fri, 11 Nov 1998 00:29:14 +0900
-
-mysql (3.22.12-beta-0bo) unstable; urgency=low
-
- * New upstream
-
- -- takeshi <takeshi@softagency.co.jp> Fri, 11 Nov 1998 00:29:14 +0900
-
-mysql (3.22.11-beta-0bo) unstable; urgency=low
-
- * New upstream
- * !!! CHANGE PACKAGE NAME !!!
- libmysql5 <- only libmysqlclinet.so.5
- mysql-client <- client commands
- mysql-server <- server
- mysql-dev <- .h & .a
- mysql-doc <- Docs
- mysql-bench <- benchmark suite.
-
- -- takeshi <takeshi@softagency.co.jp> Wed, 25 Nov 1998 15:03:45 +0900
-
-mysql (3.22.10-beta-0bo.2) unstable; urgency=low
-
- * fix debian/rules , debian/*.dirs
- * gcc-2.7.2.3, g++-2.7.2.1 compiled
- * remove /usr/bin/mysql-sub/
- * rename /usr/bin/mysql-sub/replace -> /usr/bin/mysql_replace
- * mv mysql-base:/usr/bin/mysql-sub/{perror,resolveip} -> mysql-server:/usr/bin/
- perror -> mysql_perror
- resolveip-> mysql_resolveip
- * mv add_*, make_binary_distribution -> /usr/share/mysql/
- * add japanese errmsg (/usr/share/mysql/japanese)
-
- -- takeshi <takeshi@softagency.co.jp> Fri, 13 Nov 1998 15:03:45 +0900
-
-mysql (3.22.10-beta-0bo.1) unstable; urgency=low
-
- * fix debian/rules
- * egcs compiled
- * link libstdc++2.8.a (mysqld), so, you don't need libstdc++2.8 for running mysqld.
- (not client programs.)
-
- -- takeshi <takeshi@softagency.co.jp> Wed, 11 Nov 1998 15:03:45 +0900
-
-mysql (3.22.10-beta-0bo) unstable; urgency=low
-
- * New upstream
- * egcs compiled
- * fix: mysql-base-{char}/usr/bin/comp_err -> mysql-server-{char}/usr/sbin/comp_err
-
- -- takeshi <takeshi@softagency.co.jp> Thr, 5 Nov 1998 15:03:45 +0900
-
-mysql (3.22.9-beta-0bo.1) unstable; urgency=low
-
- * new patch to sql_string.cc ('%' bug)
-
- -- takeshi <takeshi@softagency.co.jp> Tue, 27 Oct 1998 15:03:45 +0900
-
-mysql (3.22.9-beta-0bo) unstable; urgency=low
-
- * fix cflags
- * fix diff files
- * fix & change categorize of client or server
- mysql-server:
- /usr/sbin/mysql_install_db
- safe_mysqld mysqld
- isamchk isamlog
-
- mysql-base:
- /usr/bin/
- comp_err msql2mysql mysql mysql_zap
- mysqlaccess mysqladmin mysqlbug
- mysqldump mysqlimport mysqlshow
-
- /usr/bin/mysql-sub/
- add_file_priv add_func_table
- add_long_password make_binary_distribution
- perror replace resolveip
-
- * patch to sql_string.cc ('%' bug)
-
- -- takeshi <takeshi@softagency.co.jp> Wed, 7 Oct 1998 15:03:45 +0900
-
-mysql (3.22.8-beta-0bo) unstable; urgency=low
-
- * New up stream
-
- -- takeshi <takeshi@softagency.co.jp> Wed, 7 Oct 1998 15:03:45 +0900
-
-mysql (3.22.7b-0bo.1) unstable; urgency=low
-
- * left join patch
-
- -- takeshi <takeshi@softagency.co.jp> Thr, 24 Sep 1998 15:03:45 +0900
-
-mysql (3.22.7b-0bo) unstable; urgency=low
-
- * New upstream version (bo)
- * mb patch
- * *.a -> /usr/lib/mysql/
- * add_file_priv add_func_table make_binary_distribution
- add_long_password perror replace resolveip
- -> /usr/bin/mysql-sub/
- * mysqld, safe_mysqld, mysql_install_db -> mysql-server /usr/sbin/
- * add '-lm -lz -ldl' when building libmysqlclient.so.4.0.0
-
- -- takeshi <takeshi@softagency.co.jp> Sat, 15 Aug 1998 15:03:45 +0900
-
-mysql (3.22.4a-0bo) unstable; urgency=low
-
- * New upstream version (bo)
- * use system libreadline
-
- -- takeshi <takeshi@softagency.co.jp> Sat, 15 Aug 1998 15:03:45 +0900
-
-mysql (3.21.33-0bo) unstable; urgency=low
-
- * New upstream version
-
- -- takeshi <takeshi@softagency.co.jp> Wed, 22 Jul 1998 12:51:45 +0900
-
-mysql (3.21.30-1) unstable; urgency=low
-
- * New upstream version
- * fix conffile setting
-
- -- takeshi <takeshi@softagency.co.jp> Tue, 12 May 1998 20:24:45 +0900
-
-mysql (3.21.29.gamma-2) unstable; urgency=low
-
- * charset=ujis,sjis packages
- * branch mysql-base-* (lib*.so)
- * /usr/local/mysql/lib/mysql/lib* -> /usr/lib/
- * /usr/local/mysql/include -> /usr/include
- * /usr/local/mysql/info -> /usr/info
- * /usr/local/mysql/man -> /usr/man
- * /usr/local/mysql/share -> /usr/share
- * /usr/local/mysql/bin -> /usr/bin
- * /usr/local/mysql/libexec -> /usr/sbin
- * /usr/local/mysql/var -> /var/mysql/data
- * /usr/local/mysql/sql-bench -> /var/mysql/sql-bench
-
- -- takeshi <takeshi@softagency.co.jp> Fri, 8 May 1998 00:04:45 +0900
-
-mysql (3.21.29.gamma-1) unstable; urgency=low
-
- * Initial Release.
-
- -- takeshi <takeshi@softagency.co.jp> Sat, 2 May 1998 03:42:24 +0900
-
-Local variables:
-mode: debian-changelog
-add-log-mailing-address: "takeshi@softagency.co.jp"
-End:
diff --git a/support-files/debian/control b/support-files/debian/control
deleted file mode 100644
index 3ccc1d097c8..00000000000
--- a/support-files/debian/control
+++ /dev/null
@@ -1,112 +0,0 @@
-Source: mysql
-Section: devel
-Priority: extra
-Maintainer: takeshi <takeshi@softagency.co.jp>
-Standards-Version: 2.1.2.2
-
-Package: mysql
-Architecture: all
-Description: mysql
- Missing
-
-Package: mysql-doc
-Architecture: all
-Section: doc
-Priority: extra
-Replaces: mysql-gpl-doc
-Description: mysql Documentation (html)
- MySQL Doc.
-
-Package: libmysqlclient10
-Architecture: any
-Section: libs
-Priority: extra
-Description: libmysqlclient.so.10
- libmysqlclient.so.10
-
-Package: mysql-client
-Architecture: any
-Depends: ${shlibs:Depends}
-Section: misc
-Priority: extra
-Conflicts: mysql-client-ujis, mysql-client-sjis
-Replaces: mysql-gpl-client, mysql-base (<< 3.22.11), mysql-base-ujis (<< 3.22.11), mysql-base-sjis (<< 3.22.11), mysql-client-ujis, mysql-client-sjis
-Description: mysql clients.
- MySQL clients programs.
-
-Package: mysql-server
-Architecture: any
-Section: misc
-Priority: extra
-Depends: ${shlibs:Depends}
-Conflicts: mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
-Replaces: mysql-server-sjis, mysql-base (<< 3.22.11), mysql-base-ujis (<< 3.22.11), mysql-base-sjis (<< 3.22.11), mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0), mysql-common
-Description: MySQL server (static linked)
- MySQL server. static linked.
-
-Package: mysql-server-shared
-Architecture: any
-Section: misc
-Priority: extra
-Depends: mysql-server, ${shlibs:Depends}
-Conflicts: mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
-Replaces: mysql-server-sjis, mysql-base (<< 3.22.11), mysql-base-ujis (<< 3.22.11), mysql-base-sjis (<< 3.22.11), mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
-Description: MySQL server (dynamic linked)
- MySQL server. dynamic linked.
-
-Package: mysql-server-debug
-Architecture: any
-Section: misc
-Priority: extra
-Depends: mysql-server, ${shlibs:Depends}
-Conflicts: mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
-Replaces: mysql-server-sjis, mysql-base (<< 3.22.11), mysql-base-ujis (<< 3.22.11), mysql-base-sjis (<< 3.22.11), mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
-Description: MySQL server debug
- MySQL server. debug
-
-Package: mysql-max
-Architecture: any
-Section: misc
-Priority: extra
-Depends: mysql-server
-Conflicts: mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
-Replaces: mysql-server-sjis, mysql-base (<< 3.22.11), mysql-base-ujis (<< 3.22.11), mysql-base-sjis (<< 3.22.11), mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
-Description: MySQL-MAX server (static linked)
- MySQL-Max server. (static linked)
-
-Package: mysql-max-shared
-Architecture: any
-Section: misc
-Priority: extra
-Depends: mysql-server, ${shlibs:Depends}
-Conflicts: mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
-Replaces: mysql-server-sjis, mysql-base (<< 3.22.11), mysql-base-ujis (<< 3.22.11), mysql-base-sjis (<< 3.22.11), mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
-Description: MySQL-MAX server (shared linked)
- MySQL-Max server. (shared linked)
-
-Package: mysql-max-debug
-Architecture: any
-Section: misc
-Priority: extra
-Depends: mysql-server, ${shlibs:Depends}
-Conflicts: mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
-Replaces: mysql-server-sjis, mysql-base (<< 3.22.11), mysql-base-ujis (<< 3.22.11), mysql-base-sjis (<< 3.22.11), mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
-Description: MySQL-MAX server (with debug shared linked)
- MySQL-Max server. (with debug and shared linked)
-
-Package: mysql-dev
-Architecture: any
-Section: devel
-Priority: extra
-Depends: ${shlibs:Depends}
-Conflicts: mysql-dev-sjis, mysql-dev-ujis
-Replaces: mysql-devel, libmysqlclient10-dev, libmysqlclient9-dev, libmysqlclient6-dev, mysql-gpl-dev, mysql-dev-sjis, mysql-dev-ujis, libmysqlclient6-ujis, libmysqlclient6-sjis
-Description: MySQL develop suite
- MySQL develop.
-
-Package: mysql-bench
-Architecture: all
-Section: misc
-Priority: extra
-Description: mysql benchmark suite.
- MySQL sql-bench files.
diff --git a/support-files/debian/copyright b/support-files/debian/copyright
deleted file mode 100644
index 3e97dbf8358..00000000000
--- a/support-files/debian/copyright
+++ /dev/null
@@ -1,8 +0,0 @@
-This package was debianized by takeshi@softagency.co.jp on
-Sat, 2 May 1998 03:42:24 +0900.
-
-It was downloaded from
-http://www.mysql.com/
-
-Copyright:
-GPL
diff --git a/support-files/debian/gomi b/support-files/debian/gomi
deleted file mode 100644
index 70251058af0..00000000000
--- a/support-files/debian/gomi
+++ /dev/null
@@ -1,24 +0,0 @@
-Docs/Makefile
-dbug/Makefile
-extra/Makefile
-heap/Makefile
-mysys/Makefile
-readline/Makefile
-regex/Makefile
-sql/Makefile
-sql/share/Makefile
-strings/Makefile
-support-files/binary-configure
-support-files/my-example.cnf
-support-files/mysql-log-rotate
-scripts/add_func_table
-scripts/mysql_setpermisson
-scripts/mysqlbug
-scripts/mysqlhotcopy
-client/my_static.h
-client/mysys_priv.h
-include/my_config.h
-sql/lex_hash.h
-sql-bench/Makefile
-scripts/mysql_config
-libmysql_r/Makefile
diff --git a/support-files/debian/libmysqlclient10.dirs b/support-files/debian/libmysqlclient10.dirs
deleted file mode 100644
index 68457717bd8..00000000000
--- a/support-files/debian/libmysqlclient10.dirs
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib
diff --git a/support-files/debian/libmysqlclient10.postinst b/support-files/debian/libmysqlclient10.postinst
deleted file mode 100644
index 2d1871b1df6..00000000000
--- a/support-files/debian/libmysqlclient10.postinst
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-ldconfig
diff --git a/support-files/debian/libmysqlclient9.dirs b/support-files/debian/libmysqlclient9.dirs
deleted file mode 100644
index 68457717bd8..00000000000
--- a/support-files/debian/libmysqlclient9.dirs
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib
diff --git a/support-files/debian/libmysqlclient9.postinst b/support-files/debian/libmysqlclient9.postinst
deleted file mode 100644
index 2d1871b1df6..00000000000
--- a/support-files/debian/libmysqlclient9.postinst
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-ldconfig
diff --git a/support-files/debian/move b/support-files/debian/move
deleted file mode 100644
index 36f250fcfb3..00000000000
--- a/support-files/debian/move
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/bin/sh
-
-STAMPFILE="debian/stamp-move"
-
-if [ -e $STAMPFILE ]; then
- exit
-fi
-
-#----------
-CLIENT1="msql2mysql mysql mysql_convert_table_format mysql_find_rows mysql_fix_privilege_tables mysql_setpermission mysql_zap mysqlaccess mysqladmin mysqlbug mysqldump mysqlhotcopy mysqlimport mysqlshow mysql_config mysqltest my_print_defaults"
-
-# CLIENT2="add_file_priv add_func_table add_long_password make_binary_distribution"
-
-
-
-P=`pwd`
-
-#----------
-for CHAR in build
-do
- #-----
- cp -Rpd debian/${CHAR}/usr debian/mysql-server/
- cp -Rpd debian/${CHAR}-shared/usr/lib/mysql/libmysqlclient.so.* debian/libmysqlclient10/usr/lib/
-
- #----- mysql-server-shared ---
- cp -Rpd debian/${CHAR}-shared/usr/sbin/mysqld debian/mysql-server-shared/usr/sbin/mysqld-shared
-
- #----- mysql-server-debug ---
- cp -Rpd debian/${CHAR}-debug/usr/sbin/mysqld debian/mysql-server-debug/usr/sbin/mysqld-debug
-
- #----- mysql-server ---
- mv debian/mysql-server/usr/sbin/mysqld debian/mysql-server/usr/sbin/mysqld-static
-
- #----- mysql-max-shared ---
- cp -Rpd debian/${CHAR}-max-shared/usr/sbin/mysqld debian/mysql-max-shared/usr/sbin/mysqld-max-shared
-
- #----- mysql-max-debug ---
- cp -Rpd debian/${CHAR}-max-debug/usr/sbin/mysqld debian/mysql-max-debug/usr/sbin/mysqld-max-debug
-
- #----- mysql-max ---
- mv debian/${CHAR}-max/usr/sbin/mysqld debian/mysql-max/usr/sbin/mysqld-max-static
-
- #----- mysql-client ----
- cd ${P}/debian/mysql-server/usr/bin/ && mv $CLIENT1 ../../../mysql-client/usr/bin/
- cd ${P}
-
- mv -f debian/mysql-server/usr/{man,info} debian/mysql-client/usr/share/
-# mv debian/mysql-server/usr/share/mysql/my-*.cnf debian/mysql-client/usr/share/mysql/
- mv -f debian/mysql-server/usr/bin/replace debian/mysql-client/usr/bin/mysql_replace
-
- #----- mysql-server ---
- mv debian/mysql-server/usr/bin/* debian/mysql-server/usr/sbin/
- mv debian/mysql-server/usr/sbin/comp_err debian/mysql-server/usr/bin/
- mv debian/mysql-server/usr/sbin/perror debian/mysql-server/usr/bin/
- mv debian/mysql-server/usr/sbin/resolveip debian/mysql-server/usr/bin/
-
- #----- mysql-dev ----
- cp -Rpd debian/${CHAR}-shared/usr/lib/mysql/libmysqlclient.so debian/mysql-dev/usr/lib/
- mv debian/mysql-server/usr/include debian/mysql-dev/usr/
- mv debian/mysql-server/usr/lib/mysql debian/mysql-dev/usr/lib/
-
- mv debian/mysql-dev/usr/lib/mysql/libmysqlclient.a debian/mysql-dev/usr/lib/
- (cd debian/mysql-dev/usr/lib/mysql ; ln -sf "../libmysqlclient.a" )
-
- #-----
- cp debian/README.debian debian/copyright debian/changelog \
- debian/mysql-client/usr/share/doc/mysql/
-
-done
-
-
-####################
-### doc
-cp -r COPYING* MIRRORS README* Docs/* debian/mysql-doc/usr/share/doc/mysql/
-
-#### sql-bench
-mv debian/mysql-server/usr/sql-bench \
- debian/mysql-server/usr/mysql-test \
- debian/mysql-bench/var/mysql/
-
-touch $STAMPFILE
diff --git a/support-files/debian/my.cnf b/support-files/debian/my.cnf
deleted file mode 100644
index 0c9856ec5a7..00000000000
--- a/support-files/debian/my.cnf
+++ /dev/null
@@ -1,42 +0,0 @@
-# Example mysql config file.
-# You can copy this to one of:
-# /etc/my.cnf to set global options,
-# mysql-data-dir/my.cnf to set server-specific options (in this
-# installation this directory is @localstatedir@) or
-# ~/.my.cnf to set user-specific options.
-#
-# One can use all long options that the program supports.
-# Run the program with --help to get a list of available options
-
-# This will be passed to all mysql clients
-[client]
-#password = my_password
-#port = 3306
-#socket = /tmp/mysql.sock
-
-# Here is entries for some specific programs
-# The following values assume you have at least 32M ram
-
-# The MySQL server
-[mysqld]
-default-character-set = ujis
-#port = 3306
-#socket = /tmp/mysql.sock
-#skip-locking
-#set-variable = key_buffer=16M
-#set-variable = max_allowed_packet=1M
-#set-variable = thread_stack=128K
-## Start logging
-#log
-
-[mysqldump]
-default-character-set = ujis
-#quick
-#set-variable = max_allowed_packet=16M
-
-[mysql]
-default-character-set = ujis
-#no-auto-rehash
-
-[isamchk]
-#set-variable = key_buffer=16M
diff --git a/support-files/debian/mysql-bench.dirs b/support-files/debian/mysql-bench.dirs
deleted file mode 100644
index 0ba3faa84f9..00000000000
--- a/support-files/debian/mysql-bench.dirs
+++ /dev/null
@@ -1 +0,0 @@
-var/mysql
diff --git a/support-files/debian/mysql-client.dirs b/support-files/debian/mysql-client.dirs
deleted file mode 100644
index 0ade9d76f65..00000000000
--- a/support-files/debian/mysql-client.dirs
+++ /dev/null
@@ -1,3 +0,0 @@
-usr/bin
-usr/share/mysql
-usr/share/doc/mysql
diff --git a/support-files/debian/mysql-dev.dirs b/support-files/debian/mysql-dev.dirs
deleted file mode 100644
index 68457717bd8..00000000000
--- a/support-files/debian/mysql-dev.dirs
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib
diff --git a/support-files/debian/mysql-doc.dirs b/support-files/debian/mysql-doc.dirs
deleted file mode 100644
index b8aa0f769f9..00000000000
--- a/support-files/debian/mysql-doc.dirs
+++ /dev/null
@@ -1 +0,0 @@
-usr/share/doc/mysql
diff --git a/support-files/debian/mysql-max-debug.dirs b/support-files/debian/mysql-max-debug.dirs
deleted file mode 100644
index 236670a2d0f..00000000000
--- a/support-files/debian/mysql-max-debug.dirs
+++ /dev/null
@@ -1 +0,0 @@
-usr/sbin
diff --git a/support-files/debian/mysql-max-debug.postinst b/support-files/debian/mysql-max-debug.postinst
deleted file mode 100644
index e9d8b628c2e..00000000000
--- a/support-files/debian/mysql-max-debug.postinst
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-update-alternatives --install /usr/sbin/mysqld mysqld /usr/sbin/mysqld-max-debug 40
diff --git a/support-files/debian/mysql-max-debug.postrm b/support-files/debian/mysql-max-debug.postrm
deleted file mode 100644
index 25c7aadf494..00000000000
--- a/support-files/debian/mysql-max-debug.postrm
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-update-alternatives --auto mysqld
diff --git a/support-files/debian/mysql-max-shared.dirs b/support-files/debian/mysql-max-shared.dirs
deleted file mode 100644
index 236670a2d0f..00000000000
--- a/support-files/debian/mysql-max-shared.dirs
+++ /dev/null
@@ -1 +0,0 @@
-usr/sbin
diff --git a/support-files/debian/mysql-max-shared.postinst b/support-files/debian/mysql-max-shared.postinst
deleted file mode 100644
index d47d85c73eb..00000000000
--- a/support-files/debian/mysql-max-shared.postinst
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-update-alternatives --install /usr/sbin/mysqld mysqld /usr/sbin/mysqld-max-shared 35
diff --git a/support-files/debian/mysql-max-shared.postrm b/support-files/debian/mysql-max-shared.postrm
deleted file mode 100644
index 25c7aadf494..00000000000
--- a/support-files/debian/mysql-max-shared.postrm
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-update-alternatives --auto mysqld
diff --git a/support-files/debian/mysql-max.dirs b/support-files/debian/mysql-max.dirs
deleted file mode 100644
index 236670a2d0f..00000000000
--- a/support-files/debian/mysql-max.dirs
+++ /dev/null
@@ -1 +0,0 @@
-usr/sbin
diff --git a/support-files/debian/mysql-max.postinst b/support-files/debian/mysql-max.postinst
deleted file mode 100644
index a65ccd5b6c7..00000000000
--- a/support-files/debian/mysql-max.postinst
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-update-alternatives --install /usr/sbin/mysqld mysqld /usr/sbin/mysqld-max-static 30
diff --git a/support-files/debian/mysql-max.postrm b/support-files/debian/mysql-max.postrm
deleted file mode 100644
index 25c7aadf494..00000000000
--- a/support-files/debian/mysql-max.postrm
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-update-alternatives --auto mysqld
diff --git a/support-files/debian/mysql-server-debug.dirs b/support-files/debian/mysql-server-debug.dirs
deleted file mode 100644
index 236670a2d0f..00000000000
--- a/support-files/debian/mysql-server-debug.dirs
+++ /dev/null
@@ -1 +0,0 @@
-usr/sbin
diff --git a/support-files/debian/mysql-server-debug.postinst b/support-files/debian/mysql-server-debug.postinst
deleted file mode 100644
index d48c21be9a7..00000000000
--- a/support-files/debian/mysql-server-debug.postinst
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-update-alternatives --install /usr/sbin/mysqld mysqld /usr/sbin/mysqld-debug 20
diff --git a/support-files/debian/mysql-server-debug.postrm b/support-files/debian/mysql-server-debug.postrm
deleted file mode 100644
index 25c7aadf494..00000000000
--- a/support-files/debian/mysql-server-debug.postrm
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-update-alternatives --auto mysqld
diff --git a/support-files/debian/mysql-server-shared.dirs b/support-files/debian/mysql-server-shared.dirs
deleted file mode 100644
index 236670a2d0f..00000000000
--- a/support-files/debian/mysql-server-shared.dirs
+++ /dev/null
@@ -1 +0,0 @@
-usr/sbin
diff --git a/support-files/debian/mysql-server-shared.postinst b/support-files/debian/mysql-server-shared.postinst
deleted file mode 100644
index 00c7248327a..00000000000
--- a/support-files/debian/mysql-server-shared.postinst
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-update-alternatives --install /usr/sbin/mysqld mysqld /usr/sbin/mysqld-shared 15
diff --git a/support-files/debian/mysql-server-shared.postrm b/support-files/debian/mysql-server-shared.postrm
deleted file mode 100644
index 25c7aadf494..00000000000
--- a/support-files/debian/mysql-server-shared.postrm
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-update-alternatives --auto mysqld
diff --git a/support-files/debian/mysql-server.conffiles b/support-files/debian/mysql-server.conffiles
deleted file mode 100644
index 5f4599b273c..00000000000
--- a/support-files/debian/mysql-server.conffiles
+++ /dev/null
@@ -1,2 +0,0 @@
-/etc/init.d/mysql
-/etc/my.cnf
diff --git a/support-files/debian/mysql-server.dirs b/support-files/debian/mysql-server.dirs
deleted file mode 100644
index 067eddeefad..00000000000
--- a/support-files/debian/mysql-server.dirs
+++ /dev/null
@@ -1,2 +0,0 @@
-etc/init.d
-var/mysql
diff --git a/support-files/debian/mysql-server.postinst b/support-files/debian/mysql-server.postinst
deleted file mode 100644
index ef2f32dac19..00000000000
--- a/support-files/debian/mysql-server.postinst
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/sh
-
-update-rc.d mysql defaults 50 >/dev/null
-
-#--------
-update-alternatives --install /usr/sbin/mysqld mysqld /usr/sbin/mysqld-static 10
-
-#--------
-
-DOFIX=0
-if [ ! -e /var/mysql/data/mysql/tables_priv.frm -a -d /var/mysql/data/mysql ]; then
- DOFIX=1
-fi
-
-#--------
-i=`grep '^mysql:' /etc/group`
-if [ "x${i}" == "x" ]; then
- groupadd mysql || true
-fi
-
-i=`grep '^mysql:' /etc/passwd`
-if [ "x${i}" == "x" ]; then
- useradd -g mysql -d /var/mysql/data -s /noexists mysql || true
-fi
-
-#--------
-
-if [ ! -d /var/mysql/data/mysql ]; then
- install -d /var/mysql/data || true
- /usr/sbin/mysql_install_db || true
- chown -R mysql.mysql /var/mysql
-fi
-
-#--------
-/etc/init.d/mysql start || true
-
-if [ $DOFIX -eq 1 ]; then
- echo "***************************************"
- echo " Now, fix tables for MySQL 3.22.11...."
- echo " if you set root passwd, please in..."
- echo -n " ? MySQL root passwd ? : "
- read pass dumy
- /usr/sbin/mysql_fix_privilege_tables $pass
-fi
diff --git a/support-files/debian/mysql-server.postrm b/support-files/debian/mysql-server.postrm
deleted file mode 100644
index d493a73a04a..00000000000
--- a/support-files/debian/mysql-server.postrm
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-update-alternatives --auto mysqld
-
-if [ "$1" = "purge" ]
-then
- update-rc.d mysql remove >/dev/null
-
- echo -n " Shall I also remove all of the databases (y/N)?"; read ans
- if [ "$ans" = "y" -o "$ans" = "Y" ]; then
- rm -rf /var/mysql
- fi
-fi
diff --git a/support-files/debian/mysql-server.prerm b/support-files/debian/mysql-server.prerm
deleted file mode 100644
index 569739ca00d..00000000000
--- a/support-files/debian/mysql-server.prerm
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-/etc/init.d/mysql stop || true
diff --git a/support-files/debian/patches/aa b/support-files/debian/patches/aa
deleted file mode 100644
index 288197370be..00000000000
--- a/support-files/debian/patches/aa
+++ /dev/null
@@ -1,11 +0,0 @@
---- mysql-3.23.23.orig/sql/Makefile.in
-+++ mysql-3.23.23/sql/Makefile.in
-@@ -366,7 +366,7 @@
-
- mysqlbinlog: $(mysqlbinlog_OBJECTS) $(mysqlbinlog_DEPENDENCIES)
- @rm -f mysqlbinlog
-- $(CXXLINK) $(mysqlbinlog_LDFLAGS) $(mysqlbinlog_OBJECTS) $(mysqlbinlog_LDADD) $(LIBS)
-+ $(CXXLINK) $(mysqld_LDFLAGS) $(mysqlbinlog_OBJECTS) $(mysqld_LDADD) $(LIBS)
-
- mysqld: $(mysqld_OBJECTS) $(mysqld_DEPENDENCIES)
- @rm -f mysqld
diff --git a/support-files/debian/patches/ab b/support-files/debian/patches/ab
deleted file mode 100644
index e169ee38188..00000000000
--- a/support-files/debian/patches/ab
+++ /dev/null
@@ -1,11 +0,0 @@
---- mysql-3.23.34a/sql/Makefile.in.orig Mon Mar 12 08:27:39 2001
-+++ mysql-3.23.34a/sql/Makefile.in Thu Mar 15 04:11:14 2001
-@@ -373,7 +373,7 @@
-
- mysqlbinlog: $(mysqlbinlog_OBJECTS) $(mysqlbinlog_DEPENDENCIES)
- @rm -f mysqlbinlog
-- $(CXXLINK) $(mysqlbinlog_LDFLAGS) $(mysqlbinlog_OBJECTS) $(mysqlbinlog_LDADD) $(LIBS)
-+ $(CXXLINK) $(mysqld_LDFLAGS) $(mysqlbinlog_OBJECTS) $(mysqld_LDADD) $(LIBS)
-
- mysqld: $(mysqld_OBJECTS) $(mysqld_DEPENDENCIES)
- @rm -f mysqld
diff --git a/support-files/debian/patches/ac b/support-files/debian/patches/ac
deleted file mode 100644
index 8cc2cd5dff1..00000000000
--- a/support-files/debian/patches/ac
+++ /dev/null
@@ -1,8 +0,0 @@
---- mysql-3.23.23.orig/scripts/msql2mysql.sh
-+++ mysql-3.23.23/scripts/msql2mysql.sh
-@@ -13,4 +13,4 @@
- # described in the License. Among other things, the License requires that
- # the copyright notice and this notice be preserved on all copies.
-
--@bindir@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $*
-+@bindir@/mysql_replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $*
diff --git a/support-files/debian/patches/ad b/support-files/debian/patches/ad
deleted file mode 100644
index 25394116ad9..00000000000
--- a/support-files/debian/patches/ad
+++ /dev/null
@@ -1,11 +0,0 @@
---- mysql-3.23.34a/scripts/mysql_install_db.sh.orig Mon Mar 12 08:18:27 2001
-+++ mysql-3.23.34a/scripts/mysql_install_db.sh Thu Mar 15 04:12:28 2001
-@@ -325,7 +325,7 @@
- if test "$IN_RPM" -eq 0
- then
- echo "You can start the MySQL daemon with:"
-- echo "cd @prefix@ ; $bindir/safe_mysqld &"
-+ echo "cd @prefix@ ; $sbindir/safe_mysqld &"
- echo
- echo "You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:"
- echo "cd sql-bench ; run-all-tests"
diff --git a/support-files/debian/patches/ae b/support-files/debian/patches/ae
deleted file mode 100644
index 7ea5733147f..00000000000
--- a/support-files/debian/patches/ae
+++ /dev/null
@@ -1,35 +0,0 @@
---- mysql-3.23.30-gamma/support-files/mysql.server.sh.orig Thu Jan 4 11:03:57 2001
-+++ mysql-3.23.30-gamma/support-files/mysql.server.sh Sat Jan 6 12:18:50 2001
-@@ -28,8 +28,10 @@
- then
- basedir=@prefix@
- bindir=@bindir@
-+ sbindir=@sbindir@
- else
- bindir="$basedir/bin"
-+ sbindir="$basedir/sbin"
- fi
- if test -z "$pid_file"
- then
-@@ -100,18 +102,18 @@
- 'start')
- # Start daemon
-
-- if test -x $bindir/safe_mysqld
-+ if test -x $sbindir/safe_mysqld
- then
- # Give extra arguments to mysqld with the my.cnf file. This script may
- # be overwritten at next upgrade.
-- $bindir/safe_mysqld --datadir=$datadir --pid-file=$pid_file &
-+ $sbindir/safe_mysqld --datadir=$datadir --pid-file=$pid_file &
- # Make lock for RedHat / SuSE
- if test -w /var/lock/subsys
- then
- touch /var/lock/subsys/mysql
- fi
- else
-- echo "Can't execute $bindir/safe_mysqld"
-+ echo "Can't execute $sbindir/safe_mysqld"
- fi
- ;;
-
diff --git a/support-files/debian/patches/az b/support-files/debian/patches/az
deleted file mode 100644
index 0795946de32..00000000000
--- a/support-files/debian/patches/az
+++ /dev/null
@@ -1,39 +0,0 @@
---- mysql-3.23.23.orig/configure
-+++ mysql-3.23.23/configure
-@@ -202,7 +202,7 @@
- --with-charset=CHARSET use CHARSET by default (one of: big5 cp1251 cp1257
- croat czech danish dec8 dos estonia euc_kr gb2312 gbk
- german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr
-- latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr
-+ latin1 latin2 swe7 usa7 win1250 win1251ukr
- ujis sjis tis620; default is latin1)"
- ac_help="$ac_help
- --with-extra-charsets=cs1,cs2
-@@ -8843,7 +8843,7 @@
-
- # Choose a character set
-
--CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr ujis sjis tis620"
-+CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251ukr ujis sjis tis620"
- DEFAULT_CHARSET=latin1
-
- # Check whether --with-charset or --without-charset was given.
---- mysql-3.23.23.orig/configure.in
-+++ mysql-3.23.23/configure.in
-@@ -1517,14 +1517,14 @@
- dnl or other special handling, you must also create
- dnl strings/ctype-$charset_name.c
-
--CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr ujis sjis tis620"
-+CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251ukr ujis sjis tis620"
- DEFAULT_CHARSET=latin1
-
- AC_ARG_WITH(charset,
- [ --with-charset=CHARSET use CHARSET by default (one of: big5 cp1251 cp1257
- croat czech danish dec8 dos estonia euc_kr gb2312 gbk
- german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr
-- latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr
-+ latin1 latin2 swe7 usa7 win1250 win1251ukr
- ujis sjis tis620; default is latin1)],
- [default_charset="$withval"],
- [default_charset="$DEFAULT_CHARSET"])
diff --git a/support-files/debian/patches/ta b/support-files/debian/patches/ta
deleted file mode 100644
index b27259f4473..00000000000
--- a/support-files/debian/patches/ta
+++ /dev/null
@@ -1,68 +0,0 @@
---- mysql-3.23.34a/mysql-test/install_test_db.sh.orig Mon Mar 12 08:18:24 2001
-+++ mysql-3.23.34a/mysql-test/install_test_db.sh Thu Mar 15 04:11:14 2001
-@@ -5,6 +5,15 @@
- # 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"-debian" ]; then
-+ DEBIAN=1
-+ shift 1
-+ execdir=/usr/sbin
-+ bindir=/usr/bin
-+ BINARY_DIST=1
-+ fix_bin=/var/mysql/mysql-test
-+else
-+
- if [ x$1 = x"-bin" ]; then
- shift 1
- execdir=../bin
-@@ -17,6 +26,10 @@
- fix_bin=.
- fi
-
-+fi
-+
-+
-+
- vardir=var
- logdir=$vardir/log
- if [ x$1 = x"-slave" ]
-@@ -47,12 +60,17 @@
- #create the directories
- [ -d $vardir ] || mkdir $vardir
- [ -d $logdir ] || mkdir $logdir
-+[ "x$RUN_USER" != "x" ] && chown -R $RUN_USER $logdir
-
- # Create database directories mysql & test
- if [ -d $data ] ; then rm -rf $data ; fi
- mkdir $data $data/mysql $data/test
-
- #for error messages
-+if [ "x$DEBIAN" = "x1" ]; then
-+ basedir=/usr
-+else
-+
- if [ x$BINARY_DIST = x1 ] ; then
- basedir=..
- else
-@@ -62,6 +80,10 @@
- ln -sf ../../sql/share share/mysql
- fi
-
-+fi
-+
-+
-+
- # Initialize variables
- c_d="" i_d=""
- c_h="" i_h=""
-@@ -211,7 +233,9 @@
- $c_c
- END_OF_DATA
- then
-+ [ "x$RUN_USER" != "x" ] && chown -R $RUN_USER $ldata
- exit 0
- else
-+ [ "x$RUN_USER" != "x" ] && chown -R $RUN_USER $ldata
- exit 1
- fi
diff --git a/support-files/debian/patches/tb b/support-files/debian/patches/tb
deleted file mode 100644
index c3890dcab62..00000000000
--- a/support-files/debian/patches/tb
+++ /dev/null
@@ -1,86 +0,0 @@
---- mysql-3.23.34a/mysql-test/mysql-test-run.sh.orig Mon Mar 12 08:18:27 2001
-+++ mysql-3.23.34a/mysql-test/mysql-test-run.sh Thu Mar 15 04:11:14 2001
-@@ -37,9 +37,23 @@
- XARGS=`which xargs | head -1`
- SED=sed
-
-+if [ $USER = root ]; then
-+ RUN_USER="mysql"
-+ RUN_USER_OPT="--user=$RUN_USER"
-+ export RUN_USER
-+fi
-+
-+
- # Are we using a source or a binary distribution?
-
- testdir=@testdir@
-+
-+if [ -d /var/mysql/mysql-test ]; then
-+ DEBIAN=1
-+ cd /var/mysql/mysql-test
-+ testdir=/var/mysql
-+fi
-+
- if [ -d bin/mysqld ] && [ -d mysql-test ] ; then
- cd mysql-test
- else
-@@ -56,6 +70,10 @@
- exit 1
- fi
-
-+if [ x$DEBIAN = x1 ]; then
-+ MY_BASEDIR=/usr
-+fi
-+
- #++
- # Misc. Definitions
- #--
-@@ -184,12 +202,21 @@
- [ -d $MYSQL_TEST_DIR/var ] || mkdir $MYSQL_TEST_DIR/var
- [ -d $MYSQL_TEST_DIR/var/tmp ] || mkdir $MYSQL_TEST_DIR/var/tmp
- [ -d $MYSQL_TEST_DIR/var/run ] || mkdir $MYSQL_TEST_DIR/var/run
-+[ -d $MYSQL_TEST_DIR -a "x$RUN_USER" != "x" ] && chown -R $RUN_USER $MYSQL_TEST_DIR
-
- [ -z "$COLUMNS" ] && COLUMNS=80
- E=`$EXPR $COLUMNS - 8`
- #DASH72=`expr substr '------------------------------------------------------------------------' 1 $E`
- DASH72=`$ECHO '------------------------------------------------------------------------'|$CUT -c 1-$E`
-
-+if [ "x$DEBIAN" = "x1" ]; then
-+ MYSQLD="/usr/sbin/mysqld"
-+ MYSQL_TEST="/usr/sbin/mysqltest"
-+ MYSQLADMIN="/usr/bin/mysqladmin"
-+ INSTALL_DB="/var/mysql/mysql-test/install_test_db -debian"
-+
-+else
-+
- # on source dist, we pick up freshly build executables
- # on binary, use what is installed
- if [ x$SOURCE_DIST = x1 ] ; then
-@@ -250,6 +277,8 @@
- read unused
- }
-
-+fi
-+
-
- error () {
- $ECHO "Error: $1"
-@@ -365,7 +394,7 @@
- --language=english \
- --innobase_data_file_path=ibdata1:50M \
- $SMALL_SERVER \
-- $EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT"
-+ $RUN_USER_OPT $EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT"
- if [ x$DO_DDD = x1 ]
- then
- $ECHO "set args $master_args" > $GDB_MASTER_INIT
-@@ -420,7 +449,7 @@
- --language=english \
- --skip-innobase \
- $SMALL_SERVER \
-- $EXTRA_SLAVE_OPT $EXTRA_SLAVE_MYSQLD_OPT"
-+ $RUN_USER_OPT $EXTRA_SLAVE_OPT $EXTRA_SLAVE_MYSQLD_OPT"
- if [ x$DO_DDD = x1 ]
- then
- $ECHO "set args $master_args" > $GDB_SLAVE_INIT
diff --git a/support-files/debian/rules b/support-files/debian/rules
deleted file mode 100755
index c03e7fd1742..00000000000
--- a/support-files/debian/rules
+++ /dev/null
@@ -1,232 +0,0 @@
-#!/usr/bin/make -f
-# Made with the aid of debmake, by Christoph Lameter,
-# based on the sample debian/rules file for GNU hello by Ian Jackson.
-
-package=mysql
-CHARSET=ujis
-SYSNAME=
-
-TEMPINST=build
-
-# 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
-
-CC=gcc
-CFLAGS=-O6 -fomit-frame-pointer
-CXX=gcc
-CXXFLAGS=-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti
-# CXXFLAGS=-O6 -fomit-frame-pointer -felide-constructors -fno-rtti
-
-COMMONCONF= --prefix=/usr --libexecdir=/usr/sbin \
- --localstatedir=/var/mysql/data \
- --enable-shared \
- --without-perl --without-readline \
- --without-docs --without-bench \
- --with-mysqld-user=mysql \
- --with-extra-charsets=all
-
-SERVERCONF=$(COMMONCONF) --enable-assembler \
- --with-raid
-
-MYSQLMAXCONF= --with-server-suffix=-Max \
- --with-innodb \
- --with-berkeley-db
-
-# --with-gemini \
-
-# --with-berkeley-db-includes=/usr/include/db3 \
-# --with-berkeley-db-libs=/usr/lib
-
-STATICCONF=--with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static
-
-CLIENTCONF=$(COMMONCONF) --without-server
-
-##################################################
-patches debian/stamp-patches:
- -test -e debian/stamp-patches || \
- for i in `find debian/patches -type f -print` ; do \
- echo "==== $$i ====" ; \
- patch -p1 < $$i ; \
- done
- touch debian/stamp-patches
-
-##################################################
-premkdir debian/stamp-premkdir:
- $(checkdir)
- -rm -rf debian/tmp debian/$(TEMPINST)*
- dh_installdirs
-
- for i in '' -shared -debug -max -max-shared -max-debug ; do \
- install -d debian/$(TEMPINST)$${i}/usr/{bin,sbin,share,man,include,info} ; \
- done
-
-# -install -d debian/$(TEMPINST)$${i}/usr/{bin,sbin,share,man,include,info}
-# -install -d debian/$(TEMPINST)-shared/usr/{bin,sbin,share,man,include,info}
-# -install -d debian/$(TEMPINST)-debug/usr/{bin,sbin,share,man,include,info}
-
- touch debian/stamp-premkdir
-
-##################################################
-config debian/stamp-config: debian/stamp-premkdir debian/stamp-patches
- CC=$(CC) CFLAGS="$(CFLAGS)" CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" \
- LDFLAGS="-static" \
- ./configure $(SERVERCONF) $(STATICCONF) \
- --with-charset=$(CHARSET) \
- --with-bench \
- $(SYSNAME)
-
-# sed 's/-fno-implicit-templates//g' sql/Makefile > .m
-# mv .m sql/Makefile
- touch debian/stamp-config
-
-##################################################
-build: debian/stamp-config
- make LDFLAGS="-static"
- make install DESTDIR=`pwd`/debian/$(TEMPINST)
- cp include/m_ctype.h `pwd`/debian/$(TEMPINST)/usr/include/mysql/
- touch build
-
-##################################################
-build-shared debian/stamp-build-shared: debian/stamp-patches
- -make distclean
- CC=$(CC) CFLAGS="$(CFLAGS)" CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" \
- ./configure $(SERVERCONF) \
- --with-charset=$(CHARSET) \
- $(SYSNAME)
-
-# ./configure $(CLIENTCONF)
-
- make
- make install DESTDIR=`pwd`/debian/$(TEMPINST)-shared
-
- touch debian/stamp-build-shared
-
-##################################################
-build-debug debian/stamp-build-debug: debian/stamp-patches
- -make distclean
- CC=$(CC) CFLAGS="$(CFLAGS)" CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" \
- ./configure $(SERVERCONF) \
- --with-charset=$(CHARSET) \
- --with-debug \
- $(SYSNAME)
-
-# ./configure $(CLIENTCONF)
-
- make
- make install DESTDIR=`pwd`/debian/$(TEMPINST)-debug
-
- touch debian/stamp-build-debug
-
-##################################################
-debian/stamp-mysql-max: debian/stamp-mysql-max-static debian/stamp-mysql-max-shared debian/stamp-mysql-max-debug
-
-debian/stamp-mysql-max-static: debian/stamp-premkdir debian/stamp-patches
- -make distclean
- CC=$(CC) CFLAGS="$(CFLAGS)" CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" \
- ./configure $(SERVERCONF) $(STATICCONF) \
- $(MYSQLMAXCONF) \
- --with-charset=$(CHARSET) \
- $(SYSNAME)
-
- make LDFLAGS="-static"
- make install DESTDIR=`pwd`/debian/$(TEMPINST)-max
-
- touch debian/stamp-mysql-max-static
-
-debian/stamp-mysql-max-shared: debian/stamp-premkdir debian/stamp-patches
- -make distclean
- CC=$(CC) CFLAGS="$(CFLAGS)" CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" \
- ./configure $(SERVERCONF) \
- $(MYSQLMAXCONF) \
- --with-charset=$(CHARSET) \
- $(SYSNAME)
-
- make
- make install DESTDIR=`pwd`/debian/$(TEMPINST)-max-shared
-
- touch debian/stamp-mysql-max-shared
-
-
-debian/stamp-mysql-max-debug: debian/stamp-premkdir debian/stamp-patches
- -make distclean
- CC=$(CC) CFLAGS="$(CFLAGS)" CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" \
- ./configure $(SERVERCONF) \
- $(MYSQLMAXCONF) \
- --with-charset=$(CHARSET) \
- --with-debug \
- $(SYSNAME)
-
- make
- make install DESTDIR=`pwd`/debian/$(TEMPINST)-max-debug
-
- touch debian/stamp-mysql-max-debug
-
-
-##################################################
-clean:
- $(checkdir)
- -make distclean
- -test -e debian/stamp-patches && \
- for i in `find debian/patches -type f -print` ; do \
- patch -R -p1 < $$i ; \
- done
- -rm -rf build debian/stamp-* debian/$(TEMPINST)*
- -dh_clean
- -rm -f `find . -name "*~"`
- -rm -rf debian/tmp debian/files* core
- -rm -f debian/*substvars
- -rm -f `cat debian/gomi`
-
-##################################################
-binary-indep: checkroot build
- $(checkdir)
-# There are no architecture-independent files to be uploaded
-# generated by this package. If there were any they would be
-# made here.
-
-binary-arch: checkroot build debian/stamp-build-shared debian/stamp-build-debug debian/stamp-mysql-max
- sh debian/move
-
-### init, post*
- dh_installdeb
- cp debian/shlibs debian/libmysqlclient10/DEBIAN/
-
- cp debian/my.cnf debian/mysql-server/etc/
- cp support-files/mysql.server debian/mysql-server/etc/init.d/mysql ; chmod +x debian/mysql-server/etc/init.d/mysql
-
-### dpkg-xxx
- dh_compress
-
- dh_fixperms
-
- dh_strip
-
- dh_shlibdeps
- dh_gencontrol
-
- dpkg --build debian/libmysqlclient10 ..
- dpkg --build debian/mysql-client ..
- dpkg --build debian/mysql-server ..
- dpkg --build debian/mysql-server-shared ..
- dpkg --build debian/mysql-server-debug ..
- dpkg --build debian/mysql-dev ..
- dpkg --build debian/mysql-bench ..
- dpkg --build debian/mysql-doc ..
- dpkg --build debian/mysql-max ..
- dpkg --build debian/mysql-max-shared ..
- dpkg --build debian/mysql-max-debug ..
-
-define checkdir
- test -f debian/rules
-endef
-
-# Below here is fairly generic really
-
-binary: binary-indep binary-arch
-
-##################################################
-checkroot:
- $(checkdir)
- test root = "`whoami`"
-
-##################################################
-.PHONY: binary binary-arch binary-indep clean checkroot
diff --git a/support-files/debian/shlibs b/support-files/debian/shlibs
deleted file mode 100644
index 5500d337df9..00000000000
--- a/support-files/debian/shlibs
+++ /dev/null
@@ -1 +0,0 @@
-libmysqlclient 10 libmysqlclient10
diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh
index c68d30daafb..0a87b04c992 100644
--- a/support-files/mysql.server.sh
+++ b/support-files/mysql.server.sh
@@ -311,7 +311,7 @@ case "$mode" in
fi
exit $return_value
else
- log_failure_msg "Couldn't find MySQL manager or server"
+ log_failure_msg "Couldn't find MySQL manager ($manager) or server ($bindir/mysqld_safe)"
fi
;;
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index c49fa645a90..42a94fa284a 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -340,7 +340,7 @@ do
./libtool --mode=execute cp sql/mysqld sql/mysqld-debug
./libtool --mode=execute nm --numeric-sort sql/mysqld-debug > sql/mysqld-debug.sym
echo "# debug"
- make test-bt
+ make test-bt-debug
make clean
fi
done
@@ -726,6 +726,10 @@ fi
# itself - note that they must be ordered by date (important when
# merging BK trees)
%changelog
+* Fri Nov 16 2007 Joerg Bruehe <joerg@mysql.com>
+
+- When testing the debug server, use "make test-bt-debug".
+
* Sat Apr 07 2007 Kent Boortz <kent@mysql.com>
- Removed man page for "mysql_create_system_tables"
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index c335b0128f7..65e18da97f1 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -15490,7 +15490,7 @@ static void test_bug21635()
char *query_end;
MYSQL_RES *result;
MYSQL_FIELD *field;
- unsigned int field_count, i;
+ unsigned int field_count, i, j;
int rc;
DBUG_ENTER("test_bug21635");
@@ -15506,28 +15506,35 @@ static void test_bug21635()
myquery(rc);
rc= mysql_query(mysql, "CREATE TABLE t1 (i INT)");
myquery(rc);
- rc= mysql_query(mysql, "INSERT INTO t1 VALUES (1)");
- myquery(rc);
+ /*
+ We need this loop to ensure correct behavior with both constant and
+ non-constant tables.
+ */
+ for (j= 0; j < 2 ; j++)
+ {
+ rc= mysql_query(mysql, "INSERT INTO t1 VALUES (1)");
+ myquery(rc);
- rc= mysql_real_query(mysql, query, query_end - query);
- myquery(rc);
+ rc= mysql_real_query(mysql, query, query_end - query);
+ myquery(rc);
- result= mysql_use_result(mysql);
- DIE_UNLESS(result);
+ result= mysql_use_result(mysql);
+ DIE_UNLESS(result);
- field_count= mysql_field_count(mysql);
- for (i= 0; i < field_count; ++i)
- {
- field= mysql_fetch_field_direct(result, i);
- printf("%s -> %s ... ", expr[i * 2], field->name);
- fflush(stdout);
- DIE_UNLESS(field->db[0] == 0 && field->org_table[0] == 0 &&
- field->table[0] == 0 && field->org_name[0] == 0);
- DIE_UNLESS(strcmp(field->name, expr[i * 2 + 1]) == 0);
- puts("OK");
- }
+ field_count= mysql_field_count(mysql);
+ for (i= 0; i < field_count; ++i)
+ {
+ field= mysql_fetch_field_direct(result, i);
+ printf("%s -> %s ... ", expr[i * 2], field->name);
+ fflush(stdout);
+ DIE_UNLESS(field->db[0] == 0 && field->org_table[0] == 0 &&
+ field->table[0] == 0 && field->org_name[0] == 0);
+ DIE_UNLESS(strcmp(field->name, expr[i * 2 + 1]) == 0);
+ puts("OK");
+ }
- mysql_free_result(result);
+ mysql_free_result(result);
+ }
rc= mysql_query(mysql, "DROP TABLE t1");
myquery(rc);
@@ -15857,6 +15864,99 @@ static void test_bug29306()
DBUG_VOID_RETURN;
}
+
+/**
+ Bug#31669 Buffer overflow in mysql_change_user()
+*/
+
+#define LARGE_BUFFER_SIZE 2048
+
+static void test_bug31669()
+{
+ int rc;
+ static char buff[LARGE_BUFFER_SIZE+1];
+#ifndef EMBEDDED_LIBRARY
+ static char user[USERNAME_LENGTH+1];
+ static char db[NAME_LEN+1];
+ static char query[LARGE_BUFFER_SIZE*2];
+#endif
+
+ DBUG_ENTER("test_bug31669");
+ myheader("test_bug31669");
+
+ rc= mysql_change_user(mysql, NULL, NULL, NULL);
+ DIE_UNLESS(rc);
+
+ rc= mysql_change_user(mysql, "", "", "");
+ DIE_UNLESS(rc);
+
+ memset(buff, 'a', sizeof(buff));
+
+ rc= mysql_change_user(mysql, buff, buff, buff);
+ DIE_UNLESS(rc);
+
+ rc = mysql_change_user(mysql, opt_user, opt_password, current_db);
+ DIE_UNLESS(!rc);
+
+#ifndef EMBEDDED_LIBRARY
+ memset(db, 'a', sizeof(db));
+ db[NAME_LEN]= 0;
+ strxmov(query, "CREATE DATABASE IF NOT EXISTS ", db, NullS);
+ rc= mysql_query(mysql, query);
+ myquery(rc);
+
+ memset(user, 'b', sizeof(user));
+ user[USERNAME_LENGTH]= 0;
+ memset(buff, 'c', sizeof(buff));
+ buff[LARGE_BUFFER_SIZE]= 0;
+ strxmov(query, "GRANT ALL PRIVILEGES ON *.* TO '", user, "'@'%' IDENTIFIED BY "
+ "'", buff, "' WITH GRANT OPTION", NullS);
+ rc= mysql_query(mysql, query);
+ myquery(rc);
+
+ rc= mysql_query(mysql, "FLUSH PRIVILEGES");
+ myquery(rc);
+
+ rc= mysql_change_user(mysql, user, buff, db);
+ DIE_UNLESS(!rc);
+
+ user[USERNAME_LENGTH-1]= 'a';
+ rc= mysql_change_user(mysql, user, buff, db);
+ DIE_UNLESS(rc);
+
+ user[USERNAME_LENGTH-1]= 'b';
+ buff[LARGE_BUFFER_SIZE-1]= 'd';
+ rc= mysql_change_user(mysql, user, buff, db);
+ DIE_UNLESS(rc);
+
+ buff[LARGE_BUFFER_SIZE-1]= 'c';
+ db[NAME_LEN-1]= 'e';
+ rc= mysql_change_user(mysql, user, buff, db);
+ DIE_UNLESS(rc);
+
+ db[NAME_LEN-1]= 'a';
+ rc= mysql_change_user(mysql, user, buff, db);
+ DIE_UNLESS(!rc);
+
+ rc= mysql_change_user(mysql, user + 1, buff + 1, db + 1);
+ DIE_UNLESS(rc);
+
+ rc = mysql_change_user(mysql, opt_user, opt_password, current_db);
+ DIE_UNLESS(!rc);
+
+ strxmov(query, "DROP DATABASE ", db, NullS);
+ rc= mysql_query(mysql, query);
+ myquery(rc);
+
+ strxmov(query, "DELETE FROM mysql.user WHERE User='", user, "'", NullS);
+ rc= mysql_query(mysql, query);
+ myquery(rc);
+ DIE_UNLESS(mysql_affected_rows(mysql) == 1);
+#endif
+
+ DBUG_VOID_RETURN;
+}
+
/*
Read and parse arguments and MySQL options from my.cnf
*/
@@ -15881,7 +15981,13 @@ static struct my_option client_test_long_options[] =
{"password", 'p',
"Password to use when connecting to server. If password is not given it's asked from the tty.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"port", 'P', "Port number to use for connection", (char **) &opt_port,
+ {"port", 'P', "Port number to use for connection or 0 for default to, in "
+ "order of preference, my.cnf, $MYSQL_TCP_PORT, "
+#if MYSQL_PORT_DEFAULT == 0
+ "/etc/services, "
+#endif
+ "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
+ (char **) &opt_port,
(char **) &opt_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"server-arg", 'A', "Send embedded server this as a parameter.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -16143,6 +16249,7 @@ static struct my_tests_st my_tests[]= {
{ "test_bug27592", test_bug27592 },
{ "test_bug29948", test_bug29948 },
{ "test_bug29306", test_bug29306 },
+ { "test_bug31669", test_bug31669 },
{ 0, 0 }
};
diff --git a/tests/ssl_test.c b/tests/ssl_test.c
index 136f0a83cbe..ad6bc925cc6 100644
--- a/tests/ssl_test.c
+++ b/tests/ssl_test.c
@@ -44,7 +44,7 @@ int main(int argc, char **argv)
"../SSL/MySQL-client-cert.pem",
"../SSL/MySQL-ca-cert.pem", 0, 0);
#endif
- if (!(sock = mysql_real_connect(&mysql,"127.0.0.1",0,0,argv[1],3306,NULL,0)))
+ if (!(sock = mysql_real_connect(&mysql,"127.0.0.1",0,0,argv[1],MYSQL_PORT,NULL,0)))
{
fprintf(stderr,"Couldn't connect to engine!\n%s\n\n",mysql_error(&mysql));
perror("");
diff --git a/tests/thread_test.c b/tests/thread_test.c
index 0ad446282c2..0ba03694893 100644
--- a/tests/thread_test.c
+++ b/tests/thread_test.c
@@ -103,7 +103,13 @@ static struct my_option my_long_options[] =
(gptr*) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"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,
+ {"port", 'P', "Port number to use for connection or 0 for default to, in "
+ "order of preference, my.cnf, $MYSQL_TCP_PORT, "
+#if MYSQL_PORT_DEFAULT == 0
+ "/etc/services, "
+#endif
+ "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
+ (gptr*) &tcp_port,
(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},
diff --git a/win/configure.js b/win/configure.js
index 1408dba9aea..4450b97f9a1 100755
--- a/win/configure.js
+++ b/win/configure.js
@@ -31,6 +31,7 @@ try
configureInTS.Close();
var default_comment = "Source distribution";
var default_port = GetValue(configureIn, "MYSQL_TCP_PORT_DEFAULT");
+ var actual_port = 0;
var configfile = fso.CreateTextFile("win\\configure.data", true);
for (i=0; i < args.Count(); i++)
@@ -58,10 +59,41 @@ try
default_comment = parts[1];
break;
case "MYSQL_TCP_PORT":
- default_port = parts[1];
+ actual_port = parts[1];
break;
}
}
+ if (actual_port == 0)
+ {
+ // if we actually defaulted (as opposed to the pathological case of
+ // --with-tcp-port=<MYSQL_TCP_PORT_DEFAULT> which might in theory
+ // happen if whole batch of servers was built from a script), set
+ // the default to zero to indicate that; we don't lose information
+ // that way, because 0 obviously indicates that we can get the
+ // default value from MYSQL_TCP_PORT. this seems really evil, but
+ // testing for MYSQL_TCP_PORT==MYSQL_TCP_PORT_DEFAULT would make a
+ // a port of MYSQL_TCP_PORT_DEFAULT magic even if the builder did not
+ // intend it to mean "use the default, in fact, look up a good default
+ // from /etc/services if you can", but really, really meant 3306 when
+ // they passed in 3306. When they pass in a specific value, let them
+ // have it; don't second guess user and think we know better, this will
+ // just make people cross. this makes the the logic work like this
+ // (which is complicated enough):
+ //
+ // - if a port was set during build, use that as a default.
+ //
+ // - otherwise, try to look up a port in /etc/services; if that fails,
+ // use MYSQL_TCP_PORT_DEFAULT (at the time of this writing 3306)
+ //
+ // - allow the MYSQL_TCP_PORT environment variable to override that.
+ //
+ // - allow command-line parameters to override all of the above.
+ //
+ // the top-most MYSQL_TCP_PORT_DEFAULT is read from win/configure.js,
+ // so don't mess with that.
+ actual_port = default_port;
+ default_port = 0;
+ }
configfile.WriteLine("SET (COMPILATION_COMMENT \"" +
default_comment + "\")");
@@ -70,7 +102,8 @@ try
GetValue(configureIn, "PROTOCOL_VERSION") + "\")");
configfile.WriteLine("SET (DOT_FRM_VERSION \"" +
GetValue(configureIn, "DOT_FRM_VERSION") + "\")");
- configfile.WriteLine("SET (MYSQL_TCP_PORT \"" + default_port + "\")");
+ configfile.WriteLine("SET (MYSQL_TCP_PORT_DEFAULT \"" + default_port + "\")");
+ configfile.WriteLine("SET (MYSQL_TCP_PORT \"" + actual_port + "\")");
configfile.WriteLine("SET (MYSQL_UNIX_ADDR \"" +
GetValue(configureIn, "MYSQL_UNIX_ADDR_DEFAULT") + "\")");
var version = GetVersion(configureIn);