summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <joreland@mysql.com>2004-09-06 07:43:31 +0200
committerunknown <joreland@mysql.com>2004-09-06 07:43:31 +0200
commitfd07116e2f705ab5e54b614eba9f32cf10b8b0f1 (patch)
tree4fdc68458808d0f58a5d559e3c181b8b6528f30a
parentf809e037e9392da78c8f71149e8294010c743806 (diff)
parent1230daf8f281bbb1ca07364b9a8c18ea4aa02a4d (diff)
downloadmariadb-git-fd07116e2f705ab5e54b614eba9f32cf10b8b0f1.tar.gz
merge
BitKeeper/etc/logging_ok: auto-union configure.in: Auto merged mysql-test/t/ndb_blob.test: Auto merged ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Auto merged
-rwxr-xr-xBuild-tools/Bootstrap10
-rwxr-xr-xBuild-tools/mysql-copyright26
-rw-r--r--client/mysql.cc7
-rw-r--r--client/mysqladmin.c2
-rw-r--r--client/mysqlbinlog.cc2
-rw-r--r--client/mysqlcheck.c2
-rw-r--r--client/mysqldump.c2
-rw-r--r--client/mysqlimport.c2
-rw-r--r--client/mysqlmanager-pwgen.c2
-rw-r--r--client/mysqlmanagerc.c2
-rw-r--r--client/mysqlshow.c2
-rw-r--r--client/mysqltest.c2
-rw-r--r--cmd-line-utils/libedit/Makefile.am2
-rw-r--r--cmd-line-utils/libedit/el.c4
-rw-r--r--cmd-line-utils/libedit/el.h2
-rw-r--r--cmd-line-utils/libedit/key.c34
-rw-r--r--cmd-line-utils/libedit/key.h25
-rw-r--r--cmd-line-utils/libedit/map.c37
-rw-r--r--cmd-line-utils/libedit/read.c9
-rw-r--r--cmd-line-utils/libedit/term.c68
-rw-r--r--cmd-line-utils/libedit/term.h124
-rw-r--r--cmd-line-utils/libedit/tty.c8
-rw-r--r--configure.in9
-rw-r--r--extra/my_print_defaults.c2
-rw-r--r--extra/mysql_waitpid.c2
-rw-r--r--extra/perror.c2
-rw-r--r--extra/resolve_stack_dump.c2
-rw-r--r--extra/resolveip.c2
-rw-r--r--include/config-win.h2
-rw-r--r--include/my_getopt.h10
-rw-r--r--include/my_time.h2
-rw-r--r--innobase/row/row0mysql.c15
-rw-r--r--innobase/srv/srv0start.c7
-rw-r--r--isam/isamchk.c2
-rw-r--r--isam/pack_isam.c2
-rw-r--r--libmysql/libmysql.c7
-rw-r--r--myisam/mi_check.c32
-rw-r--r--myisam/mi_test1.c2
-rw-r--r--myisam/myisam_ftdump.c2
-rw-r--r--myisam/myisamchk.c2
-rw-r--r--myisam/myisampack.c2
-rw-r--r--myisammrg/myrg_open.c28
-rw-r--r--mysql-test/mysql-test-run.sh15
-rw-r--r--mysql-test/r/create.result38
-rw-r--r--mysql-test/r/fulltext2.result9
-rw-r--r--mysql-test/r/func_gconcat.result6
-rw-r--r--mysql-test/r/func_in.result10
-rw-r--r--mysql-test/r/lowercase_table.result29
-rw-r--r--mysql-test/r/merge.result9
-rw-r--r--mysql-test/r/ndb_basic.result8
-rw-r--r--mysql-test/r/ndb_blob.result5
-rw-r--r--mysql-test/r/ndb_transaction.result8
-rw-r--r--mysql-test/r/negation_elimination.result13
-rw-r--r--mysql-test/r/ps.result11
-rw-r--r--mysql-test/r/ps_1general.result8
-rw-r--r--mysql-test/r/rename.result1
-rw-r--r--mysql-test/r/rpl_charset.result160
-rw-r--r--mysql-test/r/rpl_delete_all.result10
-rw-r--r--mysql-test/r/show_check.result55
-rw-r--r--mysql-test/r/system_mysql_db.result152
-rw-r--r--mysql-test/r/union.result8
-rw-r--r--mysql-test/t/alter_table.test4
-rw-r--r--mysql-test/t/create.test34
-rw-r--r--mysql-test/t/fulltext2.test8
-rw-r--r--mysql-test/t/func_in.test7
-rw-r--r--mysql-test/t/lowercase_table.test30
-rw-r--r--mysql-test/t/merge.test14
-rw-r--r--mysql-test/t/ndb_basic.test10
-rw-r--r--mysql-test/t/ndb_blob.test10
-rw-r--r--mysql-test/t/ndb_transaction.test9
-rw-r--r--mysql-test/t/negation_elimination.test4
-rw-r--r--mysql-test/t/ps.test17
-rw-r--r--mysql-test/t/ps_1general.test8
-rw-r--r--mysql-test/t/rename.test2
-rw-r--r--mysql-test/t/rpl_charset.test36
-rw-r--r--mysql-test/t/rpl_delete_all.test6
-rw-r--r--mysql-test/t/show_check.test37
-rw-r--r--mysql-test/t/union.test8
-rw-r--r--mysys/my_getopt.c97
-rw-r--r--scripts/mysql_create_system_tables.sh50
-rw-r--r--scripts/mysql_fix_privilege_tables.sql36
-rw-r--r--scripts/mysqld_safe.sh17
-rw-r--r--sql-common/my_time.c10
-rw-r--r--sql/field.h4
-rw-r--r--sql/gen_lex_hash.cc2
-rw-r--r--sql/ha_innodb.cc5
-rw-r--r--sql/item.cc30
-rw-r--r--sql/item.h16
-rw-r--r--sql/item_cmpfunc.cc132
-rw-r--r--sql/item_cmpfunc.h5
-rw-r--r--sql/item_func.cc12
-rw-r--r--sql/item_func.h7
-rw-r--r--sql/item_sum.cc2
-rw-r--r--sql/lock.cc3
-rw-r--r--sql/log.cc157
-rw-r--r--sql/log_event.cc4
-rw-r--r--sql/mysql_priv.h4
-rw-r--r--sql/mysqld.cc21
-rw-r--r--sql/share/czech/errmsg.txt16
-rw-r--r--sql/share/danish/errmsg.txt17
-rw-r--r--sql/share/dutch/errmsg.txt18
-rw-r--r--sql/share/english/errmsg.txt17
-rw-r--r--sql/share/estonian/errmsg.txt19
-rw-r--r--sql/share/french/errmsg.txt17
-rw-r--r--sql/share/german/errmsg.txt20
-rw-r--r--sql/share/greek/errmsg.txt17
-rw-r--r--sql/share/hungarian/errmsg.txt20
-rw-r--r--sql/share/italian/errmsg.txt17
-rw-r--r--sql/share/japanese/errmsg.txt19
-rw-r--r--sql/share/korean/errmsg.txt17
-rw-r--r--sql/share/norwegian-ny/errmsg.txt17
-rw-r--r--sql/share/norwegian/errmsg.txt17
-rw-r--r--sql/share/polish/errmsg.txt18
-rw-r--r--sql/share/portuguese/errmsg.txt18
-rw-r--r--sql/share/romanian/errmsg.txt18
-rw-r--r--sql/share/russian/errmsg.txt20
-rw-r--r--sql/share/slovak/errmsg.txt17
-rw-r--r--sql/share/spanish/errmsg.txt19
-rw-r--r--sql/share/swedish/errmsg.OLD221
-rw-r--r--sql/share/swedish/errmsg.txt17
-rw-r--r--sql/share/ukrainian/errmsg.txt20
-rw-r--r--sql/sql_base.cc22
-rw-r--r--sql/sql_class.cc6
-rw-r--r--sql/sql_derived.cc8
-rw-r--r--sql/sql_load.cc18
-rw-r--r--sql/sql_parse.cc51
-rw-r--r--sql/sql_prepare.cc57
-rw-r--r--sql/sql_select.cc71
-rw-r--r--sql/sql_select.h1
-rw-r--r--sql/sql_table.cc2
-rw-r--r--sql/sql_yacc.yy26
-rw-r--r--sql/table.cc11
-rw-r--r--tests/client_test.c142
-rw-r--r--tools/mysqlmanager.c2
134 files changed, 1643 insertions, 1311 deletions
diff --git a/Build-tools/Bootstrap b/Build-tools/Bootstrap
index c1063363bdf..8cad093bc5f 100755
--- a/Build-tools/Bootstrap
+++ b/Build-tools/Bootstrap
@@ -123,14 +123,16 @@ if (($opt_directory ne $PWD) && (!-d $opt_directory && !$opt_dry_run))
if ($opt_pull)
{
&logger("Updating BK tree $REPO to latest ChangeSet first");
- $command= "cd $REPO; bk pull; cd ..";
- &run_command($command, "Could not update $REPO!");
+ chdir ($REPO) or &abort("Could not chdir to $REPO!");
+ &run_command("bk pull", "Could not update $REPO!");
+ chdir ($PWD) or &abort("Could not chdir to $PWD!");
unless ($opt_skip_manual)
{
&logger("Updating manual tree in $opt_docdir");
- $command= "cd $opt_docdir; bk pull; cd ..";
- &run_command($command, "Could not update $opt_docdir!");
+ chdir ($opt_docdir) or &abort("Could not chdir to $opt_docdir!");
+ &run_command("bk pull", "Could not update $opt_docdir!");
+ chdir ($PWD) or &abort("Could not chdir to $PWD!");
}
}
diff --git a/Build-tools/mysql-copyright b/Build-tools/mysql-copyright
index 77a90fbf4e4..0c091890e72 100755
--- a/Build-tools/mysql-copyright
+++ b/Build-tools/mysql-copyright
@@ -150,20 +150,20 @@ sub main
####
sub fix_mysql_version
{
- chdir("$destdir");
- my $header_file= (-f 'include/mysql_version.h.in')? 'include/mysql_version.h.in' : 'include/mysql_version.h';
-
- open(MYSQL_VERSION,"<$header_file") or die "Unable to open include/mysql_version.h for read: $!\n";
- undef $/;
- my $mysql_version= <MYSQL_VERSION>;
- close(MYSQL_VERSION);
+ chdir("$destdir");
+ my $header_file= (-f 'include/mysql_version.h.in')? 'include/mysql_version.h.in' : 'include/mysql_version.h';
- $mysql_version=~ s/\#define LICENSE[\s\t]+GPL/#define LICENSE Commercial/;
-
- open(MYSQL_VERSION,">$header_file") or die "Unable to open include/mysql_version.h for write: $!\n";
- print MYSQL_VERSION $mysql_version;
- close(MYSQL_VERSION);
- chdir("$cwd");
+ open(MYSQL_VERSION,"<$header_file") or die "Unable to open $header_file for read: $!\n";
+ undef $/;
+ my $mysql_version= <MYSQL_VERSION>;
+ close(MYSQL_VERSION);
+
+ $mysql_version=~ s/\#define LICENSE[\s\t]+GPL/#define LICENSE Commercial/;
+
+ open(MYSQL_VERSION,">$header_file") or die "Unable to open $header_file for write: $!\n";
+ print MYSQL_VERSION $mysql_version;
+ close(MYSQL_VERSION);
+ chdir("$cwd");
}
####
diff --git a/client/mysql.cc b/client/mysql.cc
index 8de9995f173..0b43f9b80ec 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -859,7 +859,7 @@ static int get_options(int argc, char **argv)
opt_max_allowed_packet= *mysql_params->p_max_allowed_packet;
opt_net_buffer_length= *mysql_params->p_net_buffer_length;
- if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, 0)))
+ if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
exit(ho_error);
*mysql_params->p_max_allowed_packet= opt_max_allowed_packet;
@@ -2693,8 +2693,9 @@ char *get_arg(char *line, my_bool get_next_arg)
ptr++;
if (*ptr == '\\') // short command was used
ptr+= 2;
- while (*ptr &&!my_isspace(charset_info, *ptr)) // skip command
- ptr++;
+ else
+ while (*ptr &&!my_isspace(charset_info, *ptr)) // skip command
+ ptr++;
}
if (!*ptr)
return NullS;
diff --git a/client/mysqladmin.c b/client/mysqladmin.c
index d8842d98c6b..df3e8dfed62 100644
--- a/client/mysqladmin.c
+++ b/client/mysqladmin.c
@@ -276,7 +276,7 @@ int main(int argc,char *argv[])
mysql_init(&mysql);
load_defaults("my",load_default_groups,&argc,&argv);
save_argv = argv; /* Save for free_defaults */
- if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, 0)))
+ if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
{
free_defaults(save_argv);
exit(ho_error);
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 6d8ff665393..5f9a499bd31 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -666,7 +666,7 @@ static int parse_args(int *argc, char*** argv)
result_file = stdout;
load_defaults("my",load_default_groups,argc,argv);
- if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
+ if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
return 0;
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index 904b234be64..b072d1c86fe 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -295,7 +295,7 @@ static int get_options(int *argc, char ***argv)
load_defaults("my", load_default_groups, argc, argv);
- if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, 0)))
+ if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
if (!what_to_do)
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 631f328a2f7..c8392e2d502 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -604,7 +604,7 @@ static int get_options(int *argc, char ***argv)
md_result_file= stdout;
load_defaults("my",load_default_groups,argc,argv);
- if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, 0)))
+ if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
*mysql_params->p_max_allowed_packet= opt_max_allowed_packet;
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index 73f7e0a9006..c68d2d9f724 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -228,7 +228,7 @@ static int get_options(int *argc, char ***argv)
{
int ho_error;
- if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, 0)))
+ if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
if (enclosed && opt_enclosed)
diff --git a/client/mysqlmanager-pwgen.c b/client/mysqlmanager-pwgen.c
index 4c6fbf14dd9..1d942e207ad 100644
--- a/client/mysqlmanager-pwgen.c
+++ b/client/mysqlmanager-pwgen.c
@@ -95,7 +95,7 @@ int parse_args(int argc, char** argv)
{
int ho_error;
- if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, NULL)))
+ if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
exit(ho_error);
return 0;
diff --git a/client/mysqlmanagerc.c b/client/mysqlmanagerc.c
index 78485427473..0001a0266e6 100644
--- a/client/mysqlmanagerc.c
+++ b/client/mysqlmanagerc.c
@@ -133,7 +133,7 @@ int parse_args(int argc, char **argv)
load_defaults("my",load_default_groups,&argc,&argv);
default_argv= argv;
- if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, NULL)))
+ if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
exit(ho_error);
return 0;
diff --git a/client/mysqlshow.c b/client/mysqlshow.c
index 5d64c94ef1a..9c9fdf6e443 100644
--- a/client/mysqlshow.c
+++ b/client/mysqlshow.c
@@ -297,7 +297,7 @@ get_options(int *argc,char ***argv)
{
int ho_error;
- if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, 0)))
+ if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
if (tty_password)
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 98818022047..3287c9738d3 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -2100,7 +2100,7 @@ int parse_args(int argc, char **argv)
load_defaults("my",load_default_groups,&argc,&argv);
default_argv= argv;
- if ((handle_options(&argc, &argv, my_long_options, get_one_option, 0)))
+ if ((handle_options(&argc, &argv, my_long_options, get_one_option)))
exit(1);
if (argc > 1)
diff --git a/cmd-line-utils/libedit/Makefile.am b/cmd-line-utils/libedit/Makefile.am
index c6f9ccf06ff..a3d73a7082a 100644
--- a/cmd-line-utils/libedit/Makefile.am
+++ b/cmd-line-utils/libedit/Makefile.am
@@ -24,7 +24,7 @@ pkginclude_HEADERS = readline/readline.h
noinst_HEADERS = chared.h el.h histedit.h key.h parse.h refresh.h sig.h \
sys.h tokenizer.h config.h hist.h map.h prompt.h read.h \
- search.h tty.h libedit_term.h term.h
+ search.h tty.h libedit_term.h
EXTRA_DIST = makelist.sh np/unvis.c np/strlcpy.c np/vis.c np/vis.h np/strlcat.c np/fgetln.c
diff --git a/cmd-line-utils/libedit/el.c b/cmd-line-utils/libedit/el.c
index aa4b5c6896b..1b445d40f1c 100644
--- a/cmd-line-utils/libedit/el.c
+++ b/cmd-line-utils/libedit/el.c
@@ -84,7 +84,7 @@ el_init(const char *prog, FILE *fin, FILE *fout, FILE *ferr)
el_free(el);
return NULL;
}
- (void) key_init(el);
+ (void) el_key_init(el);
(void) map_init(el);
if (tty_init(el) == -1)
el->el_flags |= NO_TTY;
@@ -112,7 +112,7 @@ el_end(EditLine *el)
el_reset(el);
term_end(el);
- key_end(el);
+ el_key_end(el);
map_end(el);
tty_end(el);
ch_end(el);
diff --git a/cmd-line-utils/libedit/el.h b/cmd-line-utils/libedit/el.h
index 9e1731c5857..49bd462ad3b 100644
--- a/cmd-line-utils/libedit/el.h
+++ b/cmd-line-utils/libedit/el.h
@@ -98,7 +98,7 @@ typedef struct el_state_t {
#include "tty.h"
#include "prompt.h"
#include "key.h"
-#include "term.h"
+#include "libedit_term.h"
#include "refresh.h"
#include "chared.h"
#include "common.h"
diff --git a/cmd-line-utils/libedit/key.c b/cmd-line-utils/libedit/key.c
index e1e64e328ad..e75db00ce1b 100644
--- a/cmd-line-utils/libedit/key.c
+++ b/cmd-line-utils/libedit/key.c
@@ -103,14 +103,14 @@ private int key__decode_char(char *, int, int);
* Initialize the key maps
*/
protected int
-key_init(EditLine *el)
+el_key_init(EditLine *el)
{
el->el_key.buf = (char *) el_malloc(KEY_BUFSIZ);
if (el->el_key.buf == NULL)
return (-1);
el->el_key.map = NULL;
- key_reset(el);
+ el_key_reset(el);
return (0);
}
@@ -119,7 +119,7 @@ key_init(EditLine *el)
* Free the key maps
*/
protected void
-key_end(EditLine *el)
+el_key_end(EditLine *el)
{
el_free((ptr_t) el->el_key.buf);
@@ -133,7 +133,7 @@ key_end(EditLine *el)
* Associate cmd with a key value
*/
protected key_value_t *
-key_map_cmd(EditLine *el, int cmd)
+el_key_map_cmd(EditLine *el, int cmd)
{
el->el_key.val.cmd = (el_action_t) cmd;
@@ -145,7 +145,7 @@ key_map_cmd(EditLine *el, int cmd)
* Associate str with a key value
*/
protected key_value_t *
-key_map_str(EditLine *el, char *str)
+el_key_map_str(EditLine *el, char *str)
{
el->el_key.val.str = str;
@@ -159,7 +159,7 @@ key_map_str(EditLine *el, char *str)
* [Always bind the ansi arrow keys?]
*/
protected void
-key_reset(EditLine *el)
+el_key_reset(EditLine *el)
{
node__put(el, el->el_key.map);
@@ -177,7 +177,7 @@ key_reset(EditLine *el)
* The last character read is returned in *ch.
*/
protected int
-key_get(EditLine *el, char *ch, key_value_t *val)
+el_key_get(EditLine *el, char *ch, key_value_t *val)
{
return (node_trav(el, el->el_key.map, ch, val));
@@ -191,7 +191,7 @@ key_get(EditLine *el, char *ch, key_value_t *val)
* out str or a unix command.
*/
protected void
-key_add(EditLine *el, const char *key, key_value_t *val, int ntype)
+el_key_add(EditLine *el, const char *key, key_value_t *val, int ntype)
{
if (key[0] == '\0') {
@@ -219,7 +219,7 @@ key_add(EditLine *el, const char *key, key_value_t *val, int ntype)
*
*/
protected void
-key_clear(EditLine *el, el_action_t *map, const char *in)
+el_key_clear(EditLine *el, el_action_t *map, const char *in)
{
if ((map[(unsigned char)*in] == ED_SEQUENCE_LEAD_IN) &&
@@ -227,7 +227,7 @@ key_clear(EditLine *el, el_action_t *map, const char *in)
el->el_map.alt[(unsigned char)*in] != ED_SEQUENCE_LEAD_IN) ||
(map == el->el_map.alt &&
el->el_map.key[(unsigned char)*in] != ED_SEQUENCE_LEAD_IN)))
- (void) key_delete(el, in);
+ (void) el_key_delete(el, in);
}
@@ -236,7 +236,7 @@ key_clear(EditLine *el, el_action_t *map, const char *in)
* they exists.
*/
protected int
-key_delete(EditLine *el, const char *key)
+el_key_delete(EditLine *el, const char *key)
{
if (key[0] == '\0') {
@@ -257,7 +257,7 @@ key_delete(EditLine *el, const char *key)
* Print entire el->el_key.map if null
*/
protected void
-key_print(EditLine *el, const char *key)
+el_key_print(EditLine *el, const char *key)
{
/* do nothing if el->el_key.map is empty and null key specified */
@@ -504,7 +504,7 @@ node_lookup(EditLine *el, const char *str, key_node_t *ptr, int cnt)
if (str[1] == 0) {
el->el_key.buf[ncnt + 1] = '"';
el->el_key.buf[ncnt + 2] = '\0';
- key_kprint(el, el->el_key.buf,
+ el_key_kprint(el, el->el_key.buf,
&ptr->val, ptr->type);
return (0);
} else
@@ -552,7 +552,7 @@ node_enum(EditLine *el, key_node_t *ptr, int cnt)
/* print this key and function */
el->el_key.buf[ncnt + 1] = '"';
el->el_key.buf[ncnt + 2] = '\0';
- key_kprint(el, el->el_key.buf, &ptr->val, ptr->type);
+ el_key_kprint(el, el->el_key.buf, &ptr->val, ptr->type);
} else
(void) node_enum(el, ptr->next, ncnt + 1);
@@ -568,7 +568,7 @@ node_enum(EditLine *el, key_node_t *ptr, int cnt)
* function specified by val
*/
protected void
-key_kprint(EditLine *el, const char *key, key_value_t *val, int ntype)
+el_key_kprint(EditLine *el, const char *key, key_value_t *val, int ntype)
{
el_bindings_t *fp;
char unparsbuf[EL_BUFSIZ];
@@ -579,7 +579,7 @@ key_kprint(EditLine *el, const char *key, key_value_t *val, int ntype)
case XK_STR:
case XK_EXE:
(void) fprintf(el->el_outfile, fmt, key,
- key__decode_str(val->str, unparsbuf,
+ el_key__decode_str(val->str, unparsbuf,
ntype == XK_STR ? "\"\"" : "[]"));
break;
case XK_CMD:
@@ -644,7 +644,7 @@ key__decode_char(char *buf, int cnt, int ch)
* Make a printable version of the ey
*/
protected char *
-key__decode_str(const char *str, char *buf, const char *sep)
+el_key__decode_str(const char *str, char *buf, const char *sep)
{
char *b;
const char *p;
diff --git a/cmd-line-utils/libedit/key.h b/cmd-line-utils/libedit/key.h
index 80d8626b894..9d83d7c2521 100644
--- a/cmd-line-utils/libedit/key.h
+++ b/cmd-line-utils/libedit/key.h
@@ -62,18 +62,19 @@ typedef struct el_key_t {
#define XK_NOD 2
#define XK_EXE 3
-protected int key_init(EditLine *);
-protected void key_end(EditLine *);
-protected key_value_t *key_map_cmd(EditLine *, int);
-protected key_value_t *key_map_str(EditLine *, char *);
-protected void key_reset(EditLine *);
-protected int key_get(EditLine *, char *, key_value_t *);
-protected void key_add(EditLine *, const char *, key_value_t *, int);
-protected void key_clear(EditLine *, el_action_t *, const char *);
-protected int key_delete(EditLine *, const char *);
-protected void key_print(EditLine *, const char *);
-protected void key_kprint(EditLine *, const char *, key_value_t *,
+protected int el_key_init(EditLine *);
+protected void el_key_end(EditLine *);
+protected key_value_t *el_key_map_cmd(EditLine *, int);
+protected key_value_t *el_key_map_str(EditLine *, char *);
+protected void el_key_reset(EditLine *);
+protected int el_key_get(EditLine *, char *, key_value_t *);
+protected void el_key_add(EditLine *,
+ const char *, key_value_t *, int);
+protected void el_key_clear(EditLine *, el_action_t *, const char *);
+protected int el_key_delete(EditLine *, const char *);
+protected void el_key_print(EditLine *, const char *);
+protected void el_key_kprint(EditLine *, const char *, key_value_t *,
int);
-protected char *key__decode_str(const char *, char *, const char *);
+protected char *el_key__decode_str(const char *, char *, const char *);
#endif /* _h_el_key */
diff --git a/cmd-line-utils/libedit/map.c b/cmd-line-utils/libedit/map.c
index e044e875382..a16625311ae 100644
--- a/cmd-line-utils/libedit/map.c
+++ b/cmd-line-utils/libedit/map.c
@@ -1011,7 +1011,8 @@ map_init_meta(EditLine *el)
break;
default:
buf[1] = i & 0177;
- key_add(el, buf, key_map_cmd(el, (int) map[i]), XK_CMD);
+ el_key_add(el, buf,
+ el_key_map_cmd(el, (int) map[i]), XK_CMD);
break;
}
map[(int) buf[0]] = ED_SEQUENCE_LEAD_IN;
@@ -1033,7 +1034,7 @@ map_init_vi(EditLine *el)
el->el_map.type = MAP_VI;
el->el_map.current = el->el_map.key;
- key_reset(el);
+ el_key_reset(el);
for (i = 0; i < N_KEYS; i++) {
key[i] = vii[i];
@@ -1062,7 +1063,7 @@ map_init_emacs(EditLine *el)
el->el_map.type = MAP_EMACS;
el->el_map.current = el->el_map.key;
- key_reset(el);
+ el_key_reset(el);
for (i = 0; i < N_KEYS; i++) {
key[i] = emacs[i];
@@ -1075,7 +1076,7 @@ map_init_emacs(EditLine *el)
buf[0] = CONTROL('X');
buf[1] = CONTROL('X');
buf[2] = 0;
- key_add(el, buf, key_map_cmd(el, EM_EXCHANGE_MARK), XK_CMD);
+ el_key_add(el, buf, el_key_map_cmd(el, EM_EXCHANGE_MARK), XK_CMD);
tty_bind_char(el, 1);
term_bind_arrow(el);
@@ -1132,7 +1133,7 @@ map_print_key(EditLine *el, el_action_t *map, const char *in)
el_bindings_t *bp;
if (in[0] == '\0' || in[1] == '\0') {
- (void) key__decode_str(in, outbuf, "");
+ (void) el_key__decode_str(in, outbuf, "");
for (bp = el->el_map.help; bp->name != NULL; bp++)
if (bp->func == map[(unsigned char) *in]) {
(void) fprintf(el->el_outfile,
@@ -1140,7 +1141,7 @@ map_print_key(EditLine *el, el_action_t *map, const char *in)
return;
}
} else
- key_print(el, in);
+ el_key_print(el, in);
}
@@ -1162,20 +1163,20 @@ map_print_some_keys(EditLine *el, el_action_t *map, int first, int last)
if (first == last)
(void) fprintf(el->el_outfile,
"%-15s-> is undefined\n",
- key__decode_str(firstbuf, unparsbuf, STRQQ));
+ el_key__decode_str(firstbuf, unparsbuf, STRQQ));
return;
}
for (bp = el->el_map.help; bp->name != NULL; bp++) {
if (bp->func == map[first]) {
if (first == last) {
(void) fprintf(el->el_outfile, "%-15s-> %s\n",
- key__decode_str(firstbuf, unparsbuf, STRQQ),
+ el_key__decode_str(firstbuf, unparsbuf, STRQQ),
bp->name);
} else {
(void) fprintf(el->el_outfile,
"%-4s to %-7s-> %s\n",
- key__decode_str(firstbuf, unparsbuf, STRQQ),
- key__decode_str(lastbuf, extrabuf, STRQQ),
+ el_key__decode_str(firstbuf, unparsbuf, STRQQ),
+ el_key__decode_str(lastbuf, extrabuf, STRQQ),
bp->name);
}
return;
@@ -1229,7 +1230,7 @@ map_print_all_keys(EditLine *el)
map_print_some_keys(el, el->el_map.alt, prev, i - 1);
(void) fprintf(el->el_outfile, "Multi-character bindings\n");
- key_print(el, "");
+ el_key_print(el, "");
(void) fprintf(el->el_outfile, "Arrow key bindings\n");
term_print_arrow(el, "");
}
@@ -1322,9 +1323,9 @@ map_bind(EditLine *el, int argc, const char **argv)
return (-1);
}
if (in[1])
- (void) key_delete(el, in);
+ (void) el_key_delete(el, in);
else if (map[(unsigned char) *in] == ED_SEQUENCE_LEAD_IN)
- (void) key_delete(el, in);
+ (void) el_key_delete(el, in);
else
map[(unsigned char) *in] = ED_UNASSIGNED;
return (0);
@@ -1352,9 +1353,9 @@ map_bind(EditLine *el, int argc, const char **argv)
return (-1);
}
if (key)
- term_set_arrow(el, in, key_map_str(el, out), ntype);
+ term_set_arrow(el, in, el_key_map_str(el, out), ntype);
else
- key_add(el, in, key_map_str(el, out), ntype);
+ el_key_add(el, in, el_key_map_str(el, out), ntype);
map[(unsigned char) *in] = ED_SEQUENCE_LEAD_IN;
break;
@@ -1365,13 +1366,13 @@ map_bind(EditLine *el, int argc, const char **argv)
return (-1);
}
if (key)
- term_set_arrow(el, in, key_map_str(el, out), ntype);
+ term_set_arrow(el, in, el_key_map_str(el, out), ntype);
else {
if (in[1]) {
- key_add(el, in, key_map_cmd(el, cmd), ntype);
+ el_key_add(el, in, el_key_map_cmd(el, cmd), ntype);
map[(unsigned char) *in] = ED_SEQUENCE_LEAD_IN;
} else {
- key_clear(el, map, in);
+ el_key_clear(el, map, in);
map[(unsigned char) *in] = cmd;
}
}
diff --git a/cmd-line-utils/libedit/read.c b/cmd-line-utils/libedit/read.c
index 7567a81e875..5eaa83bf482 100644
--- a/cmd-line-utils/libedit/read.c
+++ b/cmd-line-utils/libedit/read.c
@@ -198,6 +198,10 @@ read_preread(EditLine *el)
return (0);
#ifdef FIONREAD
+
+#ifndef MIN // definition of MIN is lacking on hpux..
+#define MIN(x,y) (((x)<(y))?(x):(y))
+#endif
(void) ioctl(el->el_infd, FIONREAD, (ioctl_t) & chrs);
if (chrs > 0) {
char buf[EL_BUFSIZ];
@@ -262,7 +266,7 @@ read_getcmd(EditLine *el, el_action_t *cmdnum, char *ch)
cmd = el->el_map.current[(unsigned char) *ch];
if (cmd == ED_SEQUENCE_LEAD_IN) {
key_value_t val;
- switch (key_get(el, ch, &val)) {
+ switch (el_key_get(el, ch, &val)) {
case XK_CMD:
cmd = val.cmd;
break;
@@ -459,7 +463,8 @@ el_gets(EditLine *el, int *nread)
#endif /* DEBUG_READ */
break;
}
- if ((uint)cmdnum >= (uint)(el->el_map.nfunc)) { /* BUG CHECK command */
+ if ((unsigned int)cmdnum >= (unsigned int)(el->el_map.nfunc))
+ { /* BUG CHECK command */
#ifdef DEBUG_EDIT
(void) fprintf(el->el_errfile,
"ERROR: illegal command from key 0%o\r\n", ch);
diff --git a/cmd-line-utils/libedit/term.c b/cmd-line-utils/libedit/term.c
index f5fb93394d8..1f90c783a2b 100644
--- a/cmd-line-utils/libedit/term.c
+++ b/cmd-line-utils/libedit/term.c
@@ -67,10 +67,6 @@ __RCSID("$NetBSD: term.c,v 1.35 2002/03/18 16:00:59 christos Exp $");
#include "el.h"
-/* Solaris's term.h does horrid things. */
-#if (defined(HAVE_TERM_H) && !defined(SUNOS))
-#include <term.h>
-#endif
#include <sys/types.h>
#include <sys/ioctl.h>
@@ -1079,32 +1075,32 @@ term_reset_arrow(EditLine *el)
static const char stOH[] = {033, 'O', 'H', '\0'};
static const char stOF[] = {033, 'O', 'F', '\0'};
- key_add(el, strA, &arrow[A_K_UP].fun, arrow[A_K_UP].type);
- key_add(el, strB, &arrow[A_K_DN].fun, arrow[A_K_DN].type);
- key_add(el, strC, &arrow[A_K_RT].fun, arrow[A_K_RT].type);
- key_add(el, strD, &arrow[A_K_LT].fun, arrow[A_K_LT].type);
- key_add(el, strH, &arrow[A_K_HO].fun, arrow[A_K_HO].type);
- key_add(el, strF, &arrow[A_K_EN].fun, arrow[A_K_EN].type);
- key_add(el, stOA, &arrow[A_K_UP].fun, arrow[A_K_UP].type);
- key_add(el, stOB, &arrow[A_K_DN].fun, arrow[A_K_DN].type);
- key_add(el, stOC, &arrow[A_K_RT].fun, arrow[A_K_RT].type);
- key_add(el, stOD, &arrow[A_K_LT].fun, arrow[A_K_LT].type);
- key_add(el, stOH, &arrow[A_K_HO].fun, arrow[A_K_HO].type);
- key_add(el, stOF, &arrow[A_K_EN].fun, arrow[A_K_EN].type);
+ el_key_add(el, strA, &arrow[A_K_UP].fun, arrow[A_K_UP].type);
+ el_key_add(el, strB, &arrow[A_K_DN].fun, arrow[A_K_DN].type);
+ el_key_add(el, strC, &arrow[A_K_RT].fun, arrow[A_K_RT].type);
+ el_key_add(el, strD, &arrow[A_K_LT].fun, arrow[A_K_LT].type);
+ el_key_add(el, strH, &arrow[A_K_HO].fun, arrow[A_K_HO].type);
+ el_key_add(el, strF, &arrow[A_K_EN].fun, arrow[A_K_EN].type);
+ el_key_add(el, stOA, &arrow[A_K_UP].fun, arrow[A_K_UP].type);
+ el_key_add(el, stOB, &arrow[A_K_DN].fun, arrow[A_K_DN].type);
+ el_key_add(el, stOC, &arrow[A_K_RT].fun, arrow[A_K_RT].type);
+ el_key_add(el, stOD, &arrow[A_K_LT].fun, arrow[A_K_LT].type);
+ el_key_add(el, stOH, &arrow[A_K_HO].fun, arrow[A_K_HO].type);
+ el_key_add(el, stOF, &arrow[A_K_EN].fun, arrow[A_K_EN].type);
if (el->el_map.type == MAP_VI) {
- key_add(el, &strA[1], &arrow[A_K_UP].fun, arrow[A_K_UP].type);
- key_add(el, &strB[1], &arrow[A_K_DN].fun, arrow[A_K_DN].type);
- key_add(el, &strC[1], &arrow[A_K_RT].fun, arrow[A_K_RT].type);
- key_add(el, &strD[1], &arrow[A_K_LT].fun, arrow[A_K_LT].type);
- key_add(el, &strH[1], &arrow[A_K_HO].fun, arrow[A_K_HO].type);
- key_add(el, &strF[1], &arrow[A_K_EN].fun, arrow[A_K_EN].type);
- key_add(el, &stOA[1], &arrow[A_K_UP].fun, arrow[A_K_UP].type);
- key_add(el, &stOB[1], &arrow[A_K_DN].fun, arrow[A_K_DN].type);
- key_add(el, &stOC[1], &arrow[A_K_RT].fun, arrow[A_K_RT].type);
- key_add(el, &stOD[1], &arrow[A_K_LT].fun, arrow[A_K_LT].type);
- key_add(el, &stOH[1], &arrow[A_K_HO].fun, arrow[A_K_HO].type);
- key_add(el, &stOF[1], &arrow[A_K_EN].fun, arrow[A_K_EN].type);
+ el_key_add(el, &strA[1], &arrow[A_K_UP].fun, arrow[A_K_UP].type);
+ el_key_add(el, &strB[1], &arrow[A_K_DN].fun, arrow[A_K_DN].type);
+ el_key_add(el, &strC[1], &arrow[A_K_RT].fun, arrow[A_K_RT].type);
+ el_key_add(el, &strD[1], &arrow[A_K_LT].fun, arrow[A_K_LT].type);
+ el_key_add(el, &strH[1], &arrow[A_K_HO].fun, arrow[A_K_HO].type);
+ el_key_add(el, &strF[1], &arrow[A_K_EN].fun, arrow[A_K_EN].type);
+ el_key_add(el, &stOA[1], &arrow[A_K_UP].fun, arrow[A_K_UP].type);
+ el_key_add(el, &stOB[1], &arrow[A_K_DN].fun, arrow[A_K_DN].type);
+ el_key_add(el, &stOC[1], &arrow[A_K_RT].fun, arrow[A_K_RT].type);
+ el_key_add(el, &stOD[1], &arrow[A_K_LT].fun, arrow[A_K_LT].type);
+ el_key_add(el, &stOH[1], &arrow[A_K_HO].fun, arrow[A_K_HO].type);
+ el_key_add(el, &stOF[1], &arrow[A_K_EN].fun, arrow[A_K_EN].type);
}
}
@@ -1158,7 +1154,7 @@ term_print_arrow(EditLine *el, const char *name)
for (i = 0; i < A_K_NKEYS; i++)
if (*name == '\0' || strcmp(name, arrow[i].name) == 0)
if (arrow[i].type != XK_NOD)
- key_kprint(el, arrow[i].name, &arrow[i].fun,
+ el_key_kprint(el, arrow[i].name, &arrow[i].fun,
arrow[i].type);
}
@@ -1199,20 +1195,20 @@ term_bind_arrow(EditLine *el)
* unassigned key.
*/
if (arrow[i].type == XK_NOD)
- key_clear(el, map, p);
+ el_key_clear(el, map, p);
else {
if (p[1] && (dmap[j] == map[j] ||
map[j] == ED_SEQUENCE_LEAD_IN)) {
- key_add(el, p, &arrow[i].fun,
+ el_key_add(el, p, &arrow[i].fun,
arrow[i].type);
map[j] = ED_SEQUENCE_LEAD_IN;
} else if (map[j] == ED_UNASSIGNED) {
- key_clear(el, map, p);
+ el_key_clear(el, map, p);
if (arrow[i].type == XK_CMD)
map[j] = arrow[i].fun.cmd;
else
- key_add(el, p, &arrow[i].fun,
- arrow[i].type);
+ el_key_add(el, p, &arrow[i].fun,
+ arrow[i].type);
}
}
}
@@ -1245,6 +1241,8 @@ term__flush(void)
/* term_telltc():
* Print the current termcap characteristics
*/
+char *el_key__decode_str(const char *, char *, const char *);
+
protected int
/*ARGSUSED*/
term_telltc(EditLine *el, int argc __attribute__((unused)),
@@ -1272,7 +1270,7 @@ term_telltc(EditLine *el, int argc __attribute__((unused)),
(void) fprintf(el->el_outfile, "\t%25s (%s) == %s\n",
t->long_name,
t->name, *ts && **ts ?
- key__decode_str(*ts, upbuf, "") : "(empty)");
+ el_key__decode_str(*ts, upbuf, "") : "(empty)");
(void) fputc('\n', el->el_outfile);
return (0);
}
diff --git a/cmd-line-utils/libedit/term.h b/cmd-line-utils/libedit/term.h
deleted file mode 100644
index 47e08e84bf4..00000000000
--- a/cmd-line-utils/libedit/term.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/* $NetBSD: term.h,v 1.13 2002/03/18 16:01:00 christos Exp $ */
-
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Christos Zoulas of Cornell University.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)term.h 8.1 (Berkeley) 6/4/93
- */
-
-/*
- * el.term.h: Termcap header
- */
-#ifndef _h_el_term
-#define _h_el_term
-
-#include "histedit.h"
-
-typedef struct { /* Symbolic function key bindings */
- const char *name; /* name of the key */
- int key; /* Index in termcap table */
- key_value_t fun; /* Function bound to it */
- int type; /* Type of function */
-} fkey_t;
-
-typedef struct {
- coord_t t_size; /* # lines and cols */
- int t_flags;
-#define TERM_CAN_INSERT 0x001 /* Has insert cap */
-#define TERM_CAN_DELETE 0x002 /* Has delete cap */
-#define TERM_CAN_CEOL 0x004 /* Has CEOL cap */
-#define TERM_CAN_TAB 0x008 /* Can use tabs */
-#define TERM_CAN_ME 0x010 /* Can turn all attrs. */
-#define TERM_CAN_UP 0x020 /* Can move up */
-#define TERM_HAS_META 0x040 /* Has a meta key */
-#define TERM_HAS_AUTO_MARGINS 0x080 /* Has auto margins */
-#define TERM_HAS_MAGIC_MARGINS 0x100 /* Has magic margins */
- char *t_buf; /* Termcap buffer */
- int t_loc; /* location used */
- char **t_str; /* termcap strings */
- int *t_val; /* termcap values */
- char *t_cap; /* Termcap buffer */
- fkey_t *t_fkey; /* Array of keys */
-} el_term_t;
-
-/*
- * fKey indexes
- */
-#define A_K_DN 0
-#define A_K_UP 1
-#define A_K_LT 2
-#define A_K_RT 3
-#define A_K_HO 4
-#define A_K_EN 5
-#define A_K_NKEYS 6
-
-protected void term_move_to_line(EditLine *, int);
-protected void term_move_to_char(EditLine *, int);
-protected void term_clear_EOL(EditLine *, int);
-protected void term_overwrite(EditLine *, const char *, int);
-protected void term_insertwrite(EditLine *, char *, int);
-protected void term_deletechars(EditLine *, int);
-protected void term_clear_screen(EditLine *);
-protected void term_beep(EditLine *);
-protected int term_change_size(EditLine *, int, int);
-protected int term_get_size(EditLine *, int *, int *);
-protected int term_init(EditLine *);
-protected void term_bind_arrow(EditLine *);
-protected void term_print_arrow(EditLine *, const char *);
-protected int term_clear_arrow(EditLine *, const char *);
-protected int term_set_arrow(EditLine *, const char *, key_value_t *, int);
-protected void term_end(EditLine *);
-protected int term_set(EditLine *, const char *);
-protected int term_settc(EditLine *, int, const char **);
-protected int term_telltc(EditLine *, int, const char **);
-protected int term_echotc(EditLine *, int, const char **);
-protected int term__putc(int);
-protected void term__flush(void);
-
-/*
- * Easy access macros
- */
-#define EL_FLAGS (el)->el_term.t_flags
-
-#define EL_CAN_INSERT (EL_FLAGS & TERM_CAN_INSERT)
-#define EL_CAN_DELETE (EL_FLAGS & TERM_CAN_DELETE)
-#define EL_CAN_CEOL (EL_FLAGS & TERM_CAN_CEOL)
-#define EL_CAN_TAB (EL_FLAGS & TERM_CAN_TAB)
-#define EL_CAN_ME (EL_FLAGS & TERM_CAN_ME)
-#define EL_HAS_META (EL_FLAGS & TERM_HAS_META)
-#define EL_HAS_AUTO_MARGINS (EL_FLAGS & TERM_HAS_AUTO_MARGINS)
-#define EL_HAS_MAGIC_MARGINS (EL_FLAGS & TERM_HAS_MAGIC_MARGINS)
-
-#endif /* _h_el_term */
diff --git a/cmd-line-utils/libedit/tty.c b/cmd-line-utils/libedit/tty.c
index 5253fdf87a7..fe81762fb82 100644
--- a/cmd-line-utils/libedit/tty.c
+++ b/cmd-line-utils/libedit/tty.c
@@ -784,15 +784,15 @@ tty_bind_char(EditLine *el, int force)
if (new[0] == old[0] && !force)
continue;
/* Put the old default binding back, and set the new binding */
- key_clear(el, map, (char *)old);
+ el_key_clear(el, map, (char *)old);
map[old[0]] = dmap[old[0]];
- key_clear(el, map, (char *)new);
+ el_key_clear(el, map, (char *)new);
/* MAP_VI == 1, MAP_EMACS == 0... */
map[new[0]] = tp->bind[el->el_map.type];
if (dalt) {
- key_clear(el, alt, (char *)old);
+ el_key_clear(el, alt, (char *)old);
alt[old[0]] = dalt[old[0]];
- key_clear(el, alt, (char *)new);
+ el_key_clear(el, alt, (char *)new);
alt[new[0]] = tp->bind[el->el_map.type + 1];
}
}
diff --git a/configure.in b/configure.in
index 7dfa7ae5e09..9e23b6cf61c 100644
--- a/configure.in
+++ b/configure.in
@@ -1873,13 +1873,6 @@ else
fi
AC_SUBST(TERMCAP_LIB)
-# for libedit 2.6.7
-case "${host}" in
- *-*-solaris2*)
- AC_DEFINE_UNQUOTED(SUNOS, 1, [macro for libedit-2.6.7, current platform is solaris-2])
- ;;
-esac
-
LIBEDIT_LOBJECTS=""
AC_CHECK_FUNC(strunvis, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS unvis.o"])
AC_CHECK_FUNC(strvis, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS vis.o"])
@@ -2450,8 +2443,10 @@ elif test "$extra_charsets" = none; then
CHARSETS="$CHARSETS"
elif test "$extra_charsets" = complex; then
CHARSETS="$CHARSETS $CHARSETS_COMPLEX"
+ AC_DEFINE([DEFINE_ALL_CHARACTER_SETS],1,[all charsets are available])
elif test "$extra_charsets" = all; then
CHARSETS="$CHARSETS $CHARSETS_AVAILABLE"
+ AC_DEFINE([DEFINE_ALL_CHARACTER_SETS],1,[all charsets are available])
else
EXTRA_CHARSETS=`echo $extra_charsets | sed -e 's/,/ /g'`
CHARSETS="$CHARSETS $EXTRA_CHARSETS"
diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c
index a0af98e5f1c..f4da839f8e2 100644
--- a/extra/my_print_defaults.c
+++ b/extra/my_print_defaults.c
@@ -99,7 +99,7 @@ static int get_options(int *argc,char ***argv)
{
int ho_error;
- if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
+ if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
if (*argc < 1)
diff --git a/extra/mysql_waitpid.c b/extra/mysql_waitpid.c
index 0894d81a5ae..c228cc52c8b 100644
--- a/extra/mysql_waitpid.c
+++ b/extra/mysql_waitpid.c
@@ -67,7 +67,7 @@ int main(int argc, char *argv[])
progname= argv[0];
- if (handle_options(&argc, &argv, my_long_options, get_one_option, NULL))
+ if (handle_options(&argc, &argv, my_long_options, get_one_option))
exit(-1);
if (!argv[0] || !argv[1] || (pid= atoi(argv[0])) <= 0 ||
(t= atoi(argv[1])) <= 0)
diff --git a/extra/perror.c b/extra/perror.c
index b029d87040f..a28626fd873 100644
--- a/extra/perror.c
+++ b/extra/perror.c
@@ -157,7 +157,7 @@ static int get_options(int *argc,char ***argv)
{
int ho_error;
- if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
+ if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
if (!*argc && !print_all_codes)
diff --git a/extra/resolve_stack_dump.c b/extra/resolve_stack_dump.c
index 3c26c315dea..06a670b935d 100644
--- a/extra/resolve_stack_dump.c
+++ b/extra/resolve_stack_dump.c
@@ -121,7 +121,7 @@ static int parse_args(int argc, char **argv)
{
int ho_error;
- if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, NULL)))
+ if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
exit(ho_error);
/*
diff --git a/extra/resolveip.c b/extra/resolveip.c
index a995b038770..f8cff2a976c 100644
--- a/extra/resolveip.c
+++ b/extra/resolveip.c
@@ -90,7 +90,7 @@ static int get_options(int *argc,char ***argv)
{
int ho_error;
- if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
+ if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
if (*argc == 0)
diff --git a/include/config-win.h b/include/config-win.h
index 96a155633eb..0ba8dd2cf43 100644
--- a/include/config-win.h
+++ b/include/config-win.h
@@ -151,9 +151,7 @@ typedef uint rf_SetTimer;
#endif
/* ERROR is defined in wingdi.h */
-#ifdef ERROR
#undef ERROR
-#endif
/* We need to close files to break connections on shutdown */
#ifndef SIGNAL_WITH_VIO_CLOSE
diff --git a/include/my_getopt.h b/include/my_getopt.h
index 9d6ef40b399..e6ca1130f85 100644
--- a/include/my_getopt.h
+++ b/include/my_getopt.h
@@ -54,15 +54,15 @@ struct my_option
int app_type; /* To be used by an application */
};
-extern char *disabled_my_option;
-extern my_bool my_getopt_print_errors;
-
typedef my_bool (* my_get_one_option) (int, const struct my_option *, char * );
typedef void (* my_error_reporter) (enum loglevel level, const char *format, ... );
+extern char *disabled_my_option;
+extern my_bool my_getopt_print_errors;
+extern my_error_reporter my_getopt_error_reporter;
+
extern int handle_options (int *argc, char ***argv,
- const struct my_option *longopts, my_get_one_option,
- my_error_reporter );
+ const struct my_option *longopts, my_get_one_option);
extern void my_print_help(const struct my_option *options);
extern void my_print_variables(const struct my_option *options);
extern void my_getopt_register_get_addr(gptr* (*func_addr)(const char *, uint,
diff --git a/include/my_time.h b/include/my_time.h
index 6c53e39d1d8..d4dbe459c3b 100644
--- a/include/my_time.h
+++ b/include/my_time.h
@@ -58,6 +58,8 @@ void init_time(void);
my_time_t
my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap);
+void set_zero_time(MYSQL_TIME *tm);
+
C_MODE_END
#endif /* _my_time_h_ */
diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c
index fd12759ad0a..2e8c3adf94f 100644
--- a/innobase/row/row0mysql.c
+++ b/innobase/row/row0mysql.c
@@ -2337,21 +2337,6 @@ row_drop_table_for_mysql(
srv_print_innodb_table_monitor = FALSE;
}
- ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
- ut_a(name != NULL);
-
- if (srv_created_new_raw) {
- fputs(
- "InnoDB: A new raw disk partition was initialized or\n"
- "InnoDB: innodb_force_recovery is on: we do not allow\n"
- "InnoDB: database modifications by the user. Shut down\n"
- "InnoDB: mysqld and edit my.cnf so that newraw is replaced\n"
- "InnoDB: with raw, and innodb_force_... is removed.\n",
- stderr);
-
- return(DB_ERROR);
- }
-
quoted_name = mem_strdupq(name, '\'');
namelen = strlen(quoted_name);
sql = mem_alloc((sizeof str1) + (sizeof str2) - 2 + 1 + namelen);
diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
index 3d49a594924..4a0335086f0 100644
--- a/innobase/srv/srv0start.c
+++ b/innobase/srv/srv0start.c
@@ -1587,9 +1587,10 @@ NetWare. */
fprintf(stderr,
"InnoDB: You have now successfully upgraded to the multiple tablespaces\n"
-"InnoDB: format. You should NOT DOWNGRADE again to an earlier version of\n"
-"InnoDB: InnoDB! But if you absolutely need to downgrade, see section 4.6 of\n"
-"InnoDB: http://www.innodb.com/ibman.php for instructions.\n");
+"InnoDB: format. You should NOT DOWNGRADE to an earlier version of\n"
+"InnoDB: InnoDB! But if you absolutely need to downgrade, see\n"
+"InnoDB: http://dev.mysql.com/doc/mysql/en/Multiple_tablespaces.html\n"
+"InnoDB: for instructions.\n");
}
if (srv_force_recovery == 0) {
diff --git a/isam/isamchk.c b/isam/isamchk.c
index c0ba810ef64..5dd20c14063 100644
--- a/isam/isamchk.c
+++ b/isam/isamchk.c
@@ -671,7 +671,7 @@ static void get_options(register int *argc, register char ***argv)
if (isatty(fileno(stdout)))
testflag|=T_WRITE_LOOP;
- if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
+ if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
if (*argc == 0)
diff --git a/isam/pack_isam.c b/isam/pack_isam.c
index 6e03df100a2..aa83b2b2a96 100644
--- a/isam/pack_isam.c
+++ b/isam/pack_isam.c
@@ -337,7 +337,7 @@ static void get_options(int *argc, char ***argv)
{
int ho_error;
- if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
+ if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
my_progname= argv[0][0];
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 380e53d7d47..7d71998f37d 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -3167,13 +3167,6 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
Fetch and conversion of result set rows (binary protocol).
*********************************************************************/
-static void set_zero_time(MYSQL_TIME *tm)
-{
- bzero((void *)tm, sizeof(*tm));
- tm->time_type= MYSQL_TIMESTAMP_NONE;
-}
-
-
/*
Read date, (time, datetime) value from network buffer and store it
in MYSQL_TIME structure.
diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index a1c3698b3e9..1f6089d0a3c 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -1585,7 +1585,7 @@ int mi_sort_index(MI_CHECK *param, register MI_INFO *info, my_string name)
int old_lock;
MYISAM_SHARE *share=info->s;
MI_STATE_INFO old_state;
- DBUG_ENTER("sort_index");
+ DBUG_ENTER("mi_sort_index");
if (!(param->testflag & T_SILENT))
printf("- Sorting index for MyISAM-table '%s'\n",name);
@@ -1664,7 +1664,7 @@ err:
err2:
VOID(my_delete(param->temp_filename,MYF(MY_WME)));
DBUG_RETURN(-1);
-} /* sort_index */
+} /* mi_sort_index */
/* Sort records recursive using one index */
@@ -1672,7 +1672,7 @@ err2:
static int sort_one_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
my_off_t pagepos, File new_file)
{
- uint length,nod_flag,used_length;
+ uint length,nod_flag,used_length, key_length;
uchar *buff,*keypos,*endpos;
uchar key[MI_MAX_POSSIBLE_KEY_BUFF];
my_off_t new_page_pos,next_page;
@@ -1693,7 +1693,7 @@ static int sort_one_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
llstr(pagepos,llbuff));
goto err;
}
- if ((nod_flag=mi_test_if_nod(buff)))
+ if ((nod_flag=mi_test_if_nod(buff)) || keyinfo->flag & HA_FULLTEXT)
{
used_length=mi_getint(buff);
keypos=buff+2+nod_flag;
@@ -1704,7 +1704,7 @@ static int sort_one_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
{
next_page=_mi_kpos(nod_flag,keypos);
_mi_kpointer(info,keypos-nod_flag,param->new_file_pos); /* Save new pos */
- if (sort_one_index(param,info,keyinfo,next_page, new_file))
+ if (sort_one_index(param,info,keyinfo,next_page,new_file))
{
DBUG_PRINT("error",("From page: %ld, keyoffset: %d used_length: %d",
(ulong) pagepos, (int) (keypos - buff),
@@ -1714,11 +1714,25 @@ static int sort_one_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
}
}
if (keypos >= endpos ||
- ((*keyinfo->get_key)(keyinfo,nod_flag,&keypos,key)) == 0)
+ (key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&keypos,key)) == 0)
break;
-#ifdef EXTRA_DEBUG
- assert(keypos <= endpos);
-#endif
+ DBUG_ASSERT(keypos <= endpos);
+ if (keyinfo->flag & HA_FULLTEXT)
+ {
+ uint off;
+ int subkeys;
+ get_key_full_length_rdonly(off, key);
+ subkeys=ft_sintXkorr(key+off);
+ if (subkeys < 0)
+ {
+ next_page= _mi_dpos(info,0,key+key_length);
+ _mi_dpointer(info,keypos-nod_flag-info->s->rec_reflength,
+ param->new_file_pos); /* Save new pos */
+ if (sort_one_index(param,info,&info->s->ft2_keyinfo,
+ next_page,new_file))
+ goto err;
+ }
+ }
}
}
diff --git a/myisam/mi_test1.c b/myisam/mi_test1.c
index 5574eaba101..77c4d3dfbad 100644
--- a/myisam/mi_test1.c
+++ b/myisam/mi_test1.c
@@ -644,7 +644,7 @@ static void get_options(int argc, char *argv[])
{
int ho_error;
- if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, NULL)))
+ if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
exit(ho_error);
return;
diff --git a/myisam/myisam_ftdump.c b/myisam/myisam_ftdump.c
index cbc8437da79..8219c19848a 100644
--- a/myisam/myisam_ftdump.c
+++ b/myisam/myisam_ftdump.c
@@ -68,7 +68,7 @@ int main(int argc,char *argv[])
struct { MI_INFO *info; } aio0, *aio=&aio0; /* for GWS_IN_USE */
MY_INIT(argv[0]);
- if ((error=handle_options(&argc, &argv, my_long_options, get_one_option, 0)))
+ if (error=handle_options(&argc, &argv, my_long_options, get_one_option))
exit(error);
if (count || dump)
verbose=0;
diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c
index 649b28a93e3..98cbc838d31 100644
--- a/myisam/myisamchk.c
+++ b/myisam/myisamchk.c
@@ -696,7 +696,7 @@ static void get_options(register int *argc,register char ***argv)
if (isatty(fileno(stdout)))
check_param.testflag|=T_WRITE_LOOP;
- if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
+ if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
/* If using repair, then update checksum if one uses --update-state */
diff --git a/myisam/myisampack.c b/myisam/myisampack.c
index d3241467d23..de4bd80805a 100644
--- a/myisam/myisampack.c
+++ b/myisam/myisampack.c
@@ -350,7 +350,7 @@ static void get_options(int *argc,char ***argv)
if (isatty(fileno(stdout)))
write_loop=1;
- if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
+ if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
if (!*argc)
diff --git a/myisammrg/myrg_open.c b/myisammrg/myrg_open.c
index 4c6ffb98ad5..a59ccb7d966 100644
--- a/myisammrg/myrg_open.c
+++ b/myisammrg/myrg_open.c
@@ -34,14 +34,17 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
{
int save_errno,errpos=0;
uint files=0,i,dir_length,length,key_parts;
- ulonglong file_offset;
+ ulonglong file_offset=0;
char name_buff[FN_REFLEN*2],buff[FN_REFLEN],*end;
MYRG_INFO *m_info=0;
File fd;
IO_CACHE file;
MI_INFO *isam=0;
+ uint found_merge_insert_method= 0;
DBUG_ENTER("myrg_open");
+ LINT_INIT(key_parts);
+
bzero((char*) &file,sizeof(file));
if ((fd=my_open(fn_format(name_buff,name,"",MYRG_NAME_EXT,4),
O_RDONLY | O_SHARE,MYF(0))) < 0)
@@ -69,10 +72,10 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
continue; /* Skip empty lines */
if (buff[0] == '#')
{
- if( !strncmp(buff+1,"INSERT_METHOD=",14))
+ if (!strncmp(buff+1,"INSERT_METHOD=",14))
{ /* Lookup insert method */
int tmp=find_type(buff+15,&merge_insert_method,2);
- m_info->merge_insert_method = (uint) (tmp >= 0 ? tmp : 0);
+ found_merge_insert_method = (uint) (tmp >= 0 ? tmp : 0);
}
continue; /* Skip comments */
}
@@ -84,8 +87,8 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
VOID(cleanup_dirname(buff,name_buff));
}
if (!(isam=mi_open(buff,mode,(handle_locking?HA_OPEN_WAIT_IF_LOCKED:0))))
- goto err;
- if (!m_info)
+ goto err;
+ if (!m_info) /* First file */
{
key_parts=isam->s->base.key_parts;
if (!(m_info= (MYRG_INFO*) my_malloc(sizeof(MYRG_INFO) +
@@ -97,15 +100,10 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
{
m_info->open_tables=(MYRG_TABLE *) (m_info+1);
m_info->rec_per_key_part=(ulong *) (m_info->open_tables+files);
+ m_info->tables= files;
+ files= 0;
}
- else
- {
- m_info->open_tables=0;
- m_info->rec_per_key_part=0;
- }
- m_info->tables=files;
m_info->reclength=isam->s->base.reclength;
- file_offset=files=0;
errpos=3;
}
m_info->open_tables[files].table= isam;
@@ -122,14 +120,16 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
m_info->del+= isam->state->del;
m_info->data_file_length+= isam->state->data_file_length;
for (i=0; i < key_parts; i++)
- m_info->rec_per_key_part[i]+=isam->s->state.rec_per_key_part[i] / m_info->tables;
+ m_info->rec_per_key_part[i]+= (isam->s->state.rec_per_key_part[i] /
+ m_info->tables);
}
if (!m_info && !(m_info= (MYRG_INFO*) my_malloc(sizeof(MYRG_INFO),
- MYF(MY_WME|MY_ZEROFILL))))
+ MYF(MY_WME | MY_ZEROFILL))))
goto err;
/* Don't mark table readonly, for ALTER TABLE ... UNION=(...) to work */
m_info->options&= ~(HA_OPTION_COMPRESS_RECORD | HA_OPTION_READ_ONLY_DATA);
+ m_info->merge_insert_method= found_merge_insert_method;
if (sizeof(my_off_t) == 4 && file_offset > (ulonglong) (ulong) ~0L)
{
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh
index 454dc7b327b..41dc3c419f0 100644
--- a/mysql-test/mysql-test-run.sh
+++ b/mysql-test/mysql-test-run.sh
@@ -438,7 +438,7 @@ SLAVE_MYERR="$MYSQL_TEST_DIR/var/log/slave.err"
CURRENT_TEST="$MYSQL_TEST_DIR/var/log/current_test"
SMALL_SERVER="--key_buffer_size=1M --sort_buffer=256K --max_heap_table_size=1M"
-export MASTER_MYPORT SLAVE_MYPORT MYSQL_TCP_PORT
+export MASTER_MYPORT SLAVE_MYPORT MYSQL_TCP_PORT MASTER_MYSOCK
if [ x$SOURCE_DIST = x1 ] ; then
MY_BASEDIR=$MYSQL_TEST_DIR
@@ -525,13 +525,6 @@ else
fi
fi
-MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
-MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR $EXTRA_MYSQLBINLOG_OPT"
-MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose"
-MYSQL="$MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD"
-export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR
-
-
if [ -z "$MASTER_MYSQLD" ]
then
MASTER_MYSQLD=$MYSQLD
@@ -564,6 +557,12 @@ then
fi
+MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
+MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR $EXTRA_MYSQLBINLOG_OPT"
+MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose"
+MYSQL="$MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD"
+export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR
+
MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \
--user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \
--tmpdir=$MYSQL_TMP_DIR --port=$MASTER_MYPORT $MYSQL_TEST_SSL_OPTS"
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index 699485ff3f7..92c825f547d 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -1,5 +1,5 @@
drop table if exists t1,t2,t3;
-drop database if exists test_$1;
+drop database if exists mysqltest;
create table t1 (b char(0));
insert into t1 values (""),(null);
select * from t1;
@@ -58,18 +58,18 @@ select 1ea10.1a20,1e+ 1e+10 from 1ea10;
drop table 1ea10;
create table t1 (t1.index int);
drop table t1;
-drop database if exists test_$1;
+drop database if exists mysqltest;
Warnings:
-Note 1008 Can't drop database 'test_$1'; database doesn't exist
-create database test_$1;
-create table test_$1.$test1 (a$1 int, $b int, c$ int);
-insert into test_$1.$test1 values (1,2,3);
-select a$1, $b, c$ from test_$1.$test1;
+Note 1008 Can't drop database 'mysqltest'; database doesn't exist
+create database mysqltest;
+create table mysqltest.$test1 (a$1 int, $b int, c$ int);
+insert into mysqltest.$test1 values (1,2,3);
+select a$1, $b, c$ from mysqltest.$test1;
a$1 $b c$
1 2 3
-create table test_$1.test2$ (a int);
-drop table test_$1.test2$;
-drop database test_$1;
+create table mysqltest.test2$ (a int);
+drop table mysqltest.test2$;
+drop database mysqltest;
create table `` (a int);
ERROR 42000: Incorrect table name ''
drop table if exists ``;
@@ -320,9 +320,9 @@ t3 CREATE TABLE `t3` (
select * from t3;
id name
drop table t2, t3;
-create database test_$1;
-create table test_$1.t3 like t1;
-create temporary table t3 like test_$1.t3;
+create database mysqltest;
+create table mysqltest.t3 like t1;
+create temporary table t3 like mysqltest.t3;
show create table t3;
Table Create Table
t3 CREATE TEMPORARY TABLE `t3` (
@@ -339,7 +339,7 @@ t2 CREATE TABLE `t2` (
select * from t2;
id name
create table t3 like t1;
-create table t3 like test_$1.t3;
+create table t3 like mysqltest.t3;
ERROR 42S01: Table 't3' already exists
create table non_existing_database.t1 like t1;
Got one of the listed errors
@@ -351,7 +351,7 @@ create table t3 like `a/a`;
ERROR 42000: Incorrect table name 'a/a'
drop table t1, t2, t3;
drop table t3;
-drop database test_$1;
+drop database mysqltest;
SET SESSION storage_engine="heap";
SELECT @@storage_engine;
@@storage_engine
@@ -488,12 +488,12 @@ Note 1291 Column 'cset' has duplicated value 'b' in SET
Note 1291 Column 'cset' has duplicated value 'B' in SET
Note 1291 Column 'cset' has duplicated value 'd' in SET
drop table t1, t2, t3;
-create database test_$1;
-use test_$1;
+create database mysqltest;
+use mysqltest;
select database();
database()
-test_$1
-drop database test_$1;
+mysqltest
+drop database mysqltest;
select database();
database()
NULL
diff --git a/mysql-test/r/fulltext2.result b/mysql-test/r/fulltext2.result
index 0fdb7d4dbd1..0b1d8eb9a15 100644
--- a/mysql-test/r/fulltext2.result
+++ b/mysql-test/r/fulltext2.result
@@ -7,6 +7,15 @@ FULLTEXT KEY (a)
repair table t1 quick;
Table Op Msg_type Msg_text
test.t1 repair status OK
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
select count(*) from t1 where match a against ('aaaxxx');
count(*)
260
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index 5c98bc5b612..e0883a6297e 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -18,7 +18,7 @@ explain extended select grp,group_concat(c) from t1 group by grp;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort
Warnings:
-Note 1003 select test.t1.grp AS `grp`,group_concat(test.t1.c seperator ',') AS `group_concat(c)` from test.t1 group by test.t1.grp
+Note 1003 select test.t1.grp AS `grp`,group_concat(test.t1.c separator ',') AS `group_concat(c)` from test.t1 group by test.t1.grp
select grp,group_concat(a,c) from t1 group by grp;
grp group_concat(a,c)
1 1a
@@ -93,7 +93,7 @@ explain extended select grp,group_concat(distinct c order by c desc) from t1 gro
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort
Warnings:
-Note 1003 select test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c seperator ',') AS `group_concat(distinct c order by c desc)` from test.t1 group by test.t1.grp
+Note 1003 select test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c separator ',') AS `group_concat(distinct c order by c desc)` from test.t1 group by test.t1.grp
select grp,group_concat(c order by c separator ",") from t1 group by grp;
grp group_concat(c order by c separator ",")
1 a
@@ -113,7 +113,7 @@ explain extended select grp,group_concat(distinct c order by c separator ",") fr
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort
Warnings:
-Note 1003 select test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c seperator ',') AS `group_concat(distinct c order by c separator ",")` from test.t1 group by test.t1.grp
+Note 1003 select test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c separator ',') AS `group_concat(distinct c order by c separator ",")` from test.t1 group by test.t1.grp
select grp,group_concat(distinct c order by c desc separator ",") from t1 group by grp;
grp group_concat(distinct c order by c desc separator ",")
1 a
diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result
index f66b3dea94b..374affce8c5 100644
--- a/mysql-test/r/func_in.result
+++ b/mysql-test/r/func_in.result
@@ -148,6 +148,16 @@ id select_type table type possible_keys key key_len ref rows Extra
Warnings:
Note 1003 select test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c` from test.t1 where (_latin1'a' in (test.t1.a,test.t1.b,(test.t1.c collate _latin1'latin1_bin')))
drop table t1;
+set names utf8;
+create table t1 (a char(10) character set utf8 not null);
+insert into t1 values ('bbbb'),(_koi8r'ÃÃÃÃ'),(_latin1'ÄÄÄÄ');
+select a from t1 where a in ('bbbb',_koi8r'ÃÃÃÃ',_latin1'ÄÄÄÄ') order by a;
+a
+ÄÄÄÄ
+bbbb
+цццц
+drop table t1;
+set names latin1;
select '1.0' in (1,2);
'1.0' in (1,2)
1
diff --git a/mysql-test/r/lowercase_table.result b/mysql-test/r/lowercase_table.result
index 2f71e4c2f57..a30ec0f160c 100644
--- a/mysql-test/r/lowercase_table.result
+++ b/mysql-test/r/lowercase_table.result
@@ -1,4 +1,6 @@
drop table if exists t1,t2,t3,t4;
+drop table if exists t0,t5,t6,t7,t8,t9;
+drop database if exists mysqltest;
create table T1 (id int primary key, Word varchar(40) not null, Index(Word));
create table t4 (id int primary key, Word varchar(40) not null);
INSERT INTO T1 VALUES (1, 'a'), (2, 'b'), (3, 'c');
@@ -42,6 +44,26 @@ select count(bags.a) from t1 as Bags;
count(bags.a)
0
drop table t1;
+create database mysqltest;
+use MYSQLTEST;
+create table t1 (a int);
+select T1.a from MYSQLTEST.T1;
+a
+select t1.a from MYSQLTEST.T1;
+a
+select mysqltest.t1.* from MYSQLTEST.t1;
+a
+select MYSQLTEST.t1.* from MYSQLTEST.t1;
+a
+select MYSQLTEST.T1.* from MYSQLTEST.T1;
+a
+select MYSQLTEST.T1.* from T1;
+a
+alter table t1 rename to T1;
+select MYSQLTEST.t1.* from MYSQLTEST.t1;
+a
+drop database mysqltest;
+use test;
create table t1 (a int);
create table t2 (a int);
delete p1.*,P2.* from t1 as p1, t2 as p2 where p1.a=P2.a;
@@ -58,10 +80,3 @@ ERROR 42000: Not unique table/alias: 'C'
drop table t1, t2;
show tables;
Tables_in_test
-create table t1 (a int);
-select TEST.t1.* from TEST.t1;
-a
-alter table t1 rename to T1;
-select TEST.t1.* from TEST.t1;
-a
-drop table t1;
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index 83f8230f11c..5755033190b 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -642,3 +642,12 @@ x y
1 3
1 2
drop table t1,t2,t3;
+create table t1 (a int);
+create table t2 (a int);
+insert into t1 values (0);
+insert into t2 values (1);
+create table t3 engine=merge union=(t1, t2) select * from t1;
+ERROR HY000: You can't specify target table 't1' for update in FROM clause
+create table t3 engine=merge union=(t1, t2) select * from t2;
+ERROR HY000: You can't specify target table 't2' for update in FROM clause
+drop table t1, t2;
diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result
index f5815cc11d9..80e1aa7939a 100644
--- a/mysql-test/r/ndb_basic.result
+++ b/mysql-test/r/ndb_basic.result
@@ -1,5 +1,5 @@
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
-drop database if exists test2;
+drop database if exists mysqltest;
CREATE TABLE t1 (
pk1 INT NOT NULL PRIMARY KEY,
attr1 INT NOT NULL,
@@ -369,8 +369,8 @@ attr2 INT,
attr3 VARCHAR(10)
) ENGINE=ndbcluster;
INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9411,9413, 17, '9413');
-create database test2;
-use test2;
+create database mysqltest;
+use mysqltest;
CREATE TABLE t2 (
a bigint unsigned NOT NULL PRIMARY KEY,
b int unsigned not null,
@@ -388,4 +388,4 @@ select b,test.t1.attr1 from test.t1, t2 where test.t1.pk1 < a;
b attr1
9413 9412
drop table test.t1, t2;
-drop database test2;
+drop database mysqltest;
diff --git a/mysql-test/r/ndb_blob.result b/mysql-test/r/ndb_blob.result
index a9731f97d6b..4244c05e446 100644
--- a/mysql-test/r/ndb_blob.result
+++ b/mysql-test/r/ndb_blob.result
@@ -93,6 +93,9 @@ a length(b) substr(b,1+4*900,2) length(d) substr(d,1+6*900,3)
2 4512 b1 6000 dd1
update t1 set d=null where a=1;
commit;
+select a from t1 where d is null;
+a
+1
delete from t1 where a=1;
delete from t1 where a=2;
commit;
@@ -372,3 +375,5 @@ rollback;
select count(*) from t1;
count(*)
0
+drop table t1;
+drop database mysqltest;
diff --git a/mysql-test/r/ndb_transaction.result b/mysql-test/r/ndb_transaction.result
index 18cbf3e731b..691b91b1d36 100644
--- a/mysql-test/r/ndb_transaction.result
+++ b/mysql-test/r/ndb_transaction.result
@@ -1,5 +1,5 @@
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
-drop database if exists test2;
+drop database if exists mysqltest;
CREATE TABLE t1 (
pk1 INT NOT NULL PRIMARY KEY,
attr1 INT NOT NULL
@@ -211,8 +211,8 @@ CREATE TABLE t1 (
pk1 INT NOT NULL PRIMARY KEY,
attr1 INT NOT NULL
) ENGINE=ndbcluster;
-create database test2;
-use test2;
+create database mysqltest;
+use mysqltest;
CREATE TABLE t2 (
a bigint unsigned NOT NULL PRIMARY KEY,
b int unsigned not null,
@@ -254,4 +254,4 @@ select count(*) from t2;
count(*)
0
drop table test.t1, t2;
-drop database test2;
+drop database mysqltest;
diff --git a/mysql-test/r/negation_elimination.result b/mysql-test/r/negation_elimination.result
index a3a2bad7ec6..9193a125cd1 100644
--- a/mysql-test/r/negation_elimination.result
+++ b/mysql-test/r/negation_elimination.result
@@ -375,4 +375,17 @@ a
13
14
15
+delete from t1 where a > 3;
+select a, not(not(a)) from t1;
+a not(not(a))
+NULL NULL
+0 0
+1 1
+2 1
+3 1
+explain extended select a, not(not(a)), not(a <= 2 and not(a)), not(a not like "1"), not (a not in (1,2)), not(a != 2) from t1 where not(not(a)) having not(not(a));
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 5 NULL 5 Using where; Using index
+Warnings:
+Note 1003 select test.t1.a AS `a`,(test.t1.a <> 0) AS `not(not(a))`,((test.t1.a > 2) or test.t1.a) AS `not(a <= 2 and not(a))`,(test.t1.a like _latin1'1') AS `not(a not like "1")`,(test.t1.a in (1,2)) AS `not (a not in (1,2))`,(test.t1.a = 2) AS `not(a != 2)` from test.t1 where test.t1.a having test.t1.a
drop table t1;
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index e161904cd6f..321b8894796 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -259,3 +259,14 @@ execute `ü`;
1234
1234
set names default;
+create table t1 (a varchar(10)) charset=utf8;
+insert into t1 (a) values ('yahoo');
+set character_set_connection=latin1;
+prepare stmt from 'select a from t1 where a like ?';
+set @var='google';
+execute stmt using @var;
+a
+execute stmt using @var;
+a
+deallocate prepare stmt;
+drop table t1;
diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result
index 9ef1202a9a1..e9a5f705fa7 100644
--- a/mysql-test/r/ps_1general.result
+++ b/mysql-test/r/ps_1general.result
@@ -334,12 +334,12 @@ prepare stmt1 from ' deallocate prepare never_prepared ' ;
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 'never_prepared' at line 1
prepare stmt4 from ' use test ' ;
ERROR HY000: This command is not supported in the prepared statement protocol yet
-prepare stmt3 from ' create database drop_me ';
+prepare stmt3 from ' create database mysqltest ';
ERROR HY000: This command is not supported in the prepared statement protocol yet
-create database drop_me ;
-prepare stmt3 from ' drop database drop_me ';
+create database mysqltest ;
+prepare stmt3 from ' drop database mysqltest ';
ERROR HY000: This command is not supported in the prepared statement protocol yet
-drop database drop_me ;
+drop database mysqltest ;
prepare stmt3 from ' grant all on test.t1 to drop_user@localhost
identified by ''looser'' ';
ERROR HY000: This command is not supported in the prepared statement protocol yet
diff --git a/mysql-test/r/rename.result b/mysql-test/r/rename.result
index 9bcf1bc7f97..ec36f015412 100644
--- a/mysql-test/r/rename.result
+++ b/mysql-test/r/rename.result
@@ -1,4 +1,5 @@
drop table if exists t0,t1,t2,t3,t4;
+drop table if exists t0,t5,t6,t7,t8,t9;
create table t0 SELECT 1,"table 1";
create table t2 SELECT 2,"table 2";
create table t3 SELECT 3,"table 3";
diff --git a/mysql-test/r/rpl_charset.result b/mysql-test/r/rpl_charset.result
index d5f8ac4f293..a60c9269625 100644
--- a/mysql-test/r/rpl_charset.result
+++ b/mysql-test/r/rpl_charset.result
@@ -4,41 +4,41 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-drop database if exists test2;
-drop database if exists test3;
-create database test2 character set latin2;
+drop database if exists mysqltest2;
+drop database if exists mysqltest3;
+create database mysqltest2 character set latin2;
set @@character_set_server=latin5;
-create database test3;
+create database mysqltest3;
--- --master--
-show create database test2;
+show create database mysqltest2;
Database Create Database
-test2 CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET latin2 */
-show create database test3;
+mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */
+show create database mysqltest3;
Database Create Database
-test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET latin5 */
+mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */
--- --slave--
-show create database test2;
+show create database mysqltest2;
Database Create Database
-test2 CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET latin2 */
-show create database test3;
+mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */
+show create database mysqltest3;
Database Create Database
-test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET latin5 */
+mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */
set @@collation_server=armscii8_bin;
-drop database test3;
-create database test3;
+drop database mysqltest3;
+create database mysqltest3;
--- --master--
-show create database test3;
+show create database mysqltest3;
Database Create Database
-test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
+mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
--- --slave--
-show create database test3;
+show create database mysqltest3;
Database Create Database
-test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
-use test2;
+mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
+use mysqltest2;
create table t1 (a int auto_increment primary key, b varchar(100));
set character_set_client=cp850, collation_connection=latin2_croatian_ci;
insert into t1 (b) values(@@character_set_server);
@@ -57,7 +57,7 @@ a b
5 latin2_croatian_ci
--- --slave--
-select * from test2.t1 order by a;
+select * from mysqltest2.t1 order by a;
a b
1 armscii8
2 armscii8_bin
@@ -81,7 +81,7 @@ a b
4 Müller
--- --slave--
-select * from test2.t1 order by a;
+select * from mysqltest2.t1 order by a;
a b
1 latin1_german1_ci
2 Muffler
@@ -98,69 +98,69 @@ a b
1 cp850_general_ci
--- --slave--
-select * from test2.t1 order by a;
+select * from mysqltest2.t1 order by a;
a b
1 cp850_general_ci
-drop database test2;
-drop database test3;
+drop database mysqltest2;
+drop database mysqltest3;
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
-master-bin.000001 79 Query 1 79 use `test`; drop database if exists test2
-master-bin.000001 143 Query 1 143 use `test`; drop database if exists test3
-master-bin.000001 207 Query 1 207 use `test`; create database test2 character set latin2
-master-bin.000001 284 Query 1 284 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=30
-master-bin.000001 418 Query 1 418 use `test`; create database test3
-master-bin.000001 474 Query 1 474 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64
-master-bin.000001 608 Query 1 608 use `test`; drop database test3
-master-bin.000001 662 Query 1 662 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64
-master-bin.000001 796 Query 1 796 use `test`; create database test3
-master-bin.000001 852 Query 1 852 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=9,COLLATION_SERVER=64
-master-bin.000001 987 Query 1 987 use `test2`; create table t1 (a int auto_increment primary key, b varchar(100))
-master-bin.000001 1089 Query 1 1089 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
-master-bin.000001 1225 Intvar 1 1225 INSERT_ID=1
-master-bin.000001 1253 Query 1 1253 use `test2`; insert into t1 (b) values(@@character_set_server)
-master-bin.000001 1338 Query 1 1338 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
-master-bin.000001 1474 Intvar 1 1474 INSERT_ID=2
-master-bin.000001 1502 Query 1 1502 use `test2`; insert into t1 (b) values(@@collation_server)
-master-bin.000001 1583 Query 1 1583 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
-master-bin.000001 1719 Intvar 1 1719 INSERT_ID=3
-master-bin.000001 1747 Query 1 1747 use `test2`; insert into t1 (b) values(@@character_set_client)
-master-bin.000001 1832 Query 1 1832 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
-master-bin.000001 1968 Intvar 1 1968 INSERT_ID=4
-master-bin.000001 1996 Query 1 1996 use `test2`; insert into t1 (b) values(@@character_set_connection)
-master-bin.000001 2085 Query 1 2085 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
-master-bin.000001 2221 Intvar 1 2221 INSERT_ID=5
-master-bin.000001 2249 Query 1 2249 use `test2`; insert into t1 (b) values(@@collation_connection)
-master-bin.000001 2334 Query 1 2334 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
-master-bin.000001 2469 Query 1 2469 use `test2`; truncate table t1
-master-bin.000001 2522 Query 1 2522 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
-master-bin.000001 2657 Intvar 1 2657 INSERT_ID=1
-master-bin.000001 2685 Query 1 2685 use `test2`; insert into t1 (b) values(@@collation_connection)
-master-bin.000001 2770 Query 1 2770 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
-master-bin.000001 2905 Intvar 1 2905 INSERT_ID=2
-master-bin.000001 2933 Query 1 2933 use `test2`; insert into t1 (b) values(LEAST("Müller","Muffler"))
-master-bin.000001 3021 Query 1 3021 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
-master-bin.000001 3157 Intvar 1 3157 INSERT_ID=3
-master-bin.000001 3185 Query 1 3185 use `test2`; insert into t1 (b) values(@@collation_connection)
-master-bin.000001 3270 Query 1 3270 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
-master-bin.000001 3406 Intvar 1 3406 INSERT_ID=4
-master-bin.000001 3434 Query 1 3434 use `test2`; insert into t1 (b) values(LEAST("Müller","Muffler"))
-master-bin.000001 3522 Query 1 3522 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
-master-bin.000001 3658 Intvar 1 3658 INSERT_ID=74
-master-bin.000001 3686 Create_file 1 3686 db=test2;table=t1;file_id=1;block_len=581
-master-bin.000001 4354 Query 1 4354 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
-master-bin.000001 4490 Intvar 1 4490 INSERT_ID=5
-master-bin.000001 4518 Exec_load 1 4518 ;file_id=1
-master-bin.000001 4541 Query 1 4541 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
-master-bin.000001 4677 Query 1 4677 use `test2`; truncate table t1
-master-bin.000001 4730 Query 1 4730 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
-master-bin.000001 4866 Intvar 1 4866 INSERT_ID=1
-master-bin.000001 4894 User var 1 4894 @`a`=_cp850 0x4DFC6C6C6572 COLLATE cp850_general_ci
-master-bin.000001 4934 Query 1 4934 use `test2`; insert into t1 (b) values(collation(@a))
-master-bin.000001 5010 Query 1 5010 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
-master-bin.000001 5146 Query 1 5146 use `test2`; drop database test2
-master-bin.000001 5201 Query 1 5201 SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
-master-bin.000001 5332 Query 1 5332 drop database test3
+master-bin.000001 79 Query 1 79 use `test`; drop database if exists mysqltest2
+master-bin.000001 148 Query 1 148 use `test`; drop database if exists mysqltest3
+master-bin.000001 217 Query 1 217 use `test`; create database mysqltest2 character set latin2
+master-bin.000001 299 Query 1 299 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=30
+master-bin.000001 433 Query 1 433 use `test`; create database mysqltest3
+master-bin.000001 494 Query 1 494 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64
+master-bin.000001 628 Query 1 628 use `test`; drop database mysqltest3
+master-bin.000001 687 Query 1 687 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64
+master-bin.000001 821 Query 1 821 use `test`; create database mysqltest3
+master-bin.000001 882 Query 1 882 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 1022 Query 1 1022 use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))
+master-bin.000001 1129 Query 1 1129 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 1270 Intvar 1 1270 INSERT_ID=1
+master-bin.000001 1298 Query 1 1298 use `mysqltest2`; insert into t1 (b) values(@@character_set_server)
+master-bin.000001 1388 Query 1 1388 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 1529 Intvar 1 1529 INSERT_ID=2
+master-bin.000001 1557 Query 1 1557 use `mysqltest2`; insert into t1 (b) values(@@collation_server)
+master-bin.000001 1643 Query 1 1643 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 1784 Intvar 1 1784 INSERT_ID=3
+master-bin.000001 1812 Query 1 1812 use `mysqltest2`; insert into t1 (b) values(@@character_set_client)
+master-bin.000001 1902 Query 1 1902 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 2043 Intvar 1 2043 INSERT_ID=4
+master-bin.000001 2071 Query 1 2071 use `mysqltest2`; insert into t1 (b) values(@@character_set_connection)
+master-bin.000001 2165 Query 1 2165 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 2306 Intvar 1 2306 INSERT_ID=5
+master-bin.000001 2334 Query 1 2334 use `mysqltest2`; insert into t1 (b) values(@@collation_connection)
+master-bin.000001 2424 Query 1 2424 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 2564 Query 1 2564 use `mysqltest2`; truncate table t1
+master-bin.000001 2622 Query 1 2622 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 2762 Intvar 1 2762 INSERT_ID=1
+master-bin.000001 2790 Query 1 2790 use `mysqltest2`; insert into t1 (b) values(@@collation_connection)
+master-bin.000001 2880 Query 1 2880 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 3020 Intvar 1 3020 INSERT_ID=2
+master-bin.000001 3048 Query 1 3048 use `mysqltest2`; insert into t1 (b) values(LEAST("Müller","Muffler"))
+master-bin.000001 3141 Query 1 3141 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 3282 Intvar 1 3282 INSERT_ID=3
+master-bin.000001 3310 Query 1 3310 use `mysqltest2`; insert into t1 (b) values(@@collation_connection)
+master-bin.000001 3400 Query 1 3400 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 3541 Intvar 1 3541 INSERT_ID=4
+master-bin.000001 3569 Query 1 3569 use `mysqltest2`; insert into t1 (b) values(LEAST("Müller","Muffler"))
+master-bin.000001 3662 Query 1 3662 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 3803 Intvar 1 3803 INSERT_ID=74
+master-bin.000001 3831 Create_file 1 3831 db=mysqltest2;table=t1;file_id=1;block_len=581
+master-bin.000001 4504 Query 1 4504 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 4645 Intvar 1 4645 INSERT_ID=5
+master-bin.000001 4673 Exec_load 1 4673 ;file_id=1
+master-bin.000001 4696 Query 1 4696 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 4837 Query 1 4837 use `mysqltest2`; truncate table t1
+master-bin.000001 4895 Query 1 4895 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 5036 Intvar 1 5036 INSERT_ID=1
+master-bin.000001 5064 User var 1 5064 @`a`=_cp850 0x4DFC6C6C6572 COLLATE cp850_general_ci
+master-bin.000001 5104 Query 1 5104 use `mysqltest2`; insert into t1 (b) values(collation(@a))
+master-bin.000001 5185 Query 1 5185 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 5326 Query 1 5326 use `mysqltest2`; drop database mysqltest2
+master-bin.000001 5391 Query 1 5391 SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 5522 Query 1 5522 drop database mysqltest3
set global character_set_server=latin2;
ERROR HY000: Binary logging and replication forbid changing the global server character set or collation
set global character_set_server=latin2;
diff --git a/mysql-test/r/rpl_delete_all.result b/mysql-test/r/rpl_delete_all.result
index 97a535490dd..5ed221823e8 100644
--- a/mysql-test/r/rpl_delete_all.result
+++ b/mysql-test/r/rpl_delete_all.result
@@ -4,12 +4,12 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-create database test1;
-drop database if exists test1;
+create database mysqltest;
+drop database if exists mysqltest;
Warnings:
-Note 1008 Can't drop database 'test1'; database doesn't exist
-show tables from test1;
-ERROR HY000: Can't read dir of './test1/' (Errcode: X)
+Note 1008 Can't drop database 'mysqltest'; database doesn't exist
+show tables from mysqltest;
+ERROR HY000: Can't read dir of './mysqltest/' (Errcode: X)
create table t1 (a int);
drop table if exists t1;
Warnings:
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index b78748b7726..8b52e6efedc 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -1,4 +1,5 @@
drop table if exists t1,t2;
+drop database if exists mysqltest;
create table t1 (a int not null primary key, b int not null,c int not null, key(b,c));
insert into t1 values (1,2,2),(2,2,3),(3,2,4),(4,2,4);
check table t1 fast;
@@ -362,39 +363,39 @@ t1 HEAP 9 Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL
t2 HEAP 9 Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL
t3 HEAP 9 Fixed 0 9 # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL
drop table t1, t2, t3;
-create database test_$1;
-show create database test_$1;
+create database mysqltest;
+show create database mysqltest;
Database Create Database
-test_$1 CREATE DATABASE `test_$1` /*!40100 DEFAULT CHARACTER SET latin1 */
-create table test_$1.t1(a int);
-insert into test_$1.t1 values(1);
-grant select on `test_$1`.* to mysqltest_1@localhost;
-grant usage on `test_$1`.* to mysqltest_2@localhost;
-grant drop on `test_$1`.* to mysqltest_3@localhost;
+mysqltest CREATE DATABASE `mysqltest` /*!40100 DEFAULT CHARACTER SET latin1 */
+create table mysqltest.t1(a int);
+insert into mysqltest.t1 values(1);
+grant select on `mysqltest`.* to mysqltest_1@localhost;
+grant usage on `mysqltest`.* to mysqltest_2@localhost;
+grant drop on `mysqltest`.* to mysqltest_3@localhost;
select * from t1;
a
1
-show create database test_$1;
+show create database mysqltest;
Database Create Database
-test_$1 CREATE DATABASE `test_$1` /*!40100 DEFAULT CHARACTER SET latin1 */
+mysqltest CREATE DATABASE `mysqltest` /*!40100 DEFAULT CHARACTER SET latin1 */
drop table t1;
-ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'test_$1'
-drop database test_$1;
-ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'test_$1'
-select * from test_$1.t1;
-ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'test_$1'
-show create database test_$1;
-ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'test_$1'
-drop table test_$1.t1;
-ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'test_$1'
-drop database test_$1;
-ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'test_$1'
-select * from test_$1.t1;
-ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'test_$1'
-show create database test_$1;
-ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'test_$1'
-drop table test_$1.t1;
-drop database test_$1;
+ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysqltest'
+drop database mysqltest;
+ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysqltest'
+select * from mysqltest.t1;
+ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'mysqltest'
+show create database mysqltest;
+ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'mysqltest'
+drop table mysqltest.t1;
+ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'mysqltest'
+drop database mysqltest;
+ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'mysqltest'
+select * from mysqltest.t1;
+ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysqltest'
+show create database mysqltest;
+ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysqltest'
+drop table mysqltest.t1;
+drop database mysqltest;
set names binary;
delete from mysql.user
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result
index 3fbe842ce49..ebb24159373 100644
--- a/mysql-test/r/system_mysql_db.result
+++ b/mysql-test/r/system_mysql_db.result
@@ -18,71 +18,71 @@ user
show create table db;
Table Create Table
db CREATE TABLE `db` (
- `Host` char(60) character set latin1 collate latin1_bin NOT NULL default '',
- `Db` char(64) character set latin1 collate latin1_bin NOT NULL default '',
- `User` char(16) character set latin1 collate latin1_bin NOT NULL default '',
- `Select_priv` enum('N','Y') NOT NULL default 'N',
- `Insert_priv` enum('N','Y') NOT NULL default 'N',
- `Update_priv` enum('N','Y') NOT NULL default 'N',
- `Delete_priv` enum('N','Y') NOT NULL default 'N',
- `Create_priv` enum('N','Y') NOT NULL default 'N',
- `Drop_priv` enum('N','Y') NOT NULL default 'N',
- `Grant_priv` enum('N','Y') NOT NULL default 'N',
- `References_priv` enum('N','Y') NOT NULL default 'N',
- `Index_priv` enum('N','Y') NOT NULL default 'N',
- `Alter_priv` enum('N','Y') NOT NULL default 'N',
- `Create_tmp_table_priv` enum('N','Y') NOT NULL default 'N',
- `Lock_tables_priv` enum('N','Y') NOT NULL default 'N',
+ `Host` char(60) collate utf8_bin NOT NULL default '',
+ `Db` char(64) collate utf8_bin NOT NULL default '',
+ `User` char(16) collate utf8_bin NOT NULL default '',
+ `Select_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Insert_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Update_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Delete_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Create_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Drop_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Grant_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `References_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Index_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Alter_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Create_tmp_table_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Lock_tables_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
PRIMARY KEY (`Host`,`Db`,`User`),
KEY `User` (`User`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Database privileges'
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Database privileges'
show create table host;
Table Create Table
host CREATE TABLE `host` (
- `Host` char(60) character set latin1 collate latin1_bin NOT NULL default '',
- `Db` char(64) character set latin1 collate latin1_bin NOT NULL default '',
- `Select_priv` enum('N','Y') NOT NULL default 'N',
- `Insert_priv` enum('N','Y') NOT NULL default 'N',
- `Update_priv` enum('N','Y') NOT NULL default 'N',
- `Delete_priv` enum('N','Y') NOT NULL default 'N',
- `Create_priv` enum('N','Y') NOT NULL default 'N',
- `Drop_priv` enum('N','Y') NOT NULL default 'N',
- `Grant_priv` enum('N','Y') NOT NULL default 'N',
- `References_priv` enum('N','Y') NOT NULL default 'N',
- `Index_priv` enum('N','Y') NOT NULL default 'N',
- `Alter_priv` enum('N','Y') NOT NULL default 'N',
- `Create_tmp_table_priv` enum('N','Y') NOT NULL default 'N',
- `Lock_tables_priv` enum('N','Y') NOT NULL default 'N',
+ `Host` char(60) collate utf8_bin NOT NULL default '',
+ `Db` char(64) collate utf8_bin NOT NULL default '',
+ `Select_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Insert_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Update_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Delete_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Create_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Drop_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Grant_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `References_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Index_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Alter_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Create_tmp_table_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Lock_tables_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
PRIMARY KEY (`Host`,`Db`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Host privileges; Merged with database privileges'
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Host privileges; Merged with database privileges'
show create table user;
Table Create Table
user CREATE TABLE `user` (
- `Host` varchar(60) character set latin1 collate latin1_bin NOT NULL default '',
- `User` varchar(16) character set latin1 collate latin1_bin NOT NULL default '',
- `Password` varchar(41) character set latin1 collate latin1_bin NOT NULL default '',
- `Select_priv` enum('N','Y') NOT NULL default 'N',
- `Insert_priv` enum('N','Y') NOT NULL default 'N',
- `Update_priv` enum('N','Y') NOT NULL default 'N',
- `Delete_priv` enum('N','Y') NOT NULL default 'N',
- `Create_priv` enum('N','Y') NOT NULL default 'N',
- `Drop_priv` enum('N','Y') NOT NULL default 'N',
- `Reload_priv` enum('N','Y') NOT NULL default 'N',
- `Shutdown_priv` enum('N','Y') NOT NULL default 'N',
- `Process_priv` enum('N','Y') NOT NULL default 'N',
- `File_priv` enum('N','Y') NOT NULL default 'N',
- `Grant_priv` enum('N','Y') NOT NULL default 'N',
- `References_priv` enum('N','Y') NOT NULL default 'N',
- `Index_priv` enum('N','Y') NOT NULL default 'N',
- `Alter_priv` enum('N','Y') NOT NULL default 'N',
- `Show_db_priv` enum('N','Y') NOT NULL default 'N',
- `Super_priv` enum('N','Y') NOT NULL default 'N',
- `Create_tmp_table_priv` enum('N','Y') NOT NULL default 'N',
- `Lock_tables_priv` enum('N','Y') NOT NULL default 'N',
- `Execute_priv` enum('N','Y') NOT NULL default 'N',
- `Repl_slave_priv` enum('N','Y') NOT NULL default 'N',
- `Repl_client_priv` enum('N','Y') NOT NULL default 'N',
- `ssl_type` enum('','ANY','X509','SPECIFIED') NOT NULL default '',
+ `Host` varchar(60) collate utf8_bin NOT NULL default '',
+ `User` varchar(16) collate utf8_bin NOT NULL default '',
+ `Password` varchar(41) collate utf8_bin NOT NULL default '',
+ `Select_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Insert_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Update_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Delete_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Create_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Drop_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Reload_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Shutdown_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Process_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `File_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Grant_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `References_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Index_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Alter_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Show_db_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Super_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Create_tmp_table_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Lock_tables_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Execute_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Repl_slave_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `Repl_client_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
+ `ssl_type` enum('','ANY','X509','SPECIFIED') collate utf8_bin NOT NULL default '',
`ssl_cipher` blob NOT NULL,
`x509_issuer` blob NOT NULL,
`x509_subject` blob NOT NULL,
@@ -90,41 +90,41 @@ user CREATE TABLE `user` (
`max_updates` int(11) unsigned NOT NULL default '0',
`max_connections` int(11) unsigned NOT NULL default '0',
PRIMARY KEY (`Host`,`User`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Users and global privileges'
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges'
show create table func;
Table Create Table
func CREATE TABLE `func` (
- `name` char(64) character set latin1 collate latin1_bin NOT NULL default '',
+ `name` char(64) collate utf8_bin NOT NULL default '',
`ret` tinyint(1) NOT NULL default '0',
- `dl` char(128) NOT NULL default '',
- `type` enum('function','aggregate') NOT NULL default 'function',
+ `dl` char(128) collate utf8_bin NOT NULL default '',
+ `type` enum('function','aggregate') collate utf8_bin NOT NULL default 'function',
PRIMARY KEY (`name`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='User defined functions'
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User defined functions'
show create table tables_priv;
Table Create Table
tables_priv CREATE TABLE `tables_priv` (
- `Host` char(60) character set latin1 collate latin1_bin NOT NULL default '',
- `Db` char(64) character set latin1 collate latin1_bin NOT NULL default '',
- `User` char(16) character set latin1 collate latin1_bin NOT NULL default '',
- `Table_name` char(64) character set latin1 collate latin1_bin NOT NULL default '',
- `Grantor` char(77) NOT NULL default '',
+ `Host` char(60) collate utf8_bin NOT NULL default '',
+ `Db` char(64) collate utf8_bin NOT NULL default '',
+ `User` char(16) collate utf8_bin NOT NULL default '',
+ `Table_name` char(64) collate utf8_bin NOT NULL default '',
+ `Grantor` char(77) collate utf8_bin NOT NULL default '',
`Timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
- `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') NOT NULL default '',
- `Column_priv` set('Select','Insert','Update','References') NOT NULL default '',
+ `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') collate utf8_bin NOT NULL default '',
+ `Column_priv` set('Select','Insert','Update','References') collate utf8_bin NOT NULL default '',
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`),
KEY `Grantor` (`Grantor`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Table privileges'
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table privileges'
show create table columns_priv;
Table Create Table
columns_priv CREATE TABLE `columns_priv` (
- `Host` char(60) character set latin1 collate latin1_bin NOT NULL default '',
- `Db` char(64) character set latin1 collate latin1_bin NOT NULL default '',
- `User` char(16) character set latin1 collate latin1_bin NOT NULL default '',
- `Table_name` char(64) character set latin1 collate latin1_bin NOT NULL default '',
- `Column_name` char(64) character set latin1 collate latin1_bin NOT NULL default '',
+ `Host` char(60) collate utf8_bin NOT NULL default '',
+ `Db` char(64) collate utf8_bin NOT NULL default '',
+ `User` char(16) collate utf8_bin NOT NULL default '',
+ `Table_name` char(64) collate utf8_bin NOT NULL default '',
+ `Column_name` char(64) collate utf8_bin NOT NULL default '',
`Timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
- `Column_priv` set('Select','Insert','Update','References') NOT NULL default '',
+ `Column_priv` set('Select','Insert','Update','References') collate utf8_bin NOT NULL default '',
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Column privileges'
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges'
show tables;
Tables_in_test
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index afee837b1a5..2f42bedf67a 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -436,6 +436,14 @@ select length(version()) > 1 as `*` UNION select 2;
*
1
2
+create table t1 (a int);
+insert into t1 values (0), (3), (1), (2);
+explain (select * from t1) union (select * from t1) order by a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4
+2 UNION t1 ALL NULL NULL NULL NULL 4
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL Using filesort
+drop table t1;
CREATE TABLE t1 ( id int(3) unsigned default '0') ENGINE=MyISAM;
INSERT INTO t1 (id) VALUES("1");
CREATE TABLE t2 ( id int(3) unsigned default '0', id_master int(5) default '0', text1 varchar(5) default NULL, text2 varchar(5) default NULL) ENGINE=MyISAM;
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 317af337c46..eb35aa90fe2 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -110,14 +110,14 @@ drop database mysqltest;
#
# Rights for renaming test (Bug #3270)
#
-connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock);
+connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connection root;
--disable_warnings
create database mysqltest;
--enable_warnings
create table mysqltest.t1 (a int,b int,c int);
grant all on mysqltest.t1 to mysqltest_1@localhost;
-connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,master.sock);
+connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user1;
-- error 1142
alter table t1 rename t2;
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index 30441fb9aae..26c527ca7cb 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -4,7 +4,7 @@
--disable_warnings
drop table if exists t1,t2,t3;
-drop database if exists test_$1;
+drop database if exists mysqltest;
--enable_warnings
create table t1 (b char(0));
@@ -69,14 +69,14 @@ drop table 1ea10;
create table t1 (t1.index int);
drop table t1;
# Test that we get warning for this
-drop database if exists test_$1;
-create database test_$1;
-create table test_$1.$test1 (a$1 int, $b int, c$ int);
-insert into test_$1.$test1 values (1,2,3);
-select a$1, $b, c$ from test_$1.$test1;
-create table test_$1.test2$ (a int);
-drop table test_$1.test2$;
-drop database test_$1;
+drop database if exists mysqltest;
+create database mysqltest;
+create table mysqltest.$test1 (a$1 int, $b int, c$ int);
+insert into mysqltest.$test1 values (1,2,3);
+select a$1, $b, c$ from mysqltest.$test1;
+create table mysqltest.test2$ (a int);
+drop table mysqltest.test2$;
+drop database mysqltest;
--error 1103
create table `` (a int);
@@ -281,16 +281,16 @@ drop table t3;
show create table t3;
select * from t3;
drop table t2, t3;
-create database test_$1;
-create table test_$1.t3 like t1;
-create temporary table t3 like test_$1.t3;
+create database mysqltest;
+create table mysqltest.t3 like t1;
+create temporary table t3 like mysqltest.t3;
show create table t3;
create table t2 like t3;
show create table t2;
select * from t2;
create table t3 like t1;
--error 1050
-create table t3 like test_$1.t3;
+create table t3 like mysqltest.t3;
--error 1044,1
create table non_existing_database.t1 like t1;
--error 1051
@@ -301,7 +301,7 @@ create temporary table t3 like t1;
create table t3 like `a/a`;
drop table t1, t2, t3;
drop table t3;
-drop database test_$1;
+drop database mysqltest;
#
# Test default table type
@@ -393,10 +393,10 @@ drop table t1, t2, t3;
# Bug #1209
#
-create database test_$1;
-use test_$1;
+create database mysqltest;
+use mysqltest;
select database();
-drop database test_$1;
+drop database mysqltest;
select database();
# Connect without a database
diff --git a/mysql-test/t/fulltext2.test b/mysql-test/t/fulltext2.test
index cab1d096fe7..1d3a5307412 100644
--- a/mysql-test/t/fulltext2.test
+++ b/mysql-test/t/fulltext2.test
@@ -44,6 +44,9 @@ while ($1)
# converting to two-level
repair table t1 quick;
+check table t1;
+optimize table t1; # BUG#5327 - mi_sort_index() of 2-level tree
+check table t1;
select count(*) from t1 where match a against ('aaaxxx');
select count(*) from t1 where match a against ('aaayyy');
@@ -102,6 +105,11 @@ CREATE TABLE t1 (
FULLTEXT KEY (a)
) ENGINE=MyISAM;
+#
+# now same as about but w/o repair table
+# 2-level tree created by mi_write
+#
+
# two-level entry, second-level tree with depth 2
--disable_query_log
let $1=260;
diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test
index 855a7cbd28f..22079377ad2 100644
--- a/mysql-test/t/func_in.test
+++ b/mysql-test/t/func_in.test
@@ -75,6 +75,13 @@ select * from t1 where 'a' in (a,b,c collate latin1_bin);
explain extended select * from t1 where 'a' in (a,b,c collate latin1_bin);
drop table t1;
+set names utf8;
+create table t1 (a char(10) character set utf8 not null);
+insert into t1 values ('bbbb'),(_koi8r'ÃÃÃÃ'),(_latin1'ÄÄÄÄ');
+select a from t1 where a in ('bbbb',_koi8r'ÃÃÃÃ',_latin1'ÄÄÄÄ') order by a;
+drop table t1;
+set names latin1;
+
select '1.0' in (1,2);
select 1 in ('1.0',2);
select 1 in (1,'2.0');
diff --git a/mysql-test/t/lowercase_table.test b/mysql-test/t/lowercase_table.test
index bdfa8dfc132..a9c0c976afc 100644
--- a/mysql-test/t/lowercase_table.test
+++ b/mysql-test/t/lowercase_table.test
@@ -4,6 +4,9 @@
--disable_warnings
drop table if exists t1,t2,t3,t4;
+# Clear up from other tests (to ensure that SHOW TABLES below is right)
+drop table if exists t0,t5,t6,t7,t8,t9;
+drop database if exists mysqltest;
--enable_warnings
create table T1 (id int primary key, Word varchar(40) not null, Index(Word));
@@ -32,6 +35,23 @@ select count(bags.a) from t1 as Bags;
drop table t1;
#
+# Test all caps database name
+#
+create database mysqltest;
+use MYSQLTEST;
+create table t1 (a int);
+select T1.a from MYSQLTEST.T1;
+select t1.a from MYSQLTEST.T1;
+select mysqltest.t1.* from MYSQLTEST.t1;
+select MYSQLTEST.t1.* from MYSQLTEST.t1;
+select MYSQLTEST.T1.* from MYSQLTEST.T1;
+select MYSQLTEST.T1.* from T1;
+alter table t1 rename to T1;
+select MYSQLTEST.t1.* from MYSQLTEST.t1;
+drop database mysqltest;
+use test;
+
+#
# multiupdate/delete & --lower-case-table-names
#
create table t1 (a int);
@@ -54,13 +74,3 @@ select C.a, c.a from t1 c, t2 C;
drop table t1, t2;
show tables;
-
-#
-# Test all caps database name
-#
-create table t1 (a int);
-select TEST.t1.* from TEST.t1;
-alter table t1 rename to T1;
-select TEST.t1.* from TEST.t1;
-drop table t1;
-
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index cf55c26fb69..9580c1ab44c 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -271,3 +271,17 @@ select * from t3 where x = 1 and y < 5 order by y;
# Bug is that followng query returns empty set while it must be same as above
select * from t3 where x = 1 and y < 5 order by y desc;
drop table t1,t2,t3;
+
+#
+# Bug#5232: CREATE TABLE ... SELECT
+#
+
+create table t1 (a int);
+create table t2 (a int);
+insert into t1 values (0);
+insert into t2 values (1);
+--error 1093
+create table t3 engine=merge union=(t1, t2) select * from t1;
+--error 1093
+create table t3 engine=merge union=(t1, t2) select * from t2;
+drop table t1, t2;
diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test
index 448db0a9165..0487e18cdb9 100644
--- a/mysql-test/t/ndb_basic.test
+++ b/mysql-test/t/ndb_basic.test
@@ -2,7 +2,7 @@
--disable_warnings
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
-drop database if exists test2;
+drop database if exists mysqltest;
--enable_warnings
#
@@ -340,8 +340,8 @@ CREATE TABLE t1 (
INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9411,9413, 17, '9413');
-create database test2;
-use test2;
+create database mysqltest;
+use mysqltest;
CREATE TABLE t2 (
a bigint unsigned NOT NULL PRIMARY KEY,
@@ -355,7 +355,5 @@ select b from test.t1, t2 where c = test.t1.attr2;
select b,test.t1.attr1 from test.t1, t2 where test.t1.pk1 < a;
drop table test.t1, t2;
-
-drop database test2;
-
+drop database mysqltest;
diff --git a/mysql-test/t/ndb_blob.test b/mysql-test/t/ndb_blob.test
index 8a21e4c371a..0df13eefe10 100644
--- a/mysql-test/t/ndb_blob.test
+++ b/mysql-test/t/ndb_blob.test
@@ -2,7 +2,7 @@
--disable_warnings
drop table if exists t1;
-drop database if exists test2;
+drop database if exists mysqltest;
--enable_warnings
#
@@ -241,8 +241,8 @@ select * from t1 order by a;
# multi db
-create database test2;
-use test2;
+create database mysqltest;
+use mysqltest;
CREATE TABLE t2 (
a bigint unsigned NOT NULL PRIMARY KEY,
@@ -306,5 +306,5 @@ select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
from t1 order by a;
rollback;
select count(*) from t1;
-
---drop table t1;
+drop table t1;
+drop database mysqltest;
diff --git a/mysql-test/t/ndb_transaction.test b/mysql-test/t/ndb_transaction.test
index 9d06d949b2e..f8ed22207ea 100644
--- a/mysql-test/t/ndb_transaction.test
+++ b/mysql-test/t/ndb_transaction.test
@@ -2,7 +2,7 @@
--disable_warnings
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
-drop database if exists test2;
+drop database if exists mysqltest;
--enable_warnings
#
@@ -263,8 +263,8 @@ CREATE TABLE t1 (
attr1 INT NOT NULL
) ENGINE=ndbcluster;
-create database test2;
-use test2;
+create database mysqltest;
+use mysqltest;
CREATE TABLE t2 (
a bigint unsigned NOT NULL PRIMARY KEY,
@@ -292,7 +292,6 @@ select count(*) from test.t1;
select count(*) from t2;
drop table test.t1, t2;
-
-drop database test2;
+drop database mysqltest;
diff --git a/mysql-test/t/negation_elimination.test b/mysql-test/t/negation_elimination.test
index 49428cc238b..c50a9678edb 100644
--- a/mysql-test/t/negation_elimination.test
+++ b/mysql-test/t/negation_elimination.test
@@ -65,4 +65,8 @@ select * from t1 where not((a < 5 and a < 10) and (not(a > 16) or a > 17));
explain select * from t1 where ((a between 5 and 15) and (not(a like 10)));
select * from t1 where ((a between 5 and 15) and (not(a like 10)));
+delete from t1 where a > 3;
+select a, not(not(a)) from t1;
+explain extended select a, not(not(a)), not(a <= 2 and not(a)), not(a not like "1"), not (a not in (1,2)), not(a != 2) from t1 where not(not(a)) having not(not(a));
+
drop table t1;
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index e54bf8076e0..cbc76e02b42 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -261,3 +261,20 @@ execute `ü`;
set names default;
+#
+# BUG#4368 "select * from t1 where a like ?" crashes server if a is in utf8
+# and ? is in latin1
+# Check that Item converting latin1 to utf8 (for LIKE function) is created
+# in memory of prepared statement.
+#
+
+create table t1 (a varchar(10)) charset=utf8;
+insert into t1 (a) values ('yahoo');
+set character_set_connection=latin1;
+prepare stmt from 'select a from t1 where a like ?';
+set @var='google';
+execute stmt using @var;
+execute stmt using @var;
+deallocate prepare stmt;
+drop table t1;
+
diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test
index 2c86c30f820..084253a106a 100644
--- a/mysql-test/t/ps_1general.test
+++ b/mysql-test/t/ps_1general.test
@@ -350,11 +350,11 @@ prepare stmt4 from ' use test ' ;
## create/drop database
--error 1295
-prepare stmt3 from ' create database drop_me ';
-create database drop_me ;
+prepare stmt3 from ' create database mysqltest ';
+create database mysqltest ;
--error 1295
-prepare stmt3 from ' drop database drop_me ';
-drop database drop_me ;
+prepare stmt3 from ' drop database mysqltest ';
+drop database mysqltest ;
## grant/revoke + drop user
--error 1295
diff --git a/mysql-test/t/rename.test b/mysql-test/t/rename.test
index bea0641ad23..e6dc6ce9456 100644
--- a/mysql-test/t/rename.test
+++ b/mysql-test/t/rename.test
@@ -4,6 +4,8 @@
--disable_warnings
drop table if exists t0,t1,t2,t3,t4;
+# Clear up from other tests (to ensure that SHOW TABLES below is right)
+drop table if exists t0,t5,t6,t7,t8,t9;
--enable_warnings
create table t0 SELECT 1,"table 1";
diff --git a/mysql-test/t/rpl_charset.test b/mysql-test/t/rpl_charset.test
index 02bcdf1f5f1..83e7d95e28c 100644
--- a/mysql-test/t/rpl_charset.test
+++ b/mysql-test/t/rpl_charset.test
@@ -6,41 +6,41 @@
source include/master-slave.inc;
--disable_warnings
-drop database if exists test2;
-drop database if exists test3;
+drop database if exists mysqltest2;
+drop database if exists mysqltest3;
--enable_warnings
-create database test2 character set latin2;
+create database mysqltest2 character set latin2;
set @@character_set_server=latin5;
-create database test3;
+create database mysqltest3;
--disable_query_log
select "--- --master--" as "";
--enable_query_log
-show create database test2;
-show create database test3;
+show create database mysqltest2;
+show create database mysqltest3;
sync_slave_with_master;
--disable_query_log
select "--- --slave--" as "";
--enable_query_log
-show create database test2;
-show create database test3;
+show create database mysqltest2;
+show create database mysqltest3;
connection master;
set @@collation_server=armscii8_bin;
-drop database test3;
-create database test3;
+drop database mysqltest3;
+create database mysqltest3;
--disable_query_log
select "--- --master--" as "";
--enable_query_log
-show create database test3;
+show create database mysqltest3;
sync_slave_with_master;
--disable_query_log
select "--- --slave--" as "";
--enable_query_log
-show create database test3;
+show create database mysqltest3;
connection master;
-use test2;
+use mysqltest2;
create table t1 (a int auto_increment primary key, b varchar(100));
set character_set_client=cp850, collation_connection=latin2_croatian_ci;
insert into t1 (b) values(@@character_set_server);
@@ -59,7 +59,7 @@ sync_slave_with_master;
--disable_query_log
select "--- --slave--" as "";
--enable_query_log
-select * from test2.t1 order by a;
+select * from mysqltest2.t1 order by a;
connection master;
set character_set_client=latin1, collation_connection=latin1_german1_ci;
@@ -77,7 +77,7 @@ sync_slave_with_master;
--disable_query_log
select "--- --slave--" as "";
--enable_query_log
-select * from test2.t1 order by a;
+select * from mysqltest2.t1 order by a;
# See if SET ONE_SHOT gets into binlog when LOAD DATA
connection master;
@@ -101,11 +101,11 @@ sync_slave_with_master;
--disable_query_log
select "--- --slave--" as "";
--enable_query_log
-select * from test2.t1 order by a;
+select * from mysqltest2.t1 order by a;
connection master;
-drop database test2;
-drop database test3;
+drop database mysqltest2;
+drop database mysqltest3;
show binlog events from 79;
sync_slave_with_master;
diff --git a/mysql-test/t/rpl_delete_all.test b/mysql-test/t/rpl_delete_all.test
index 6ca98b34caf..23848720107 100644
--- a/mysql-test/t/rpl_delete_all.test
+++ b/mysql-test/t/rpl_delete_all.test
@@ -1,14 +1,14 @@
source include/master-slave.inc;
connection slave;
-create database test1;
+create database mysqltest;
connection master;
-drop database if exists test1;
+drop database if exists mysqltest;
sync_slave_with_master;
# can't read dir
--replace_result "Errcode: 1" "Errcode: X" "Errcode: 2" "Errcode: X"
--error 12
-show tables from test1;
+show tables from mysqltest;
connection slave;
create table t1 (a int);
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index de391fbe288..759ed7d22b3 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -4,6 +4,7 @@
--disable_warnings
drop table if exists t1,t2;
+drop database if exists mysqltest;
--enable_warnings
create table t1 (a int not null primary key, b int not null,c int not null, key(b,c));
@@ -261,42 +262,42 @@ drop table t1, t2, t3;
# Test for bug #3342 SHOW CREATE DATABASE seems to require DROP privilege
#
-create database test_$1;
-show create database test_$1;
-create table test_$1.t1(a int);
-insert into test_$1.t1 values(1);
-grant select on `test_$1`.* to mysqltest_1@localhost;
-grant usage on `test_$1`.* to mysqltest_2@localhost;
-grant drop on `test_$1`.* to mysqltest_3@localhost;
+create database mysqltest;
+show create database mysqltest;
+create table mysqltest.t1(a int);
+insert into mysqltest.t1 values(1);
+grant select on `mysqltest`.* to mysqltest_1@localhost;
+grant usage on `mysqltest`.* to mysqltest_2@localhost;
+grant drop on `mysqltest`.* to mysqltest_3@localhost;
-connect (con1,localhost,mysqltest_1,,test_$1);
+connect (con1,localhost,mysqltest_1,,mysqltest);
connection con1;
select * from t1;
-show create database test_$1;
+show create database mysqltest;
--error 1044
drop table t1;
--error 1044
-drop database test_$1;
+drop database mysqltest;
connect (con2,localhost,mysqltest_2,,test);
connection con2;
--error 1044
-select * from test_$1.t1;
+select * from mysqltest.t1;
--error 1044
-show create database test_$1;
+show create database mysqltest;
--error 1044
-drop table test_$1.t1;
+drop table mysqltest.t1;
--error 1044
-drop database test_$1;
+drop database mysqltest;
connect (con3,localhost,mysqltest_3,,test);
connection con3;
--error 1044
-select * from test_$1.t1;
+select * from mysqltest.t1;
--error 1044
-show create database test_$1;
-drop table test_$1.t1;
-drop database test_$1;
+show create database mysqltest;
+drop table mysqltest.t1;
+drop database mysqltest;
connection default;
set names binary;
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index 206b40f8ce7..263f631a65f 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -265,6 +265,14 @@ drop table t1,t2;
select length(version()) > 1 as `*` UNION select 2;
#
+# Bug #4980: problem with explain
+#
+
+create table t1 (a int);
+insert into t1 values (0), (3), (1), (2);
+explain (select * from t1) union (select * from t1) order by a;
+drop table t1;
+#
# Test for another bug with UNION and LEFT JOIN
#
CREATE TABLE t1 ( id int(3) unsigned default '0') ENGINE=MyISAM;
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index 07a8f199b3b..53e46932167 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -21,6 +21,9 @@
#include <mysys_err.h>
#include <my_getopt.h>
+static void default_reporter(enum loglevel level, const char *format, ...);
+my_error_reporter my_getopt_error_reporter= &default_reporter;
+
static int findopt(char *optpat, uint length,
const struct my_option **opt_res,
char **ffname);
@@ -56,7 +59,8 @@ char *disabled_my_option= (char*) "0";
my_bool my_getopt_print_errors= 1;
-void default_reporter(enum loglevel level, const char *format, ...)
+static void default_reporter(enum loglevel level __attribute__((unused)),
+ const char *format, ...)
{
va_list args;
va_start(args, format);
@@ -83,8 +87,8 @@ void my_getopt_register_get_addr(gptr* (*func_addr)(const char *, uint,
}
int handle_options(int *argc, char ***argv,
- const struct my_option *longopts, my_get_one_option get_one_option,
- my_error_reporter reporter)
+ const struct my_option *longopts,
+ my_get_one_option get_one_option)
{
uint opt_found, argvpos= 0, length, i;
my_bool end_of_options= 0, must_be_var, set_maximum_value,
@@ -100,8 +104,6 @@ int handle_options(int *argc, char ***argv,
(*argv)++; /* --- || ---- */
init_variables(longopts);
- if (! reporter) reporter = &default_reporter;
-
for (pos= *argv, pos_end=pos+ *argc; pos != pos_end ; pos++)
{
char *cur_arg= *pos;
@@ -125,8 +127,9 @@ int handle_options(int *argc, char ***argv,
if (!*++pos)
{
if (my_getopt_print_errors)
- reporter(ERROR_LEVEL, "%s: Option '-O' requires an argument\n",
- my_progname);
+ my_getopt_error_reporter(ERROR_LEVEL,
+ "%s: Option '-O' requires an argument\n",
+ my_progname);
return EXIT_ARGUMENT_REQUIRED;
}
cur_arg= *pos;
@@ -142,8 +145,9 @@ int handle_options(int *argc, char ***argv,
if (!*cur_arg)
{
if (my_getopt_print_errors)
- reporter(ERROR_LEVEL, "%s: Option '--set-variable' requires an argument\n",
- my_progname);
+ my_getopt_error_reporter(ERROR_LEVEL,
+ "%s: Option '--set-variable' requires an argument\n",
+ my_progname);
return EXIT_ARGUMENT_REQUIRED;
}
}
@@ -155,8 +159,9 @@ int handle_options(int *argc, char ***argv,
if (!*++pos)
{
if (my_getopt_print_errors)
- reporter(ERROR_LEVEL, "%s: Option '--set-variable' requires an argument\n",
- my_progname);
+ my_getopt_error_reporter(ERROR_LEVEL,
+ "%s: Option '--set-variable' requires an argument\n",
+ my_progname);
return EXIT_ARGUMENT_REQUIRED;
}
cur_arg= *pos;
@@ -215,10 +220,11 @@ int handle_options(int *argc, char ***argv,
if (opt_found > 1)
{
if (my_getopt_print_errors)
- reporter(ERROR_LEVEL,
- "%s: ambiguous option '--%s-%s' (--%s-%s)\n",
- my_progname, special_opt_prefix[i], opt_str,
- special_opt_prefix[i], prev_found);
+ my_getopt_error_reporter(ERROR_LEVEL,
+ "%s: ambiguous option '--%s-%s' (--%s-%s)\n",
+ my_progname, special_opt_prefix[i],
+ cur_arg, special_opt_prefix[i],
+ prev_found);
return EXIT_AMBIGUOUS_OPTION;
}
switch (i) {
@@ -250,16 +256,20 @@ int handle_options(int *argc, char ***argv,
if (must_be_var)
{
if (my_getopt_print_errors)
- reporter(option_is_loose ? WARNING_LEVEL : ERROR_LEVEL,
- "%s: unknown variable '%s'\n", my_progname, cur_arg);
+ my_getopt_error_reporter(option_is_loose ?
+ WARNING_LEVEL : ERROR_LEVEL,
+ "%s: unknown variable '%s'\n",
+ my_progname, cur_arg);
if (!option_is_loose)
return EXIT_UNKNOWN_VARIABLE;
}
else
{
if (my_getopt_print_errors)
- reporter(option_is_loose ? WARNING_LEVEL : ERROR_LEVEL,
- "%s: unknown option '--%s'\n", my_progname, cur_arg);
+ my_getopt_error_reporter(option_is_loose ?
+ WARNING_LEVEL : ERROR_LEVEL,
+ "%s: unknown option '--%s'\n",
+ my_progname, cur_arg);
if (!option_is_loose)
return EXIT_UNKNOWN_OPTION;
}
@@ -275,15 +285,18 @@ int handle_options(int *argc, char ***argv,
if (must_be_var)
{
if (my_getopt_print_errors)
- reporter(ERROR_LEVEL, "%s: variable prefix '%s' is not unique\n",
- my_progname, opt_str);
+ my_getopt_error_reporter(ERROR_LEVEL,
+ "%s: variable prefix '%s' is not unique\n",
+ my_progname, opt_str);
return EXIT_VAR_PREFIX_NOT_UNIQUE;
}
else
{
if (my_getopt_print_errors)
- reporter(ERROR_LEVEL, "%s: ambiguous option '--%s' (%s, %s)\n",
- my_progname, opt_str, prev_found, optp->name);
+ my_getopt_error_reporter(ERROR_LEVEL,
+ "%s: ambiguous option '--%s' (%s, %s)\n",
+ my_progname, opt_str, prev_found,
+ optp->name);
return EXIT_AMBIGUOUS_OPTION;
}
}
@@ -303,8 +316,9 @@ int handle_options(int *argc, char ***argv,
if (must_be_var && (optp->var_type & GET_TYPE_MASK) == GET_NO_ARG)
{
if (my_getopt_print_errors)
- reporter(ERROR_LEVEL, "%s: option '%s' cannot take an argument\n",
- my_progname, optp->name);
+ my_getopt_error_reporter(ERROR_LEVEL,
+ "%s: option '%s' cannot take an argument\n",
+ my_progname, optp->name);
return EXIT_NO_ARGUMENT_ALLOWED;
}
value= optp->var_type & GET_ASK_ADDR ?
@@ -315,8 +329,9 @@ int handle_options(int *argc, char ***argv,
if (optend && (optp->var_type & GET_TYPE_MASK) != GET_BOOL)
{
if (my_getopt_print_errors)
- reporter(ERROR_LEVEL, "%s: option '--%s' cannot take an argument\n",
- my_progname, optp->name);
+ my_getopt_error_reporter(ERROR_LEVEL,
+ "%s: option '--%s' cannot take an argument\n",
+ my_progname, optp->name);
return EXIT_NO_ARGUMENT_ALLOWED;
}
if ((optp->var_type & GET_TYPE_MASK) == GET_BOOL)
@@ -354,8 +369,9 @@ int handle_options(int *argc, char ***argv,
if (!*++pos)
{
if (my_getopt_print_errors)
- reporter(ERROR_LEVEL, "%s: option '--%s' requires an argument\n",
- my_progname, optp->name);
+ my_getopt_error_reporter(ERROR_LEVEL,
+ "%s: option '--%s' requires an argument\n",
+ my_progname, optp->name);
return EXIT_ARGUMENT_REQUIRED;
}
argument= *pos;
@@ -413,9 +429,9 @@ int handle_options(int *argc, char ***argv,
if (!pos[1])
{
if (my_getopt_print_errors)
- reporter(ERROR_LEVEL,
- "%s: option '-%c' requires an argument\n",
- my_progname, optp->id);
+ my_getopt_error_reporter(ERROR_LEVEL,
+ "%s: option '-%c' requires an argument\n",
+ my_progname, optp->id);
return EXIT_ARGUMENT_REQUIRED;
}
argument= *++pos;
@@ -426,9 +442,9 @@ int handle_options(int *argc, char ***argv,
if ((error= setval(optp, optp->value, argument,
set_maximum_value)))
{
- reporter(ERROR_LEVEL,
- "%s: Error while setting value '%s' to '%s'\n",
- my_progname, argument, optp->name);
+ my_getopt_error_reporter(ERROR_LEVEL,
+ "%s: Error while setting value '%s' to '%s'\n",
+ my_progname, argument, optp->name);
return error;
}
get_one_option(optp->id, optp, argument);
@@ -438,8 +454,9 @@ int handle_options(int *argc, char ***argv,
if (!opt_found)
{
if (my_getopt_print_errors)
- reporter(ERROR_LEVEL,
- "%s: unknown option '-%c'\n", my_progname, *optend);
+ my_getopt_error_reporter(ERROR_LEVEL,
+ "%s: unknown option '-%c'\n",
+ my_progname, *optend);
return EXIT_UNKNOWN_OPTION;
}
}
@@ -448,9 +465,9 @@ int handle_options(int *argc, char ***argv,
}
if ((error= setval(optp, value, argument, set_maximum_value)))
{
- reporter(ERROR_LEVEL,
- "%s: Error while setting value '%s' to '%s'\n",
- my_progname, argument, optp->name);
+ my_getopt_error_reporter(ERROR_LEVEL,
+ "%s: Error while setting value '%s' to '%s'\n",
+ my_progname, argument, optp->name);
return error;
}
get_one_option(optp->id, optp, argument);
diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh
index 5a6ea6025f2..f524b322388 100644
--- a/scripts/mysql_create_system_tables.sh
+++ b/scripts/mysql_create_system_tables.sh
@@ -68,7 +68,8 @@ then
c_d="$c_d Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_d="$c_d PRIMARY KEY Host (Host,Db,User),"
c_d="$c_d KEY User (User)"
- c_d="$c_d )"
+ c_d="$c_d ) engine=MyISAM"
+ c_d="$c_d CHARACTER SET utf8 COLLATE utf8_bin"
c_d="$c_d comment='Database privileges';"
i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y');
@@ -97,7 +98,8 @@ then
c_h="$c_h Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_h="$c_h Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_h="$c_h PRIMARY KEY Host (Host,Db)"
- c_h="$c_h )"
+ c_h="$c_h ) engine=MyISAM"
+ c_h="$c_h CHARACTER SET utf8 COLLATE utf8_bin"
c_h="$c_h comment='Host privileges; Merged with database privileges';"
fi
@@ -140,7 +142,8 @@ then
c_u="$c_u max_updates int(11) unsigned DEFAULT 0 NOT NULL,"
c_u="$c_u max_connections int(11) unsigned DEFAULT 0 NOT NULL,"
c_u="$c_u PRIMARY KEY Host (Host,User)"
- c_u="$c_u )"
+ c_u="$c_u ) engine=MyISAM"
+ c_u="$c_u CHARACTER SET utf8 COLLATE utf8_bin"
c_u="$c_u comment='Users and global privileges';"
if test "$1" = "test"
@@ -179,7 +182,8 @@ then
c_f="$c_f dl char(128) DEFAULT '' NOT NULL,"
c_f="$c_f type enum ('function','aggregate') NOT NULL,"
c_f="$c_f PRIMARY KEY (name)"
- c_f="$c_f )"
+ c_f="$c_f ) engine=MyISAM"
+ c_f="$c_f CHARACTER SET utf8 COLLATE utf8_bin"
c_f="$c_f comment='User defined functions';"
fi
@@ -200,7 +204,8 @@ then
c_t="$c_t Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,"
c_t="$c_t PRIMARY KEY (Host,Db,User,Table_name),"
c_t="$c_t KEY Grantor (Grantor)"
- c_t="$c_t )"
+ c_t="$c_t ) engine=MyISAM"
+ c_t="$c_t CHARACTER SET utf8 COLLATE utf8_bin"
c_t="$c_t comment='Table privileges';"
fi
@@ -219,7 +224,8 @@ then
c_c="$c_c Timestamp timestamp(14),"
c_c="$c_c Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,"
c_c="$c_c PRIMARY KEY (Host,Db,User,Table_name,Column_name)"
- c_c="$c_c )"
+ c_c="$c_c ) engine=MyISAM"
+ c_c="$c_c CHARACTER SET utf8 COLLATE utf8_bin"
c_c="$c_c comment='Column privileges';"
fi
@@ -231,14 +237,15 @@ then
c_ht="$c_ht CREATE TABLE help_topic ("
c_ht="$c_ht help_topic_id int unsigned not null,"
- c_ht="$c_ht name nvarchar(64) not null,"
+ c_ht="$c_ht name varchar(64) not null,"
c_ht="$c_ht help_category_id smallint unsigned not null,"
c_ht="$c_ht description text not null,"
c_ht="$c_ht example text not null,"
- c_ht="$c_ht url nvarchar(128) not null,"
+ c_ht="$c_ht url varchar(128) not null,"
c_ht="$c_ht primary key (help_topic_id),"
c_ht="$c_ht unique index (name)"
- c_ht="$c_ht )"
+ c_ht="$c_ht ) engine=MyISAM"
+ c_ht="$c_ht CHARACTER SET utf8"
c_ht="$c_ht comment='help topics';"
fi
@@ -252,12 +259,13 @@ then
c_hc="$c_hc CREATE TABLE help_category ("
c_hc="$c_hc help_category_id smallint unsigned not null,"
- c_hc="$c_hc name nvarchar(64) not null,"
+ c_hc="$c_hc name varchar(64) not null,"
c_hc="$c_hc parent_category_id smallint unsigned null,"
- c_hc="$c_hc url nvarchar(128) not null,"
+ c_hc="$c_hc url varchar(128) not null,"
c_hc="$c_hc primary key (help_category_id),"
c_hc="$c_hc unique index (name)"
- c_hc="$c_hc )"
+ c_hc="$c_hc ) engine=MyISAM"
+ c_hc="$c_hc CHARACTER SET utf8"
c_hc="$c_hc comment='help categories';"
fi
@@ -269,10 +277,11 @@ then
c_hk="$c_hk CREATE TABLE help_keyword ("
c_hk="$c_hk help_keyword_id int unsigned not null,"
- c_hk="$c_hk name nvarchar(64) not null,"
+ c_hk="$c_hk name varchar(64) not null,"
c_hk="$c_hk primary key (help_keyword_id),"
c_hk="$c_hk unique index (name)"
- c_hk="$c_hk )"
+ c_hk="$c_hk ) engine=MyISAM"
+ c_hk="$c_hk CHARACTER SET utf8"
c_hk="$c_hk comment='help keywords';"
fi
@@ -286,7 +295,8 @@ then
c_hr="$c_hr help_topic_id int unsigned not null references help_topic,"
c_hr="$c_hr help_keyword_id int unsigned not null references help_keyword,"
c_hr="$c_hr primary key (help_keyword_id, help_topic_id)"
- c_hr="$c_hr )"
+ c_hr="$c_hr ) engine=MyISAM"
+ c_hr="$c_hr CHARACTER SET utf8"
c_hr="$c_hr comment='keyword-topic relation';"
fi
@@ -300,7 +310,7 @@ then
c_tzn="$c_tzn Name char(64) NOT NULL,"
c_tzn="$c_tzn Time_zone_id int unsigned NOT NULL,"
c_tzn="$c_tzn PRIMARY KEY Name (Name)"
- c_tzn="$c_tzn ) DEFAULT CHARACTER SET latin1"
+ c_tzn="$c_tzn ) engine=MyISAM CHARACTER SET utf8"
c_tzn="$c_tzn comment='Time zone names';"
if test "$1" = "test"
@@ -322,7 +332,7 @@ then
c_tz="$c_tz Time_zone_id int unsigned NOT NULL auto_increment,"
c_tz="$c_tz Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,"
c_tz="$c_tz PRIMARY KEY TzId (Time_zone_id)"
- c_tz="$c_tz ) DEFAULT CHARACTER SET latin1"
+ c_tz="$c_tz ) engine=MyISAM CHARACTER SET utf8"
c_tz="$c_tz comment='Time zones';"
if test "$1" = "test"
@@ -343,7 +353,7 @@ then
c_tzt="$c_tzt Transition_time bigint signed NOT NULL,"
c_tzt="$c_tzt Transition_type_id int unsigned NOT NULL,"
c_tzt="$c_tzt PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)"
- c_tzt="$c_tzt ) DEFAULT CHARACTER SET latin1"
+ c_tzt="$c_tzt ) engine=MyISAM CHARACTER SET utf8"
c_tzt="$c_tzt comment='Time zone transitions';"
if test "$1" = "test"
@@ -565,7 +575,7 @@ then
c_tztt="$c_tztt Is_DST tinyint unsigned DEFAULT 0 NOT NULL,"
c_tztt="$c_tztt Abbreviation char(8) DEFAULT '' NOT NULL,"
c_tztt="$c_tztt PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)"
- c_tztt="$c_tztt ) DEFAULT CHARACTER SET latin1"
+ c_tztt="$c_tztt ) engine=MyISAM CHARACTER SET utf8"
c_tztt="$c_tztt comment='Time zone transition types';"
if test "$1" = "test"
@@ -601,7 +611,7 @@ then
c_tzls="$c_tzls Transition_time bigint signed NOT NULL,"
c_tzls="$c_tzls Correction int signed NOT NULL,"
c_tzls="$c_tzls PRIMARY KEY TranTime (Transition_time)"
- c_tzls="$c_tzls ) DEFAULT CHARACTER SET latin1"
+ c_tzls="$c_tzls ) engine=MyISAM CHARACTER SET utf8"
c_tzls="$c_tzls comment='Leap seconds information for time zones';"
if test "$1" = "test"
diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql
index b578d8d06f3..a60d987f8b5 100644
--- a/scripts/mysql_fix_privilege_tables.sql
+++ b/scripts/mysql_fix_privilege_tables.sql
@@ -9,12 +9,12 @@
-- this sql script.
-- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql'
-ALTER TABLE user type=MyISAM;
-ALTER TABLE db type=MyISAM;
-ALTER TABLE host type=MyISAM;
-ALTER TABLE func type=MyISAM;
-ALTER TABLE columns_priv type=MyISAM;
-ALTER TABLE tables_priv type=MyISAM;
+ALTER TABLE user type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
+ALTER TABLE db type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
+ALTER TABLE host type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
+ALTER TABLE func type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
+ALTER TABLE columns_priv type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
+ALTER TABLE tables_priv type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE user change Password Password char(41) binary not null;
ALTER TABLE user add File_priv enum('N','Y') NOT NULL;
CREATE TABLE IF NOT EXISTS func (
@@ -23,7 +23,7 @@ CREATE TABLE IF NOT EXISTS func (
dl char(128) DEFAULT '' NOT NULL,
type enum ('function','aggregate') NOT NULL,
PRIMARY KEY (name)
-);
+) CHARACTER SET utf8 COLLATE utf8_bin;
-- Detect whether or not we had the Grant_priv column
SET @hadGrantPriv:=0;
@@ -63,7 +63,7 @@ CREATE TABLE IF NOT EXISTS tables_priv (
Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL,
Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,
PRIMARY KEY (Host,Db,User,Table_name)
-);
+) CHARACTER SET utf8 COLLATE utf8_bin;
CREATE TABLE IF NOT EXISTS columns_priv (
Host char(60) DEFAULT '' NOT NULL,
@@ -74,7 +74,7 @@ CREATE TABLE IF NOT EXISTS columns_priv (
Timestamp timestamp(14),
Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,
PRIMARY KEY (Host,Db,User,Table_name,Column_name)
-);
+) CHARACTER SET utf8 COLLATE utf8_bin;
--
@@ -156,7 +156,7 @@ description text not null,
example text not null,
url varchar(128) not null,
primary key (help_topic_id), unique index (name)
-) comment='help topics';
+) CHARACTER SET utf8 comment='help topics';
CREATE TABLE IF NOT EXISTS help_category (
help_category_id smallint unsigned not null,
@@ -165,20 +165,20 @@ parent_category_id smallint unsigned null,
url varchar(128) not null,
primary key (help_category_id),
unique index (name)
-) comment='help categories';
+) CHARACTER SET utf8 comment='help categories';
CREATE TABLE IF NOT EXISTS help_relation (
help_topic_id int unsigned not null references help_topic,
help_keyword_id int unsigned not null references help_keyword,
primary key (help_keyword_id, help_topic_id)
-) comment='keyword-topic relation';
+) CHARACTER SET utf8 comment='keyword-topic relation';
CREATE TABLE IF NOT EXISTS help_keyword (
help_keyword_id int unsigned not null,
name varchar(64) not null,
primary key (help_keyword_id),
unique index (name)
-) comment='help keywords';
+) CHARACTER SET utf8 comment='help keywords';
#
# Create missing time zone related tables
@@ -188,20 +188,20 @@ CREATE TABLE IF NOT EXISTS time_zone_name (
Name char(64) NOT NULL,
Time_zone_id int unsigned NOT NULL,
PRIMARY KEY Name (Name)
-) DEFAULT CHARACTER SET latin1 comment='Time zone names';
+) CHARACTER SET utf8 comment='Time zone names';
CREATE TABLE IF NOT EXISTS time_zone (
Time_zone_id int unsigned NOT NULL auto_increment,
Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,
PRIMARY KEY TzId (Time_zone_id)
-) DEFAULT CHARACTER SET latin1 comment='Time zones';
+) CHARACTER SET utf8 comment='Time zones';
CREATE TABLE IF NOT EXISTS time_zone_transition (
Time_zone_id int unsigned NOT NULL,
Transition_time bigint signed NOT NULL,
Transition_type_id int unsigned NOT NULL,
PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)
-) DEFAULT CHARACTER SET latin1 comment='Time zone transitions';
+) CHARACTER SET utf8 comment='Time zone transitions';
CREATE TABLE IF NOT EXISTS time_zone_transition_type (
Time_zone_id int unsigned NOT NULL,
@@ -210,11 +210,11 @@ Offset int signed DEFAULT 0 NOT NULL,
Is_DST tinyint unsigned DEFAULT 0 NOT NULL,
Abbreviation char(8) DEFAULT '' NOT NULL,
PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)
-) DEFAULT CHARACTER SET latin1 comment='Time zone transition types';
+) CHARACTER SET utf8 comment='Time zone transition types';
CREATE TABLE IF NOT EXISTS time_zone_leap_second (
Transition_time bigint signed NOT NULL,
Correction int signed NOT NULL,
PRIMARY KEY TranTime (Transition_time)
-) DEFAULT CHARACTER SET latin1 comment='Leap seconds information for time zones';
+) CHARACTER SET utf8 comment='Leap seconds information for time zones';
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index 7b77bf449cd..8ad2ee1df4d 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -311,6 +311,7 @@ do
fi
if test ! -f $pid_file # This is removed if normal shutdown
then
+ echo "STOPPING server from pid file $pid_file"
break
fi
@@ -321,12 +322,24 @@ do
# but should work for the rest of the servers.
# The only thing is ps x => redhat 5 gives warnings when using ps -x.
# kill -9 is used or the process won't react on the kill.
- numofproces=`ps xa | grep -v "grep" | grep -c $ledir/$MYSQLD`
+ if test -n "$mysql_tcp_port"
+ then
+ numofproces=`ps xa | grep -v "grep" | grep $ledir/$MYSQLD| grep -c "port=$mysql_tcp_port"`
+ else
+ numofproces=`ps xa | grep -v "grep" | grep -c $ledir/$MYSQLD`
+ fi
+
echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log
I=1
while test "$I" -le "$numofproces"
do
- PROC=`ps xa | grep $ledir/$MYSQLD | grep -v "grep" | sed -n '$p'`
+ if test -n "$mysql_tcp_port"
+ then
+ PROC=`ps xa | grep "$ledir/$MYSQLD\>" | grep -v "grep" | grep "port=$mysql_tcp_port" | sed -n '$p'`
+ else
+ PROC=`ps xa | grep "$ledir/$MYSQLD\>" | grep -v "grep" | sed -n '$p'`
+ fi
+
for T in $PROC
do
break
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index fcfa2efef61..4b5daf53bea 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -716,3 +716,13 @@ my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap)
return (my_time_t) tmp;
} /* my_system_gmt_sec */
+
+
+/* Set MYSQL_TIME structure to 0000-00-00 00:00:00.000000 */
+
+void set_zero_time(MYSQL_TIME *tm)
+{
+ bzero((void*) tm, sizeof(*tm));
+ tm->time_type= MYSQL_TIMESTAMP_NONE;
+}
+
diff --git a/sql/field.h b/sql/field.h
index 9cce7b9541b..e12dd60c13b 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -908,7 +908,7 @@ public:
void reset(void) { charset()->cset->fill(charset(),ptr,field_length,' '); }
int store(const char *to,uint length,CHARSET_INFO *charset);
int store(longlong nr);
- int store(double nr) { return Field_str::store(nr); }
+ int store(double nr) { return Field_str::store(nr); } /* QQ: To be deleted */
double val_real(void);
longlong val_int(void);
String *val_str(String*,String *);
@@ -955,7 +955,7 @@ public:
uint32 key_length() const { return (uint32) field_length; }
int store(const char *to,uint length,CHARSET_INFO *charset);
int store(longlong nr);
- int store(double nr) { return Field_str::store(nr); }
+ int store(double nr) { return Field_str::store(nr); } /* QQ: To be deleted */
double val_real(void);
longlong val_int(void);
String *val_str(String*,String *);
diff --git a/sql/gen_lex_hash.cc b/sql/gen_lex_hash.cc
index cb97febea32..0bbdf84c8d6 100644
--- a/sql/gen_lex_hash.cc
+++ b/sql/gen_lex_hash.cc
@@ -362,7 +362,7 @@ static int get_options(int argc, char **argv)
{
int ho_error;
- if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, 0)))
+ if ((ho_error= handle_options(&argc, &argv, my_long_options, get_one_option)))
exit(ho_error);
if (argc >= 1)
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 5aa7c02fcc0..d787159241a 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -299,8 +299,9 @@ convert_error_code_to_mysql(
} else if (error == (int) DB_CANNOT_DROP_CONSTRAINT) {
- return(HA_ERR_ROW_IS_REFERENCED);
-
+ return(HA_ERR_CANNOT_ADD_FOREIGN); /* TODO: This is a bit
+ misleading, a new MySQL error
+ code should be introduced */
} else if (error == (int) DB_COL_APPEARS_TWICE_IN_INDEX) {
return(HA_ERR_CRASHED);
diff --git a/sql/item.cc b/sql/item.cc
index 2c98aad2074..e9ef3b6a763 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -265,8 +265,9 @@ CHARSET_INFO *Item::default_charset()
return current_thd->variables.collation_connection;
}
-bool DTCollation::aggregate(DTCollation &dt)
+bool DTCollation::aggregate(DTCollation &dt, bool superset_conversion)
{
+ nagg++;
if (!my_charset_same(collation, dt.collation))
{
/*
@@ -280,15 +281,39 @@ bool DTCollation::aggregate(DTCollation &dt)
if (derivation <= dt.derivation)
; // Do nothing
else
- set(dt);
+ {
+ set(dt);
+ strong= nagg;
+ }
}
else if (dt.collation == &my_charset_bin)
{
if (dt.derivation <= derivation)
+ {
set(dt);
+ strong= nagg;
+ }
else
; // Do nothing
}
+ else if (superset_conversion)
+ {
+ if (derivation < dt.derivation &&
+ collation->state & MY_CS_UNICODE)
+ ; // Do nothing
+ else if (dt.derivation < derivation &&
+ dt.collation->state & MY_CS_UNICODE)
+ {
+ set(dt);
+ strong= nagg;
+ }
+ else
+ {
+ // Cannot convert to superset
+ set(0, DERIVATION_NONE);
+ return 1;
+ }
+ }
else
{
set(0, DERIVATION_NONE);
@@ -302,6 +327,7 @@ bool DTCollation::aggregate(DTCollation &dt)
else if (dt.derivation < derivation)
{
set(dt);
+ strong= nagg;
}
else
{
diff --git a/sql/item.h b/sql/item.h
index 6900fa11b90..23c5c844f21 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -41,16 +41,22 @@ class DTCollation {
public:
CHARSET_INFO *collation;
enum Derivation derivation;
+ uint nagg; // Total number of aggregated collations.
+ uint strong; // Number of the strongest collation.
DTCollation()
{
collation= &my_charset_bin;
derivation= DERIVATION_NONE;
+ nagg= 0;
+ strong= 0;
}
DTCollation(CHARSET_INFO *collation_arg, Derivation derivation_arg)
{
collation= collation_arg;
derivation= derivation_arg;
+ nagg= 0;
+ strong= 0;
}
void set(DTCollation &dt)
{
@@ -66,9 +72,9 @@ public:
{ collation= collation_arg; }
void set(Derivation derivation_arg)
{ derivation= derivation_arg; }
- bool aggregate(DTCollation &dt);
- bool set(DTCollation &dt1, DTCollation &dt2)
- { set(dt1); return aggregate(dt2); }
+ bool aggregate(DTCollation &dt, bool superset_conversion= FALSE);
+ bool set(DTCollation &dt1, DTCollation &dt2, bool superset_conversion= FALSE)
+ { set(dt1); return aggregate(dt2, superset_conversion); }
const char *derivation_name() const
{
switch(derivation)
@@ -239,6 +245,7 @@ public:
virtual void top_level_item() {}
virtual void set_result_field(Field *field) {}
virtual bool is_result_field() { return 0; }
+ virtual bool is_bool_func() { return 0; }
virtual void save_in_result_field(bool no_conversions) {}
virtual void no_rows_in_result() {}
virtual Item *copy_or_same(THD *thd) { return this; }
@@ -268,8 +275,7 @@ public:
virtual void bring_value() {}
Field *tmp_table_field_from_field_type(TABLE *table);
-
- /* Used in sql_select.cc:eliminate_not_funcs() */
+
virtual Item *neg_transformer(THD *thd) { return NULL; }
void delete_self()
{
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index bf7813eb9ba..85b22d1eddd 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -188,25 +188,17 @@ void Item_bool_func2::fix_length_and_dec()
{
uint strong= 0;
uint weak= 0;
+ DTCollation coll;
- if ((args[0]->collation.derivation < args[1]->collation.derivation) &&
- !my_charset_same(args[0]->collation.collation,
- args[1]->collation.collation) &&
- (args[0]->collation.collation->state & MY_CS_UNICODE))
- {
- weak= 1;
- }
- else if ((args[1]->collation.derivation < args[0]->collation.derivation) &&
- !my_charset_same(args[0]->collation.collation,
- args[1]->collation.collation) &&
- (args[1]->collation.collation->state & MY_CS_UNICODE))
- {
- strong= 1;
- }
-
- if (strong || weak)
+ if (args[0]->result_type() == STRING_RESULT &&
+ args[1]->result_type() == STRING_RESULT &&
+ !my_charset_same(args[0]->collation.collation,
+ args[1]->collation.collation) &&
+ !coll.set(args[0]->collation, args[1]->collation, TRUE))
{
Item* conv= 0;
+ strong= coll.strong;
+ weak= strong ? 0 : 1;
if (args[weak]->type() == STRING_ITEM)
{
String tmp, cstr;
@@ -219,9 +211,20 @@ void Item_bool_func2::fix_length_and_dec()
}
else
{
- conv= new Item_func_conv_charset(args[weak],args[strong]->collation.collation);
+ THD *thd= current_thd;
+ /*
+ In case we're in statement prepare, create conversion item
+ in its memory: it will be reused on each execute.
+ */
+ Item_arena *arena= thd->current_arena, backup;
+ if (arena->is_stmt_prepare())
+ thd->set_n_backup_item_arena(arena, &backup);
+ conv= new Item_func_conv_charset(args[weak],
+ args[strong]->collation.collation);
+ if (arena->is_stmt_prepare())
+ thd->restore_backup_item_arena(arena, &backup);
conv->collation.set(args[weak]->collation.derivation);
- conv->fix_fields(current_thd, 0, &conv);
+ conv->fix_fields(thd, 0, &conv);
}
args[weak]= conv ? conv : args[weak];
}
@@ -1743,12 +1746,58 @@ void Item_func_in::fix_length_and_dec()
uint const_itm= 1;
agg_cmp_type(&cmp_type, args, arg_count);
- if ((cmp_type == STRING_RESULT) &&
- (agg_arg_collations_for_comparison(cmp_collation, args, arg_count)))
- return;
-
+
for (arg=args+1, arg_end=args+arg_count; arg != arg_end ; arg++)
const_itm&= arg[0]->const_item();
+
+
+ if (cmp_type == STRING_RESULT)
+ {
+ /*
+ We allow consts character set conversion for
+
+ item IN (const1, const2, const3, ...)
+
+ if item is in a superset for all arguments,
+ and if it is a stong side according to coercibility rules.
+
+ TODO: add covnersion for non-constant IN values
+ via creating Item_func_conv_charset().
+ */
+
+ if (agg_arg_collations_for_comparison(cmp_collation,
+ args, arg_count, TRUE))
+ return;
+ if ((!my_charset_same(args[0]->collation.collation,
+ cmp_collation.collation) || !const_itm))
+ {
+ if (agg_arg_collations_for_comparison(cmp_collation,
+ args, arg_count, FALSE))
+ return;
+ }
+ else
+ {
+ /*
+ Conversion is possible:
+ All IN arguments are constants.
+ */
+ for (arg= args+1, arg_end= args+arg_count; arg < arg_end; arg++)
+ {
+ if (!my_charset_same(cmp_collation.collation,
+ arg[0]->collation.collation))
+ {
+ Item_string *conv;
+ String tmp, cstr, *ostr= arg[0]->val_str(&tmp);
+ cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(),
+ cmp_collation.collation);
+ conv= new Item_string(cstr.ptr(),cstr.length(), cstr.charset(),
+ arg[0]->collation.derivation);
+ conv->str_value.copy();
+ arg[0]= conv;
+ }
+ }
+ }
+ }
/*
Row item with NULLs inside can return NULL or FALSE =>
@@ -2030,15 +2079,6 @@ void Item_cond::neg_arguments(THD *thd)
{
if (!(new_item= new Item_func_not(item)))
return; // Fatal OEM error
- /*
- We can use 0 as tables list because Item_func_not do not use it
- on fix_fields and its arguments are already fixed.
-
- We do not check results of fix_fields, because there are not way
- to return error in this functions interface, thd->net.report_error
- will be checked on upper level call.
- */
- new_item->fix_fields(thd, 0, &new_item);
}
VOID(li.replace(new_item));
}
@@ -2716,9 +2756,6 @@ longlong Item_cond_xor::val_int()
IS NULL(a) -> IS NOT NULL(a)
IS NOT NULL(a) -> IS NULL(a)
- NOTE
- This method is used in the eliminate_not_funcs() function.
-
RETURN
New item or
NULL if we cannot apply NOT transformation (see Item::neg_transformer()).
@@ -2726,26 +2763,13 @@ longlong Item_cond_xor::val_int()
Item *Item_func_not::neg_transformer(THD *thd) /* NOT(x) -> x */
{
- // We should apply negation elimination to the argument of the NOT function
- return eliminate_not_funcs(thd, args[0]);
+ return args[0];
}
Item *Item_bool_rowready_func2::neg_transformer(THD *thd)
{
Item *item= negated_item();
- if (item)
- {
- /*
- We can use 0 as tables list because Item_func* family do not use it
- on fix_fields and its arguments are already fixed.
-
- We do not check results of fix_fields, because there are not way
- to return error in this functions interface, thd->net.report_error
- will be checked on upper level call.
- */
- item->fix_fields(thd, 0, &item);
- }
return item;
}
@@ -2754,9 +2778,6 @@ Item *Item_bool_rowready_func2::neg_transformer(THD *thd)
Item *Item_func_isnull::neg_transformer(THD *thd)
{
Item *item= new Item_func_isnotnull(args[0]);
- // see comment before fix_fields in Item_bool_rowready_func2::neg_transformer
- if (item)
- item->fix_fields(thd, 0, &item);
return item;
}
@@ -2765,9 +2786,6 @@ Item *Item_func_isnull::neg_transformer(THD *thd)
Item *Item_func_isnotnull::neg_transformer(THD *thd)
{
Item *item= new Item_func_isnull(args[0]);
- // see comment before fix_fields in Item_bool_rowready_func2::neg_transformer
- if (item)
- item->fix_fields(thd, 0, &item);
return item;
}
@@ -2777,9 +2795,6 @@ Item *Item_cond_and::neg_transformer(THD *thd) /* NOT(a AND b AND ...) -> */
{
neg_arguments(thd);
Item *item= new Item_cond_or(list);
- // see comment before fix_fields in Item_bool_rowready_func2::neg_transformer
- if (item)
- item->fix_fields(thd, 0, &item);
return item;
}
@@ -2789,9 +2804,6 @@ Item *Item_cond_or::neg_transformer(THD *thd) /* NOT(a OR b OR ...) -> */
{
neg_arguments(thd);
Item *item= new Item_cond_and(list);
- // see comment before fix_fields in Item_bool_rowready_func2::neg_transformer
- if (item)
- item->fix_fields(thd, 0, &item);
return item;
}
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 4f2dcb6a412..f1a2b11aaa8 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -89,6 +89,7 @@ public:
Item_bool_func(Item *a) :Item_int_func(a) {}
Item_bool_func(Item *a,Item *b) :Item_int_func(a,b) {}
Item_bool_func(THD *thd, Item_bool_func *item) :Item_int_func(thd, item) {}
+ bool is_bool_func() { return 1; }
void fix_length_and_dec() { decimals=0; max_length=1; }
};
@@ -201,6 +202,7 @@ public:
bool have_rev_func() const { return rev_functype() != UNKNOWN_FUNC; }
void print(String *str) { Item_func::print_op(str); }
bool is_null() { return test(args[0]->is_null() || args[1]->is_null()); }
+ bool is_bool_func() { return 1; }
CHARSET_INFO *compare_collation() { return cmp.cmp_collation.collation; }
friend class Arg_comparator;
@@ -274,7 +276,7 @@ public:
enum Functype rev_functype() const { return EQUAL_FUNC; }
cond_result eq_cmp_result() const { return COND_TRUE; }
const char *func_name() const { return "<=>"; }
- Item* neg_transformer(THD *thd) { return 0; }
+ Item *neg_transformer(THD *thd) { return 0; }
};
@@ -748,6 +750,7 @@ class Item_func_in :public Item_int_func
enum Functype functype() const { return IN_FUNC; }
const char *func_name() const { return " IN "; }
bool nulls_in_row();
+ bool is_bool_func() { return 1; }
CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
};
diff --git a/sql/item_func.cc b/sql/item_func.cc
index adcba34d56b..ef845bb8266 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -75,13 +75,16 @@ static void my_coll_agg_error(Item** args, uint count, const char *fname)
}
-bool Item_func::agg_arg_collations(DTCollation &c, Item **av, uint count)
+bool Item_func::agg_arg_collations(DTCollation &c, Item **av, uint count,
+ bool allow_superset_conversion)
{
uint i;
+ c.nagg= 0;
+ c.strong= 0;
c.set(av[0]->collation);
for (i= 1; i < count; i++)
{
- if (c.aggregate(av[i]->collation))
+ if (c.aggregate(av[i]->collation, allow_superset_conversion))
{
my_coll_agg_error(av, count, func_name());
return TRUE;
@@ -92,9 +95,10 @@ bool Item_func::agg_arg_collations(DTCollation &c, Item **av, uint count)
bool Item_func::agg_arg_collations_for_comparison(DTCollation &c,
- Item **av, uint count)
+ Item **av, uint count,
+ bool allow_superset_conv)
{
- if (agg_arg_collations(c, av, count))
+ if (agg_arg_collations(c, av, count, allow_superset_conv))
return TRUE;
if (c.derivation == DERIVATION_NONE)
diff --git a/sql/item_func.h b/sql/item_func.h
index eaa0a044fd6..d45f7244e55 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -140,8 +140,11 @@ public:
Field *tmp_table_field(TABLE *t_arg);
Item *get_tmp_table_item(THD *thd);
- bool agg_arg_collations(DTCollation &c, Item **items, uint nitems);
- bool agg_arg_collations_for_comparison(DTCollation &c, Item **items, uint nitems);
+ bool agg_arg_collations(DTCollation &c, Item **items, uint nitems,
+ bool allow_superset_conversion= FALSE);
+ bool agg_arg_collations_for_comparison(DTCollation &c,
+ Item **items, uint nitems,
+ bool allow_superset_comversion= FALSE);
bool walk(Item_processor processor, byte *arg);
};
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 0ec8baf97bb..79c1be57625 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -2157,7 +2157,7 @@ void Item_func_group_concat::print(String *str)
(*order[i]->item)->print(str);
}
}
- str->append(" seperator \'", 12);
+ str->append(" separator \'", 12);
str->append(*separator);
str->append("\')", 2);
}
diff --git a/sql/lock.cc b/sql/lock.cc
index fab0a61e506..215059b8a46 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -779,7 +779,8 @@ void unlock_global_read_lock(THD *thd)
(is_not_commit || \
global_read_lock_blocks_commit))
-bool wait_if_global_read_lock(THD *thd, bool abort_on_refresh, bool is_not_commit)
+bool wait_if_global_read_lock(THD *thd, bool abort_on_refresh,
+ bool is_not_commit)
{
const char *old_message;
bool result= 0, need_exit_cond;
diff --git a/sql/log.cc b/sql/log.cc
index f4ec5d9c731..08c1b31ed0d 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -43,37 +43,41 @@ static bool test_if_number(const char *str,
#ifdef __NT__
static int eventSource = 0;
-void setupWindowsEventSource()
-{
- if (eventSource) return;
-
- eventSource = 1;
- HKEY hRegKey = NULL;
- DWORD dwError = 0;
- TCHAR szPath[ MAX_PATH ];
- // Create the event source registry key
- dwError = RegCreateKey(HKEY_LOCAL_MACHINE,
- "SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\MySQL",
- &hRegKey);
+void setup_windows_event_source()
+{
+ HKEY hRegKey= NULL;
+ DWORD dwError= 0;
+ TCHAR szPath[MAX_PATH];
+ DWORD dwTypes;
+
+ if (eventSource) // Ensure that we are only called once
+ return;
+ eventSource= 1;
- // Name of the PE module that contains the message resource
- GetModuleFileName(NULL, szPath, MAX_PATH);
+ // Create the event source registry key
+ dwError= RegCreateKey(HKEY_LOCAL_MACHINE,
+ "SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\MySQL",
+ &hRegKey);
- // Register EventMessageFile
- dwError = RegSetValueEx(hRegKey, "EventMessageFile", 0, REG_EXPAND_SZ,
- (PBYTE) szPath, strlen(szPath)+1);
+ /* Name of the PE module that contains the message resource */
+ GetModuleFileName(NULL, szPath, MAX_PATH);
+ /* Register EventMessageFile */
+ dwError = RegSetValueEx(hRegKey, "EventMessageFile", 0, REG_EXPAND_SZ,
+ (PBYTE) szPath, strlen(szPath)+1);
+
- // Register supported event types
- DWORD dwTypes = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE;
- dwError = RegSetValueEx(hRegKey, "TypesSupported", 0, REG_DWORD,
- (LPBYTE) &dwTypes, sizeof dwTypes);
+ /* Register supported event types */
+ dwTypes= (EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE |
+ EVENTLOG_INFORMATION_TYPE);
+ dwError= RegSetValueEx(hRegKey, "TypesSupported", 0, REG_DWORD,
+ (LPBYTE) &dwTypes, sizeof dwTypes);
- RegCloseKey(hRegKey);
+ RegCloseKey(hRegKey);
}
-#endif
+#endif /* __NT__ */
/****************************************************************************
@@ -1413,12 +1417,24 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u",
/* Write log events to reset the 'run environment' of the SQL command */
- if (thd && thd->options & OPTION_NO_FOREIGN_KEY_CHECKS)
+ if (thd)
{
- Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=1", 24, 0);
- e.set_log_pos(this);
- if (e.write(file))
- goto err;
+ if (thd->options & OPTION_NO_FOREIGN_KEY_CHECKS)
+ {
+ Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=1", 24, 0);
+ e.set_log_pos(this);
+ if (e.write(file))
+ goto err;
+ }
+#if MYSQL_VERSION_ID < 40100
+ if (thd->variables.convert_set)
+ {
+ Query_log_event e(thd, "SET CHARACTER SET DEFAULT", 25, 0);
+ e.set_log_pos(this);
+ if (e.write(file))
+ goto err;
+ }
+#endif
}
/*
@@ -1984,8 +2000,8 @@ void print_buffer_to_file(enum loglevel level, const char *buffer)
time_t skr;
struct tm tm_tmp;
struct tm *start;
-
- DBUG_ENTER("print_buffer_to_log");
+ DBUG_ENTER("print_buffer_to_file");
+ DBUG_PRINT("enter",("buffer: %s", buffer));
VOID(pthread_mutex_lock(&LOCK_error_log));
@@ -1999,13 +2015,13 @@ void print_buffer_to_file(enum loglevel level, const char *buffer)
start->tm_hour,
start->tm_min,
start->tm_sec,
- level == ERROR_LEVEL ? "ERROR" : level == WARNING_LEVEL ? "WARNING" : "INFORMATION",
- buffer);
+ (level == ERROR_LEVEL ? "ERROR" : level == WARNING_LEVEL ?
+ "WARNING" : "INFORMATION"),
+ buffer);
fflush(stderr);
VOID(pthread_mutex_unlock(&LOCK_error_log));
-
DBUG_VOID_RETURN;
}
@@ -2019,6 +2035,7 @@ void sql_perror(const char *message)
#endif
}
+
bool flush_error_log()
{
bool result=0;
@@ -2204,93 +2221,95 @@ void MYSQL_LOG::report_pos_in_innodb()
}
#ifdef __NT__
-void print_buffer_to_nt_eventlog(enum loglevel level, char *buff, int buffLen)
+void print_buffer_to_nt_eventlog(enum loglevel level, char *buff,
+ uint length, int buffLen)
{
HANDLE event;
char *buffptr;
LPCSTR *buffmsgptr;
-
DBUG_ENTER("print_buffer_to_nt_eventlog");
- buffptr = buff;
- if (strlen(buff) > (uint)(buffLen-4))
+ buffptr= buff;
+ if (length > (uint)(buffLen-4))
{
- char *newBuff = new char[ strlen(buff) + 4 ];
+ char *newBuff= new char[length + 4];
strcpy(newBuff, buff);
- buffptr = newBuff;
+ buffptr= newBuff;
}
- strcat(buffptr, "\r\n\r\n");
- buffmsgptr = (LPCSTR*)&buffptr;
+ strmov(buffptr+length, "\r\n\r\n");
+ buffmsgptr= (LPCSTR*) &buffptr; // Keep windows happy
- setupWindowsEventSource();
- if (event = RegisterEventSource(NULL,"MySQL"))
+ setup_windows_event_source();
+ if ((event= RegisterEventSource(NULL,"MySQL")))
{
- switch (level){
+ switch (level) {
case ERROR_LEVEL:
- ReportEvent(event, EVENTLOG_ERROR_TYPE, 0, MSG_DEFAULT, NULL, 1, 0, buffmsgptr, NULL);
+ ReportEvent(event, EVENTLOG_ERROR_TYPE, 0, MSG_DEFAULT, NULL, 1, 0,
+ buffmsgptr, NULL);
break;
case WARNING_LEVEL:
- ReportEvent(event, EVENTLOG_WARNING_TYPE, 0, MSG_DEFAULT, NULL, 1, 0, buffmsgptr, NULL);
+ ReportEvent(event, EVENTLOG_WARNING_TYPE, 0, MSG_DEFAULT, NULL, 1, 0,
+ buffmsgptr, NULL);
break;
case INFORMATION_LEVEL:
- ReportEvent(event, EVENTLOG_INFORMATION_TYPE, 0, MSG_DEFAULT, NULL, 1, 0, buffmsgptr, NULL);
+ ReportEvent(event, EVENTLOG_INFORMATION_TYPE, 0, MSG_DEFAULT, NULL, 1,
+ 0, buffmsgptr, NULL);
break;
}
DeregisterEventSource(event);
}
- // if we created a string buffer, then delete it
+ /* if we created a string buffer, then delete it */
if (buffptr != buff)
delete[] buffptr;
DBUG_VOID_RETURN;
}
-#endif
+#endif /* __NT__ */
+
/*
- Prints a printf style message to the error log and, under NT, to the Windows event log.
+ Prints a printf style message to the error log and, under NT, to the
+ Windows event log.
SYNOPSIS
vprint_msg_to_log()
- event_type Type of event to write (Error, Warning, or Info)
- format Printf style format of message
- args va_list list of arguments for the message
+ event_type Type of event to write (Error, Warning, or Info)
+ format Printf style format of message
+ args va_list list of arguments for the message
NOTE
IMPLEMENTATION
- This function prints the message into a buffer and then sends that buffer to other
- functions to write that message to other logging sources.
+ This function prints the message into a buffer and then sends that buffer
+ to other functions to write that message to other logging sources.
RETURN VALUES
void
*/
+
void vprint_msg_to_log(enum loglevel level, const char *format, va_list args)
{
char buff[1024];
+ uint length;
DBUG_ENTER("vprint_msg_to_log");
- my_vsnprintf(buff, sizeof(buff)-5, format, args);
-
+ length= my_vsnprintf(buff, sizeof(buff)-5, format, args);
print_buffer_to_file(level, buff);
-#ifndef DBUG_OFF
- DBUG_PRINT("error",("%s",buff));
-#endif
-
#ifdef __NT__
- print_buffer_to_nt_eventlog(level, buff, sizeof(buff));
+ print_buffer_to_nt_eventlog(level, buff, length, sizeof(buff));
#endif
DBUG_VOID_RETURN;
}
-void sql_print_error(const char *format, ...)
+void sql_print_error(const char *format, ...)
{
+ va_list args;
DBUG_ENTER("sql_print_error");
- va_list args;
va_start(args, format);
vprint_msg_to_log(ERROR_LEVEL, format, args);
va_end(args);
@@ -2298,11 +2317,12 @@ void sql_print_error(const char *format, ...)
DBUG_VOID_RETURN;
}
-void sql_print_warning(const char *format, ...)
+
+void sql_print_warning(const char *format, ...)
{
+ va_list args;
DBUG_ENTER("sql_print_warning");
- va_list args;
va_start(args, format);
vprint_msg_to_log(WARNING_LEVEL, format, args);
va_end(args);
@@ -2310,11 +2330,12 @@ void sql_print_warning(const char *format, ...)
DBUG_VOID_RETURN;
}
-void sql_print_information(const char *format, ...)
+
+void sql_print_information(const char *format, ...)
{
+ va_list args;
DBUG_ENTER("sql_print_information");
- va_list args;
va_start(args, format);
vprint_msg_to_log(INFORMATION_LEVEL, format, args);
va_end(args);
diff --git a/sql/log_event.cc b/sql/log_event.cc
index d10b83d550a..ef77aa6603b 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -1084,10 +1084,6 @@ end:
thd->query= 0; // just to be sure
thd->query_length= 0;
VOID(pthread_mutex_unlock(&LOCK_thread_count));
- // assume no convert for next query unless set explictly
-#ifdef TO_BE_REMOVED
- thd->variables.convert_set = 0;
-#endif
close_thread_tables(thd);
free_root(&thd->mem_root,MYF(MY_KEEP_PREALLOC));
return (thd->query_error ? thd->query_error : Log_event::exec_event(rli));
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index dcc39f30c69..b1b184eb9eb 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -297,7 +297,8 @@ enum enum_parsing_place
{
NO_MATTER,
IN_HAVING,
- SELECT_LIST
+ SELECT_LIST,
+ IN_WHERE
};
struct st_table;
@@ -376,6 +377,7 @@ int delete_precheck(THD *thd, TABLE_LIST *tables);
int insert_precheck(THD *thd, TABLE_LIST *tables, bool update);
int create_table_precheck(THD *thd, TABLE_LIST *tables,
TABLE_LIST *create_table);
+Item *negate_expression(THD *thd, Item *expr);
#include "sql_class.h"
#include "opt_range.h"
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index e7638f13526..90b6d6319bf 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -2940,6 +2940,13 @@ we force server id to 2, but this MySQL server will not act as a slave.");
#if defined(__NT__) || defined(HAVE_SMEM)
handle_connections_methods();
#else
+#ifdef __WIN__
+ if ( !have_tcpip || opt_disable_networking)
+ {
+ sql_print_error("TCP/IP unavailable or disabled with --skip-networking; no available interfaces");
+ unireg_abort(1);
+ }
+#endif
handle_connections_sockets(0);
#endif /* __NT__ */
@@ -6108,14 +6115,16 @@ mysql_getopt_value(const char *keyname, uint key_length,
return option->value;
}
-void option_error_reporter( enum loglevel level, const char *format, ... )
+
+void option_error_reporter(enum loglevel level, const char *format, ...)
{
va_list args;
- va_start( args, format );
- vprint_msg_to_log( level, format, args );
- va_end( args );
+ va_start(args, format);
+ vprint_msg_to_log(level, format, args);
+ va_end(args);
}
+
static void get_options(int argc,char **argv)
{
int ho_error;
@@ -6123,7 +6132,9 @@ static void get_options(int argc,char **argv)
my_getopt_register_get_addr(mysql_getopt_value);
strmake(def_ft_boolean_syntax, ft_boolean_syntax,
sizeof(ft_boolean_syntax)-1);
- if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, option_error_reporter)))
+ my_getopt_error_reporter= option_error_reporter;
+ if ((ho_error= handle_options(&argc, &argv, my_long_options,
+ get_one_option)))
exit(ho_error);
if (argc > 0)
{
diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt
index 047db57c86c..022a624c921 100644
--- a/sql/share/czech/errmsg.txt
+++ b/sql/share/czech/errmsg.txt
@@ -1,3 +1,19 @@
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
/*
Modifikoval Petr -B©najdr, snajdr@pvt.net, snajdr@cpress.cz v.0.01
ISO LATIN-8852-2
diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt
index 168cddec81d..18ebe5712f8 100644
--- a/sql/share/danish/errmsg.txt
+++ b/sql/share/danish/errmsg.txt
@@ -1,5 +1,18 @@
-/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
- This file is public domain and comes with NO WARRANTY of any kind */
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Knud Riishøjgård knudriis@post.tele.dk 99 &&
Carsten H. Pedersen, carsten.pedersen@bitbybit.dk oct. 1999 / aug. 2001. */
diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt
index 32d8a2ba168..54377b5949a 100644
--- a/sql/share/dutch/errmsg.txt
+++ b/sql/share/dutch/errmsg.txt
@@ -1,6 +1,20 @@
-/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
- This file is public domain and comes with NO WARRANTY of any kind
+/* Copyright (C) 2003 MySQL AB
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/*
Dutch error messages (share/dutch/errmsg.txt)
2001-08-02 - Arjen Lentz (agl@bitbike.com)
Completed earlier partial translation; worked on consistency and spelling.
diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt
index 3303cd0666a..8ede3f61a0b 100644
--- a/sql/share/english/errmsg.txt
+++ b/sql/share/english/errmsg.txt
@@ -1,5 +1,18 @@
-/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
- This file is public domain and comes with NO WARRANTY of any kind */
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
character-set=latin1
diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt
index cdfb5e9d170..5aab524e0d9 100644
--- a/sql/share/estonian/errmsg.txt
+++ b/sql/share/estonian/errmsg.txt
@@ -1,9 +1,22 @@
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
/*
- Copyright Abandoned 1997 MySQL AB
- This file is public domain and comes with NO WARRANTY of any kind
Esialgne tõlge: Tõnu Samuel (tonu@spam.ee)
Parandanud ja täiendanud: Indrek Siitan (tfr@mysql.com)
-
*/
character-set=latin7
diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt
index 72c2381dc70..355e784b156 100644
--- a/sql/share/french/errmsg.txt
+++ b/sql/share/french/errmsg.txt
@@ -1,5 +1,18 @@
-/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
- This file is public domain and comes with NO WARRANTY of any kind */
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
character-set=latin1
diff --git a/sql/share/german/errmsg.txt b/sql/share/german/errmsg.txt
index 0818895dacb..03e838dd805 100644
--- a/sql/share/german/errmsg.txt
+++ b/sql/share/german/errmsg.txt
@@ -1,6 +1,20 @@
-/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
- This file is public domain and comes with NO WARRANTY of any kind
+/* Copyright (C) 2003 MySQL AB
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/*
Dirk Munzinger (dmun@4t2.com)
2001-06-07
@@ -11,7 +25,7 @@
Stefan Hinz (stefan@mysql.com)
2003-10-01
- */
+*/
character-set=latin1
diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt
index 4ee82d91566..06f31a79a73 100644
--- a/sql/share/greek/errmsg.txt
+++ b/sql/share/greek/errmsg.txt
@@ -1,5 +1,18 @@
-/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
- This file is public domain and comes with NO WARRANTY of any kind */
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
character-set=greek
diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt
index 6be3add430e..af10c33ee2d 100644
--- a/sql/share/hungarian/errmsg.txt
+++ b/sql/share/hungarian/errmsg.txt
@@ -1,7 +1,23 @@
-/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/*
Translated by Feher Peter. Forditotta Feher Peter (feherp@mail.matav.hu) 1998
Updated May, 2000
- This file is public domain and comes with NO WARRANTY of any kind */
+*/
character-set=latin2
diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt
index fd2d33c5e2e..cd66f15db5f 100644
--- a/sql/share/italian/errmsg.txt
+++ b/sql/share/italian/errmsg.txt
@@ -1,5 +1,18 @@
-/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
- This file is public domain and comes with NO WARRANTY of any kind */
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
character-set=latin1
diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt
index 7ebce1cf662..eaab58d8403 100644
--- a/sql/share/japanese/errmsg.txt
+++ b/sql/share/japanese/errmsg.txt
@@ -1,5 +1,20 @@
-/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
- This file is public domain and comes with NO WARRANTY of any kind
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/*
3.22.10-beta euc-japanese (ujis) text
*/
diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt
index f389feb7e40..1cff50432e9 100644
--- a/sql/share/korean/errmsg.txt
+++ b/sql/share/korean/errmsg.txt
@@ -1,5 +1,18 @@
-/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
- This È­ÀÏ is public domain and comes with NO WARRANTY of any kind */
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
character-set=euckr
diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt
index 088adb43c96..27f7a18f029 100644
--- a/sql/share/norwegian-ny/errmsg.txt
+++ b/sql/share/norwegian-ny/errmsg.txt
@@ -1,5 +1,18 @@
-/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
- This file is public domain and comes with NO WARRANTY of any kind */
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Roy-Magne Mo rmo@www.hivolda.no 97 */
diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt
index 0e92867a201..772f30e5d94 100644
--- a/sql/share/norwegian/errmsg.txt
+++ b/sql/share/norwegian/errmsg.txt
@@ -1,5 +1,18 @@
-/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
- This file is public domain and comes with NO WARRANTY of any kind */
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Roy-Magne Mo rmo@www.hivolda.no 97 */
diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt
index c61db27cd58..634a4d93f42 100644
--- a/sql/share/polish/errmsg.txt
+++ b/sql/share/polish/errmsg.txt
@@ -1,6 +1,20 @@
-/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
- This file is public domain and comes with NO WARRANTY of any kind
+/* Copyright (C) 2003 MySQL AB
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/*
Changed by Jaroslaw Lewandowski <jotel@itnet.com.pl>
Charset ISO-8859-2
*/
diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt
index 66b3d9a516b..c79c346008e 100644
--- a/sql/share/portuguese/errmsg.txt
+++ b/sql/share/portuguese/errmsg.txt
@@ -1,5 +1,19 @@
-/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
- This file is public domain and comes with NO WARRANTY of any kind */
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
/* Updated by Thiago Delgado Pinto - thiagodp@ieg.com.br - 06.07.2002 */
character-set=latin1
diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt
index 43c669cb4f9..7cb0427dc3f 100644
--- a/sql/share/romanian/errmsg.txt
+++ b/sql/share/romanian/errmsg.txt
@@ -1,6 +1,20 @@
-/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
- This file is public domain and comes with NO WARRANTY of any kind
+/* Copyright (C) 2003 MySQL AB
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/*
Translated into Romanian by Stefan Saroiu
e-mail: tzoompy@cs.washington.edu
*/
diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt
index 311cfd35cb5..df354d5797f 100644
--- a/sql/share/russian/errmsg.txt
+++ b/sql/share/russian/errmsg.txt
@@ -1,6 +1,22 @@
-/* Copyright 2003 MySQL AB
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/*
Translation done in 2003 by Egor Egorov; Ensita.NET, http://www.ensita.net/
- This file is public domain and comes with NO WARRANTY of any kind */
+*/
/* charset: KOI8-R */
character-set=koi8r
diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt
index e45858805db..12c3eb2b6af 100644
--- a/sql/share/slovak/errmsg.txt
+++ b/sql/share/slovak/errmsg.txt
@@ -1,5 +1,18 @@
-/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
- This file is public domain and comes with NO WARRANTY of any kind */
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
Translated from both E n g l i s h & C z e c h error messages
diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt
index 9a3296cb405..bd2439c44a6 100644
--- a/sql/share/spanish/errmsg.txt
+++ b/sql/share/spanish/errmsg.txt
@@ -1,5 +1,20 @@
-/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
- This file is public domain and comes with NO WARRANTY of any kind
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/*
Traduccion por Miguel Angel Fernandez Roiz -- LoboCom Sistemas, s.l.
From June 28, 2001 translated by Miguel Solorzano miguel@mysql.com */
diff --git a/sql/share/swedish/errmsg.OLD b/sql/share/swedish/errmsg.OLD
deleted file mode 100644
index 3dd14c8b613..00000000000
--- a/sql/share/swedish/errmsg.OLD
+++ /dev/null
@@ -1,221 +0,0 @@
-/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
- This file is public domain and comes with NO WARRANTY of any kind */
-
-"hashchk",
-"isamchk",
-"NO",
-"YES",
-"Kan inte skapa filen: '%-.64s' (Felkod: %d)",
-"Kan inte skapa tabellen: '%-.64s' (Felkod: %d)",
-"Kan inte skapa databasen '%-.64s'. (Felkod: %d)",
-"Databasen '%-.64s' existerar redan",
-"Kan inte radera databasen '%-.64s'. Databasen finns inte",
-"Fel vid radering av databasen (Kan inte radera '%-.64s'. Felkod: %d)",
-"Fel vid radering av databasen (Kan inte radera biblioteket '%-.64s'. Felkod: %d)",
-"Kan inte radera filen: '%-.64s' (Felkod: %d)",
-"Hittar inte posten i systemregistret",
-"Kan inte läsa filinformationen (stat) från '%-.64s' (Felkod: %d)",
-"Kan inte inte läsa aktivt bibliotek. (Felkod: %d)",
-"Kan inte låsa filen. (Felkod: %d)",
-"Kan inte använda: '%-.64s'. (Felkod: %d)",
-"Hittar inte filen: '%-.64s'. (Felkod: %d)",
-"Kan inte läsa från bibliotek '%-.64s'. (Felkod: %d)",
-"Kan inte byta till: '%-.64s'. (Felkod: %d)",
-"Posten har förändrats sedan den lästes i register '%-.64s'",
-"Disken är full (%s). Väntar tills det finns ledigt utrymme....",
-"Kan inte skriva, dubbel söknyckel i register '%-.64s'",
-"Fick fel vid stängning av '%-.64s' (Felkod: %d)",
-"Fick fel vid läsning av '%-.64s' (Felkod %d)",
-"Kan inte byta namn från '%-.64s' till '%-.64s' (Felkod: %d)",
-"Fick fel vid skrivning till '%-.64s' (Felkod %d)",
-"'%-.64s' är låst mot användning",
-"Sorteringen avbruten",
-"Formulär '%-.64s' finns inte i '%-.64s'",
-"Fick felkod %d från databashanteraren",
-"Registrets databas har inte denna facilitet",
-"Hittar inte posten",
-"Felaktig fil: '%-.64s'",
-"Fatalt fel vid hantering av register '%-.64s'. Kör en reparation",
-"Gammal nyckelfil '%-.64s'; Reparera registret",
-"'%-.64s' är skyddad mot förändring",
-"Oväntat slut på minnet, starta om programmet och försök på nytt (Behövde %d bytes)",
-"Sorteringsbufferten räcker inte till. Kontrollera startparametrarna",
-"Oväntat filslut vid läsning från '%-.64s' (Felkod: %d)",
-"För många anslutningar",
-"Fick slut på minnet. Kontrollera ifall mysqld eller någon annan process använder allt tillgängligt minne. Ifall inte, försök använda 'ulimit' eller allokera mera swap",
-"Kan inte hitta 'hostname' för din adress",
-"Fel vid initiering av kommunikationen med klienten",
-"Användare '%-.32s@%-.64s' är ej berättigad att använda databasen %-.64s",
-"Användare '%-.32s@%-.64s' är ej berättigad att logga in (Använder lösen: %s)",
-"Ingen databas i användning",
-"Okänt commando",
-"Kolumn '%-.64s' får inte vara NULL",
-"Okänd database '%-.64s'",
-"Tabellen '%-.64s' finns redan",
-"Okänd tabell '%-.64s'",
-"Kolumn: '%-.64s' i %s är inte unik",
-"Servern går nu ned",
-"Okänd kolumn '%-.64s' i %s",
-"'%-.64s' finns inte i GROUP BY",
-"Kan inte använda GROUP BY med '%-.64s'",
-"Kommandot har både sum functions och enkla funktioner",
-"Antalet kolumner motsvarar inte antalet värden",
-"Kolumn namn '%-.64s' är för långt",
-"Kolumn namn '%-64s finns flera gånger",
-"Nyckel namn '%-.64s' finns flera gånger",
-"Dubbel nyckel '%-.64s' för nyckel: %d",
-"Felaktigt kolumn typ för kolumn: '%-.64s'",
-"%s nära '%-.64s' på rad %d",
-"Frågan var tom",
-"Icke unikt tabell/alias: '%-.64s'",
-"Ogiltigt DEFAULT värde för '%-.64s'",
-"Flera PRIMARY KEY använda",
-"För många nycklar använda. Man får ha högst %d nycklar",
-"För många nyckel delar använda. Man får ha högst %d nyckeldelar",
-"För lång nyckel. Högsta tillåtna nyckellängd är %d",
-"Nyckel kolumn '%-.64s' finns inte",
-"En BLOB '%-.64s' kan inte vara nyckel med den använda tabellen typen",
-"För stor kolumnlängd angiven för '%-.64s' (max= %d). Använd en BLOB instället",
-"Det får finnas endast ett AUTO_INCREMENT fält och detta måste vara en nyckel",
-"%s: klar att ta emot klienter\n",
-"%s: Normal avslutning\n",
-"%s: Fick signal %d. Avslutar!\n",
-"%s: Avslutning klar\n",
-"%s: Stänger av tråd %ld användare: '%-.64s'\n",
-"Kan inte skapa IP socket",
-"Tabellen '%-.64s' har inget index som motsvarar det angivna i CREATE INDEX. Skapa om tabellen",
-"Fält separatorerna är inte emotsägande eller för långa. Kontrollera mot manualen",
-"Man kan inte använda fast radlängd med blobs. Använd 'fields terminated by'."
-"Textfilen '%' måste finnas i databas biblioteket eller vara läsbar för alla",
-"Filen '%-.64s' existerar redan",
-"Rader: %ld Bortagna: %ld Dubletter: %ld Varningar: %ld",
-"Rader: %ld Dubletter: %ld",
-"Felaktig delnyckel. Nyckeldelen är inte en sträng eller den angivna längden är längre än kolumnlängden",
-"Man kan inte radera alla fält med ALTER TABLE. Använd DROP TABLE istället",
-"Kan inte ta bort '%-.64s'. Kontrollera att fältet/nyckel finns",
-"Rader: %ld Dubletter: %ld Varningar: %ld",
-"INSERT table '%-.64s' får inte finnas i FROM tabell-listan",
-"Finns inget thread med id %lu",
-"Du är inte ägare till thread %lu",
-"Inga tabeller angivna",
-"För många alternativ till kolumn %s för SET",
-"Kan inte generera ett unikt filnamn %s.(1-999)\n",
-"Tabell '%-.64s' kan inte uppdateras emedan den är låst för läsning",
-"Tabell '%-.64s' är inte låst med LOCK TABLES",
-"BLOB fält '%-.64s' kan inte ha ett DEFAULT värde"
-"Felaktigt databas namn '%-.64s'",
-"Felaktigt tabell namn '%-.64s'",
-"Den angivna frågan skulle troligen ta mycket long tid! Kontrollar din WHERE och använd SET OPTION SQL_BIG_SELECTS=1 ifall du vill hantera stora joins",
-"Oidentifierat fel",
-"Okänd procedur: %s",
-"Felaktigt antal parametrar till procedur %s",
-"Felaktiga parametrar till procedur %s",
-"Okänd tabell '%-.64s' i '%-.64s'",
-"Fält '%-.64s' är redan använt",
-"Felaktig användning av SQL grupp function",
-"Tabell '%-.64s' har en extension som inte finns i denna version av MySQL",
-"Tabeller måste ha minst 1 kolumn",
-"Tabellen '%-.64s' är full",
-"Okänt karaktärset: '%-.64s'",
-"För många tabeller. MySQL can ha högst %d tabeller i en och samma join"
-"För många fält",
-"För stor total rad längd. Den högst tillåtna rad-längden, förutom BLOBs, är %d. Ändra några av dina fält till BLOB",
-"Tråd-stacken tog slut: Har använt %ld av %ld bytes. Använd 'mysqld -O thread_stack=#' ifall du behöver en större stack",
-"Felaktigt referens i OUTER JOIN. Kontrollera ON uttrycket",
-"Kolumn '%-.32s' är använd med UNIQUE eller INDEX men är inte definerad med NOT NULL",
-"Kan inte ladda funktionen '%-.64s'",
-"Kan inte initialisera funktionen '%-.64s'; '%-.80s'",
-"Man får inte ange sökväg för dynamiska bibliotek",
-"Funktionen '%-.64s' finns redan",
-"Kan inte öppna det dynamiska biblioteket '%-.64s' (Felkod: %d %s)",
-"Hittar inte funktionen '%-.64s' in det dynamiska biblioteket",
-"Funktionen '%-.64s' är inte definierad",
-"Denna dator '%-.64s' är blockerad pga många felaktig paket. Gör 'mysqladmin flush-hosts' för att ta bort alla blockeringarna",
-"Denna dator '%-.64s' har inte privileger att använda denna MySQL server",
-"Du använder MySQL som en anonym användare och som sådan får du inte ändra ditt lösenord",
-"För att ändra lösenord för andra måste du ha rättigheter att uppdatera mysql databasen",
-"Hittade inte användaren i 'user' tabellen",
-"Rader: %ld Uppdaterade: %ld Varningar: %ld",
-"Kan inte skapa en ny tråd (errno %d)"
-"Antalet kolumner motsvarar inte antalet värden på rad: %ld",
-"Kunde inte stänga och öppna tabell: '%-.64s',
-"Felaktig använding av NULL",
-"Fix fel '%-.64s' från REGEXP",
-"Man får ha både GROUP kolumner (MIN(),MAX(),COUNT()...) och fält i en fråga om man inte har en GROUP BY del",
-"Det finns inget privilegium definierat för användare '%-.32s' på '%-.64s'",
-"%-.16s ej tillåtet för '%-.32s@%-.64s' för tabell '%-.64s'",
-"%-.16s ej tillåtet för '%-.32s@%-.64s'\n för kolumn '%-.64s' i tabell '%-.64s'",
-"Felaktigt GRANT privilegium använt",
-"Felaktigt maskinnamn eller användarnamn använt med GRANT",
-"Det finns ingen tabell som heter '%-64s.%s'"
-"Det finns inget privilegium definierat för användare '%-.32s' på '%-.64s' för tabell '%-.64s'",
-"Du kan inte använda detta kommando med denna MySQL version",
-"Du har något fel i din syntax",
-"DELAYED INSERT tråden kunde inte låsa tabell '%-.64s'",
-"Det finns redan 'max_delayed_threads' trådar i använding",
-"Avbröt länken för tråd %ld till db: '%-.64s' användare: '%-.64s' (%s)",
-"Kommunkationspaketet är större än 'max_allowed_packet'",
-"Fick läsfel från klienten vid läsning från 'PIPE'",
-"Fick fatalt fel från 'fcntl()'",
-"Kommunikationspaketen kom i fel ordning",
-"Kunde inte packa up kommunikationspaketet",
-"Fick ett fel vid läsning från klienten",
-"Fick 'timeout' vid läsning från klienten",
-"Fick ett fel vid skrivning till klienten",
-"Fick 'timeout' vid skrivning till klienten",
-"Resultat strängen är längre än max_allowed_packet",
-"Den använda tabell typen kan inte hantera BLOB/TEXT kolumner",
-"Den använda tabell typen kan inte hantera AUTO_INCREMENT kolumner",
-"INSERT DELAYED kan inte användas med tabell '%-.64s', emedan den är låst med LOCK TABLES",
-"Felaktigt column namn '%-.100s'",
-"Den använda tabell typen kan inte indexera kolumn '%-.64s'",
-"Tabellerna i MERGE tabellen är inte identiskt definierade",
-"Kan inte skriva till tabell '%-.64s'; UNIQUE test",
-"Du har inte angett en nyckel längd för BLOB '%-.64s'",
-"Alla delar av en PRIMARY KEY måste vara NOT NULL; Om du vill ha en nyckel med NULL, använd UNIQUE istället",
-"Resultet bestod av mera än en rad",
-"Denna tabell typ kräver en PRIMARY KEY",
-"Denna version av MySQL är inte kompilerad med RAID",
-"Du använder 'säker uppdaterings mod' och försökte uppdatera en table utan en WHERE sats som använder sig av en nyckel",
-"Nyckel '%-.64s' finns inte in tabell '%-.64s'",
-"Kan inte öppna tabellen",
-"Tabellhanteraren för denna tabell kan inte göra check/repair",
-"Du får inte utföra detta kommando i en transaktion",
-"Fick fel %d vid COMMIT",
-"Fick fel %d vid ROLLBACK",
-"Fick fel %d vid FLUSH_LOGS",
-"Fick fel %d vid CHECKPOINT",
-"Avbröt länken för tråd %ld till db: '%-.64s' användare: '%-.32s' Host: '%-.64s' (%.-64s)",
-"Tabellhanteraren klarar inte en binär kopiering av tabellen",
-"Binärloggen stängdes medan vi gjorde FLUSH MASTER",
-"Failed rebuilding the index of dumped table '%-.64s'",
-"Fick en master: '%-.64s'",
-"Fick nätverksfel vid läsning från master",
-"Fick nätverksfel vid skrivning till master",
-"Hittar inte ett FULLTEXT index i kolumnlistan",
-"Kan inte exekvera kommandot emedan du har en låst tabell eller an aktiv transaktion",
-"Okänd system variabel '%-.64'",
-"Tabell '%-.64s' är crashad och bör repareras med REPAIR TABLE",
-"Tabell '%-.64s' är crashad och senast (automatiska?) reparation misslyckades",
-"Warning: Några icke transaktionella tabeller kunde inte återställas vid ROLLBACK",
-"Transaktionen krävde mera än 'max_binlog_cache_size' minne. Utöka denna mysqld variabel och försök på nytt",
-"Denna operation kan inte göras under replikering; Gör SLAVE STOP först",
-"Denna operation kan endast göras under replikering; Konfigurera slaven och gör SLAVE START",
-"Servern är inte konfigurerade som en replikations slav. Ändra konfigurationsfilen eller gör CHANGE MASTER TO",
-"Kunde inte initializera replications-strukturerna. Kontrollera privilegerna för 'master.info'",
-"Kunde inte starta en tråd för replikering",
-"Användare '%-.64s' har redan 'max_user_connections' aktiva inloggningar",
-"Man kan endast använda konstant-uttryck med SET",
-"Fick inte ett lås i tid",
-"Antal lås överskrider antalet reserverade lås",
-"Updaterings-lås kan inte göras när man använder READ UNCOMMITTED",
-"DROP DATABASE är inte tillåtet när man har ett globalt läs-lås",
-"CREATE DATABASE är inte tillåtet när man har ett globalt läs-lås",
-"Felaktiga argument till %s",
-"%-.32s@%-.64s har inte rättigheter att skapa nya användare",
-"Fick fel vid anslutning till master: %-.128s",
-"Fick fel vid utförande av command på mastern: %-.128s",
-"Fick fel vid utförande av %s: %-.128s",
-"Felaktig använding av %s and %s",
-"SELECT kommandona har olika antal kolumner"
-"Kan inte utföra kommandot emedan du har ett READ lås",
diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt
index 85271f81b2b..da75e4fcede 100644
--- a/sql/share/swedish/errmsg.txt
+++ b/sql/share/swedish/errmsg.txt
@@ -1,5 +1,18 @@
-/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
- This file is public domain and comes with NO WARRANTY of any kind */
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
character-set=latin1
diff --git a/sql/share/ukrainian/errmsg.txt b/sql/share/ukrainian/errmsg.txt
index 87789018185..a19cf946cb1 100644
--- a/sql/share/ukrainian/errmsg.txt
+++ b/sql/share/ukrainian/errmsg.txt
@@ -1,6 +1,20 @@
-/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
- * This ÆÁÊÌ is public domain and comes with NO WARRANTY of any kind
- *
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/*
* Ukrainian translation by Roman Festchook <roma@orta.zt.ua>
* Encoding: KOI8-U
* Version: 13/09/2001 mysql-3.23.41
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index ea7b4521247..ac5008717e6 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -2138,7 +2138,10 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
select list over other fields from the tables participating in
this select in case of ambiguity.
- QQ: Why do we use simple strcmp for table name comparison here ?
+ We use strcmp for table names and database names as these may be
+ case sensitive.
+ In cases where they are not case sensitive, they are always in lower
+ case.
*/
if (!my_strcasecmp(system_charset_info, item_field->field_name,
field_name) &&
@@ -2157,10 +2160,12 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
}
found= li.ref();
*counter= i;
+ if (db_name)
+ break; // Perfect match
}
}
else if (!my_strcasecmp(system_charset_info, item_field->name,
- field_name))
+ field_name))
{
/*
If table name was not given we should scan through aliases
@@ -2230,7 +2235,7 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
}
if (found)
return found;
- else if (report_error != REPORT_EXCEPT_NOT_FOUND)
+ if (report_error != REPORT_EXCEPT_NOT_FOUND)
{
if (report_error == REPORT_ALL_ERRORS)
my_printf_error(ER_BAD_FIELD_ERROR, ER(ER_BAD_FIELD_ERROR), MYF(0),
@@ -2445,13 +2450,16 @@ insert_fields(THD *thd,TABLE_LIST *tables, const char *db_name,
uint found;
DBUG_ENTER("insert_fields");
-
if (db_name && lower_case_table_names)
{
- /* convert database to lower case for comparison */
+ /*
+ convert database to lower case for comparison
+ We can't do this in Item_field as this would change the
+ 'name' of the item which may be used in the select list
+ */
strmake(name_buff, db_name, sizeof(name_buff)-1);
- my_casedn_str(system_charset_info,name_buff);
- db_name = name_buff;
+ my_casedn_str(files_charset_info, name_buff);
+ db_name= name_buff;
}
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 84821cb8748..b103ee29095 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -890,8 +890,10 @@ static File create_file(THD *thd, char *path, sql_exchange *exchange,
#ifdef DONT_ALLOW_FULL_LOAD_DATA_PATHS
option|= MY_REPLACE_DIR; // Force use of db directory
#endif
- (void) fn_format(path, exchange->file_name, thd->db ? thd->db : "", "",
- option);
+
+ strxnmov(path, FN_REFLEN, mysql_real_data_home, thd->db ? thd->db : "",
+ NullS);
+ (void) fn_format(path, exchange->file_name, path, "", option);
if (!access(path, F_OK))
{
my_error(ER_FILE_EXISTS_ERROR, MYF(0), exchange->file_name);
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index 30b06e91082..05ad2094372 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -222,10 +222,12 @@ static int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit,
table->next= thd->derived_tables;
thd->derived_tables= table;
}
+ }
+ else
+ free_tmp_table(thd, table);
exit:
- delete derived_result;
- lex->current_select= save_current_select;
- }
+ delete derived_result;
+ lex->current_select= save_current_select;
DBUG_RETURN(res);
}
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 8442d03c1d9..1ad9a6aa952 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -180,26 +180,16 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
ex->file_name+=dirname_length(ex->file_name);
#endif
if (!dirname_length(ex->file_name) &&
- strlen(ex->file_name)+strlen(mysql_data_home)+strlen(tdb)+3 <
+ strlen(ex->file_name)+strlen(mysql_real_data_home)+strlen(tdb)+3 <
FN_REFLEN)
{
- (void) sprintf(name,"%s/%s/%s",mysql_data_home,tdb,ex->file_name);
+ (void) sprintf(name,"%s%s/%s",mysql_real_data_home,tdb,ex->file_name);
unpack_filename(name,name); /* Convert to system format */
}
else
{
-#ifdef EMBEDDED_LIBRARY
- char *chk_name= ex->file_name;
- while ((*chk_name == ' ') || (*chk_name == 't'))
- chk_name++;
- if (*chk_name == FN_CURLIB)
- {
- sprintf(name, "%s%s", mysql_data_home, ex->file_name);
- unpack_filename(name, name);
- }
- else
-#endif /*EMBEDDED_LIBRARY*/
- unpack_filename(name,ex->file_name);
+ my_load_path(name, ex->file_name, mysql_real_data_home);
+ unpack_filename(name, name);
#if !defined(__WIN__) && !defined(OS2) && ! defined(__NETWARE__)
MY_STAT stat_info;
if (!my_stat(name,&stat_info,MYF(MY_WME)))
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 3cb356d42c8..8cf057a8532 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2335,6 +2335,21 @@ mysql_execute_command(THD *thd)
net_printf(thd,ER_UPDATE_TABLE_USED, create_table->real_name);
goto create_error;
}
+ if (lex->create_info.used_fields & HA_CREATE_USED_UNION)
+ {
+ TABLE_LIST *tab;
+ for (tab= tables; tab; tab= tab->next)
+ {
+ if (find_real_table_in_list((TABLE_LIST*) lex->create_info.
+ merge_list.first,
+ tables->db, tab->real_name))
+ {
+ net_printf(thd, ER_UPDATE_TABLE_USED, tab->real_name);
+ goto create_error;
+ }
+ }
+ }
+
if (tables && check_table_access(thd, SELECT_ACL, tables,0))
goto create_error; // Error message is given
select_lex->options|= SELECT_NO_UNLOCK;
@@ -5401,3 +5416,39 @@ int create_table_precheck(THD *thd, TABLE_LIST *tables,
check_grant(thd, want_priv, create_table, 0, UINT_MAX, 0)) ?
1 : 0);
}
+
+
+/*
+ negate given expression
+
+ SYNOPSIS
+ negate_expression()
+ thd therad handler
+ expr expression for negation
+
+ RETURN
+ negated expression
+*/
+
+Item *negate_expression(THD *thd, Item *expr)
+{
+ Item *negated;
+ if (expr->type() == Item::FUNC_ITEM &&
+ ((Item_func *) expr)->functype() == Item_func::NOT_FUNC)
+ {
+ /* it is NOT(NOT( ... )) */
+ Item *arg= ((Item_func *) expr)->arguments()[0];
+ enum_parsing_place place= thd->lex->current_select->parsing_place;
+ if (arg->is_bool_func() || place == IN_WHERE || place == IN_HAVING)
+ return arg;
+ /*
+ if it is not boolean function then we have to emulate value of
+ not(not(a)), it will be a != 0
+ */
+ return new Item_func_ne(arg, new Item_int((char*) "0", 0, 1));
+ }
+
+ if ((negated= expr->neg_transformer(thd)) != 0)
+ return negated;
+ return new Item_func_not(expr);
+}
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 708ca3a516f..1b6c7dbc9bc 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -329,15 +329,22 @@ static void set_param_double(Item_param *param, uchar **pos, ulong len)
}
#ifndef EMBEDDED_LIBRARY
+
+/*
+ Read date/time/datetime parameter values from network (binary
+ protocol). See writing counterparts of these functions in
+ libmysql.c (store_param_{time,date,datetime}).
+*/
+
static void set_param_time(Item_param *param, uchar **pos, ulong len)
{
- ulong length;
- uint day;
+ MYSQL_TIME tm;
+ ulong length= get_param_length(pos, len);
- if ((length= get_param_length(pos, len)) >= 8)
+ if (length >= 8)
{
uchar *to= *pos;
- TIME tm;
+ uint day;
tm.neg= (bool) to[0];
day= (uint) sint4korr(to+1);
@@ -359,21 +366,22 @@ static void set_param_time(Item_param *param, uchar **pos, ulong len)
tm.second= 59;
}
tm.day= tm.year= tm.month= 0;
-
- param->set_time(&tm, MYSQL_TIMESTAMP_TIME,
- MAX_TIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN);
}
+ else
+ set_zero_time(&tm);
+ param->set_time(&tm, MYSQL_TIMESTAMP_TIME,
+ MAX_TIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN);
*pos+= length;
}
static void set_param_datetime(Item_param *param, uchar **pos, ulong len)
{
- uint length;
+ MYSQL_TIME tm;
+ ulong length= get_param_length(pos, len);
- if ((length= get_param_length(pos, len)) >= 4)
+ if (length >= 4)
{
uchar *to= *pos;
- TIME tm;
tm.neg= 0;
tm.year= (uint) sint2korr(to);
@@ -394,21 +402,22 @@ static void set_param_datetime(Item_param *param, uchar **pos, ulong len)
tm.hour= tm.minute= tm.second= 0;
tm.second_part= (length > 7) ? (ulong) sint4korr(to+7) : 0;
-
- param->set_time(&tm, MYSQL_TIMESTAMP_DATETIME,
- MAX_DATETIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN);
}
+ else
+ set_zero_time(&tm);
+ param->set_time(&tm, MYSQL_TIMESTAMP_DATETIME,
+ MAX_DATETIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN);
*pos+= length;
}
static void set_param_date(Item_param *param, uchar **pos, ulong len)
{
- ulong length;
-
- if ((length= get_param_length(pos, len)) >= 4)
+ MYSQL_TIME tm;
+ ulong length= get_param_length(pos, len);
+
+ if (length >= 4)
{
uchar *to= *pos;
- TIME tm;
/*
Note, that though ranges of hour, minute and second are not checked
here we rely on them being < 256: otherwise
@@ -421,10 +430,11 @@ static void set_param_date(Item_param *param, uchar **pos, ulong len)
tm.hour= tm.minute= tm.second= 0;
tm.second_part= 0;
tm.neg= 0;
-
- param->set_time(&tm, MYSQL_TIMESTAMP_DATE,
- MAX_DATE_WIDTH * MY_CHARSET_BIN_MB_MAXLEN);
}
+ else
+ set_zero_time(&tm);
+ param->set_time(&tm, MYSQL_TIMESTAMP_DATE,
+ MAX_DATE_WIDTH * MY_CHARSET_BIN_MB_MAXLEN);
*pos+= length;
}
@@ -1041,7 +1051,7 @@ static int mysql_test_select(Prepared_statement *stmt,
THD *thd= stmt->thd;
LEX *lex= stmt->lex;
SELECT_LEX_UNIT *unit= &lex->unit;
-
+ int result= 1;
DBUG_ENTER("mysql_test_select");
#ifndef NO_EMBEDDED_ACCESS_CHECKS
@@ -1087,13 +1097,12 @@ static int mysql_test_select(Prepared_statement *stmt,
goto err_prep;
}
}
- unit->cleanup();
- DBUG_RETURN(0);
+ result= 0; // ok
err_prep:
unit->cleanup();
err:
- DBUG_RETURN(1);
+ DBUG_RETURN(result);
}
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 4ca8008c518..f3eed672231 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -3220,7 +3220,7 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse,
store_key **ref_key= j->ref.key_copy;
byte *key_buff=j->ref.key_buff, *null_ref_key= 0;
- bool keyuse_uses_no_tables= true;
+ bool keyuse_uses_no_tables= TRUE;
if (ftkey)
{
j->ref.items[0]=((Item_func*)(keyuse->val))->key_item();
@@ -3240,7 +3240,7 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse,
uint maybe_null= test(keyinfo->key_part[i].null_bit);
j->ref.items[i]=keyuse->val; // Save for cond removal
- keyuse_uses_no_tables= keyuse_uses_no_tables & !keyuse->used_tables;
+ keyuse_uses_no_tables= keyuse_uses_no_tables && !keyuse->used_tables;
if (!keyuse->used_tables &&
!(join->select_options & SELECT_DESCRIBE))
{ // Compare against constant
@@ -4339,60 +4339,6 @@ propagate_cond_constants(I_List<COND_CMP> *save_list,COND *and_father,
}
-/*
- Eliminate NOT functions from the condition tree.
-
- SYNPOSIS
- eliminate_not_funcs()
- thd thread handler
- cond condition tree
-
- DESCRIPTION
- Eliminate NOT functions from the condition tree where it's possible.
- Recursively traverse condition tree to find all NOT functions.
- Call neg_transformer() method for negated arguments.
-
- NOTE
- If neg_transformer() returned a new condition we call fix_fields().
- We don't delete any items as it's not needed. They will be deleted
- later at once.
-
- RETURN
- New condition tree
-*/
-
-COND *eliminate_not_funcs(THD *thd, COND *cond)
-{
- if (!cond)
- return cond;
- if (cond->type() == Item::COND_ITEM) /* OR or AND */
- {
- List_iterator<Item> li(*((Item_cond*) cond)->argument_list());
- Item *item;
- while ((item= li++))
- {
- Item *new_item= eliminate_not_funcs(thd, item);
- if (item != new_item)
- VOID(li.replace(new_item)); /* replace item with a new condition */
- }
- }
- else if (cond->type() == Item::FUNC_ITEM && /* 'NOT' operation? */
- ((Item_func*) cond)->functype() == Item_func::NOT_FUNC)
- {
- COND *new_cond= ((Item_func*) cond)->arguments()[0]->neg_transformer(thd);
- if (new_cond)
- {
- /*
- Here we can delete the NOT function. Something like: delete cond;
- But we don't need to do it. All items will be deleted later at once.
- */
- cond= new_cond;
- }
- }
- return cond;
-}
-
-
static COND *
optimize_cond(THD *thd, COND *conds, Item::cond_result *cond_value)
{
@@ -4401,19 +4347,6 @@ optimize_cond(THD *thd, COND *conds, Item::cond_result *cond_value)
if (conds)
{
DBUG_EXECUTE("where", print_where(conds, "original"););
- /* Eliminate NOT operators; in case of PS/SP do it once */
- if (thd->current_arena->is_first_stmt_execute())
- {
- Item_arena *arena= thd->current_arena, backup;
- thd->set_n_backup_item_arena(arena, &backup);
- conds= eliminate_not_funcs(thd, conds);
- select->prep_where= conds->copy_andor_structure(thd);
- thd->restore_backup_item_arena(arena, &backup);
- }
- else
- conds= eliminate_not_funcs(thd, conds);
- DBUG_EXECUTE("where", print_where(conds, "after negation elimination"););
-
/* change field = field to field = const for each found field = const */
propagate_cond_constants((I_List<COND_CMP> *) 0, conds, conds);
/*
diff --git a/sql/sql_select.h b/sql/sql_select.h
index 8aca43484d2..34eaa7e272d 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -438,4 +438,3 @@ bool cp_buffer_from_ref(TABLE_REF *ref);
bool error_if_full_join(JOIN *join);
int report_error(TABLE *table, int error);
int safe_index_read(JOIN_TAB *tab);
-COND *eliminate_not_funcs(THD *thd, COND *cond);
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 408f3408346..58e3bc1d9ac 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1579,7 +1579,7 @@ static int prepare_for_restore(THD* thd, TABLE_LIST* table,
reg_ext))
DBUG_RETURN(-1); // protect buffer overflow
- my_snprintf(dst_path, sizeof(dst_path), "%s/%s/%s",
+ my_snprintf(dst_path, sizeof(dst_path), "%s%s/%s",
mysql_real_data_home, db, table_name);
if (lock_and_wait_for_table_name(thd,table))
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 7194cc72c04..2af122f27f7 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -2752,8 +2752,14 @@ simple_expr:
| '+' expr %prec NEG { $$= $2; }
| '-' expr %prec NEG { $$= new Item_func_neg($2); }
| '~' expr %prec NEG { $$= new Item_func_bit_neg($2); }
- | NOT expr %prec NEG { $$= new Item_func_not($2); }
- | '!' expr %prec NEG { $$= new Item_func_not($2); }
+ | NOT expr %prec NEG
+ {
+ $$= negate_expression(YYTHD, $2);
+ }
+ | '!' expr %prec NEG
+ {
+ $$= negate_expression(YYTHD, $2);
+ }
| '(' expr ')' { $$= $2; }
| '(' expr ',' expr_list ')'
{
@@ -3595,11 +3601,17 @@ opt_all:
where_clause:
/* empty */ { Select->where= 0; }
- | WHERE expr
+ | WHERE
+ {
+ Select->parsing_place= IN_WHERE;
+ }
+ expr
{
- Select->where= $2;
- if ($2)
- $2->top_level_item();
+ SELECT_LEX *select= Select;
+ select->where= $3;
+ select->parsing_place= NO_MATTER;
+ if ($3)
+ $3->top_level_item();
}
;
@@ -4320,7 +4332,7 @@ show_param:
LEX *lex= Lex;
lex->sql_command= SQLCOM_SHOW_BINLOG_EVENTS;
} opt_limit_clause_init
- | keys_or_index FROM table_ident opt_db
+ | keys_or_index from_or_in table_ident opt_db
{
Lex->sql_command= SQLCOM_SHOW_KEYS;
if ($4)
diff --git a/sql/table.cc b/sql/table.cc
index 7d1c733b116..8b018d61e5a 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1084,6 +1084,17 @@ void append_unescaped(String *res, const char *pos, uint length)
for (; pos != end ; pos++)
{
+#if defined(USE_MB) && MYSQL_VERSION_ID < 40100
+ uint mblen;
+ if (use_mb(default_charset_info) &&
+ (mblen= my_ismbchar(default_charset_info, pos, end)))
+ {
+ res->append(pos, mblen);
+ pos+= mblen;
+ continue;
+ }
+#endif
+
switch (*pos) {
case 0: /* Must be escaped for 'mysql' */
res->append('\\');
diff --git a/tests/client_test.c b/tests/client_test.c
index ed186837d28..b124fba3f59 100644
--- a/tests/client_test.c
+++ b/tests/client_test.c
@@ -1790,7 +1790,7 @@ static void test_ps_conj_select()
MYSQL_STMT *stmt;
int rc;
MYSQL_BIND bind[2];
- long int int_data;
+ int32 int_data;
char str_data[32];
unsigned long str_length;
myheader("test_ps_conj_select");
@@ -3227,7 +3227,7 @@ static void bind_fetch(int row_count)
{
MYSQL_STMT *stmt;
int rc, i, count= row_count;
- long data[10];
+ int32 data[10];
int8 i8_data;
int16 i16_data;
int32 i32_data;
@@ -4546,7 +4546,7 @@ static void test_multi_stmt()
MYSQL_STMT *stmt, *stmt1, *stmt2;
int rc;
- ulong id;
+ uint32 id;
char name[50];
MYSQL_BIND bind[2];
ulong length[2];
@@ -4605,7 +4605,7 @@ static void test_multi_stmt()
rc= mysql_stmt_fetch(stmt);
check_execute(stmt, rc);
- fprintf(stdout, "\n int_data: %lu(%lu)", id, length[0]);
+ fprintf(stdout, "\n int_data: %lu(%lu)", (ulong) id, length[0]);
fprintf(stdout, "\n str_data: %s(%lu)", name, length[1]);
assert(id == 10);
assert(strcmp(name, "mysql") == 0);
@@ -4634,7 +4634,7 @@ static void test_multi_stmt()
rc= mysql_stmt_fetch(stmt);
check_execute(stmt, rc);
- fprintf(stdout, "\n int_data: %lu(%lu)", id, length[0]);
+ fprintf(stdout, "\n int_data: %lu(%lu)", (ulong) id, length[0]);
fprintf(stdout, "\n str_data: %s(%lu)", name, length[1]);
assert(id == 10);
assert(strcmp(name, "updated") == 0);
@@ -5042,7 +5042,7 @@ static void test_store_result()
{
MYSQL_STMT *stmt;
int rc;
- long nData;
+ int32 nData;
char szData[100];
MYSQL_BIND bind[2];
ulong length, length1;
@@ -5094,7 +5094,7 @@ static void test_store_result()
rc= mysql_stmt_fetch(stmt);
check_execute(stmt, rc);
- fprintf(stdout, "\n row 1: %ld, %s(%lu)", nData, szData, length1);
+ fprintf(stdout, "\n row 1: %ld, %s(%lu)", (long) nData, szData, length1);
assert(nData == 10);
assert(strcmp(szData, "venu") == 0);
assert(length1 == 4);
@@ -5102,7 +5102,7 @@ static void test_store_result()
rc= mysql_stmt_fetch(stmt);
check_execute(stmt, rc);
- fprintf(stdout, "\n row 2: %ld, %s(%lu)", nData, szData, length1);
+ fprintf(stdout, "\n row 2: %ld, %s(%lu)", (long) nData, szData, length1);
assert(nData == 20);
assert(strcmp(szData, "mysql") == 0);
assert(length1 == 5);
@@ -5129,7 +5129,7 @@ static void test_store_result()
rc= mysql_stmt_fetch(stmt);
check_execute(stmt, rc);
- fprintf(stdout, "\n row 1: %ld, %s(%lu)", nData, szData, length1);
+ fprintf(stdout, "\n row 1: %ld, %s(%lu)", (long) nData, szData, length1);
assert(nData == 10);
assert(strcmp(szData, "venu") == 0);
assert(length1 == 4);
@@ -5137,7 +5137,7 @@ static void test_store_result()
rc= mysql_stmt_fetch(stmt);
check_execute(stmt, rc);
- fprintf(stdout, "\n row 2: %ld, %s(%lu)", nData, szData, length1);
+ fprintf(stdout, "\n row 2: %ld, %s(%lu)", (long) nData, szData, length1);
assert(nData == 20);
assert(strcmp(szData, "mysql") == 0);
assert(length1 == 5);
@@ -5984,7 +5984,7 @@ static void test_ushort_bug()
MYSQL_STMT *stmt;
MYSQL_BIND bind[4];
ushort short_value;
- ulong long_value;
+ uint32 long_value;
ulong s_length, l_length, ll_length, t_length;
ulonglong longlong_value;
int rc;
@@ -6038,7 +6038,7 @@ static void test_ushort_bug()
check_execute(stmt, rc);
fprintf(stdout, "\n ushort : %d (%ld)", short_value, s_length);
- fprintf(stdout, "\n ulong : %ld (%ld)", long_value, l_length);
+ fprintf(stdout, "\n ulong : %lu (%ld)", (ulong) long_value, l_length);
fprintf(stdout, "\n longlong : %lld (%ld)", longlong_value, ll_length);
fprintf(stdout, "\n tinyint : %d (%ld)", tiny_value, t_length);
@@ -6068,7 +6068,7 @@ static void test_sshort_bug()
MYSQL_STMT *stmt;
MYSQL_BIND bind[4];
short short_value;
- long long_value;
+ int32 long_value;
ulong s_length, l_length, ll_length, t_length;
ulonglong longlong_value;
int rc;
@@ -6122,7 +6122,7 @@ static void test_sshort_bug()
check_execute(stmt, rc);
fprintf(stdout, "\n sshort : %d (%ld)", short_value, s_length);
- fprintf(stdout, "\n slong : %ld (%ld)", long_value, l_length);
+ fprintf(stdout, "\n slong : %ld (%ld)", (long) long_value, l_length);
fprintf(stdout, "\n longlong : %lld (%ld)", longlong_value, ll_length);
fprintf(stdout, "\n tinyint : %d (%ld)", tiny_value, t_length);
@@ -6152,7 +6152,7 @@ static void test_stiny_bug()
MYSQL_STMT *stmt;
MYSQL_BIND bind[4];
short short_value;
- long long_value;
+ int32 long_value;
ulong s_length, l_length, ll_length, t_length;
ulonglong longlong_value;
int rc;
@@ -6206,7 +6206,7 @@ static void test_stiny_bug()
check_execute(stmt, rc);
fprintf(stdout, "\n sshort : %d (%ld)", short_value, s_length);
- fprintf(stdout, "\n slong : %ld (%ld)", long_value, l_length);
+ fprintf(stdout, "\n slong : %ld (%ld)", (long) long_value, l_length);
fprintf(stdout, "\n longlong : %lld (%ld)", longlong_value, ll_length);
fprintf(stdout, "\n tinyint : %d (%ld)", tiny_value, t_length);
@@ -7251,7 +7251,7 @@ static void test_fetch_seek()
MYSQL_BIND bind[3];
MYSQL_ROW_OFFSET row;
int rc;
- long c1;
+ int32 c1;
char c2[11], c3[20];
myheader("test_fetch_seek");
@@ -7296,7 +7296,7 @@ static void test_fetch_seek()
rc= mysql_stmt_fetch(stmt);
check_execute(stmt, rc);
- fprintf(stdout, "\n row 0: %ld, %s, %s", c1, c2, c3);
+ fprintf(stdout, "\n row 0: %ld, %s, %s", (long) c1, c2, c3);
row= mysql_stmt_row_tell(stmt);
@@ -7305,21 +7305,21 @@ static void test_fetch_seek()
rc= mysql_stmt_fetch(stmt);
check_execute(stmt, rc);
- fprintf(stdout, "\n row 2: %ld, %s, %s", c1, c2, c3);
+ fprintf(stdout, "\n row 2: %ld, %s, %s", (long) c1, c2, c3);
row= mysql_stmt_row_seek(stmt, row);
rc= mysql_stmt_fetch(stmt);
check_execute(stmt, rc);
- fprintf(stdout, "\n row 2: %ld, %s, %s", c1, c2, c3);
+ fprintf(stdout, "\n row 2: %ld, %s, %s", (long) c1, c2, c3);
mysql_stmt_data_seek(stmt, 0);
rc= mysql_stmt_fetch(stmt);
check_execute(stmt, rc);
- fprintf(stdout, "\n row 0: %ld, %s, %s", c1, c2, c3);
+ fprintf(stdout, "\n row 0: %ld, %s, %s", (long) c1, c2, c3);
rc= mysql_stmt_fetch(stmt);
check_execute(stmt, rc);
@@ -8050,7 +8050,7 @@ static void test_bug1500()
MYSQL_STMT *stmt;
MYSQL_BIND bind[3];
int rc;
- long int_data[3]= {2, 3, 4};
+ int32 int_data[3]= {2, 3, 4};
const char *data;
myheader("test_bug1500");
@@ -8836,7 +8836,7 @@ static void test_multi()
char *query;
MYSQL_BIND bind[1];
int rc, i;
- long param= 1;
+ int32 param= 1;
ulong length= 1;
myheader("test_multi");
@@ -8888,11 +8888,11 @@ static void test_multi()
rc= mysql_stmt_execute(stmt_update);
check_execute(stmt_update, rc);
- fprintf(stdout, "update %ld\n", param);
+ fprintf(stdout, "update %ld\n", (long) param);
rc= mysql_stmt_execute(stmt_delete);
check_execute(stmt_delete, rc);
- fprintf(stdout, "delete %ld\n", param);
+ fprintf(stdout, "delete %ld\n", (long) param);
rc= mysql_stmt_execute(stmt_select1);
check_execute(stmt_select1, rc);
@@ -8966,9 +8966,9 @@ static void test_bind_nagative()
char *query;
int rc;
MYSQL_BIND bind[1];
- long my_val= 0L;
+ int32 my_val= 0;
ulong my_length= 0L;
- long my_null= 0L;
+ my_bool my_null= FALSE;
myheader("test_insert_select");
rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
@@ -9010,9 +9010,9 @@ static void test_derived()
MYSQL_STMT *stmt;
int rc, i;
MYSQL_BIND bind[1];
- long my_val= 0L;
+ int32 my_val= 0;
ulong my_length= 0L;
- long my_null= 0L;
+ my_bool my_null= FALSE;
const char *query=
"select count(1) from (select f.id from t1 f where f.id=?) as x";
@@ -9520,7 +9520,7 @@ static void test_union_param()
MYSQL_BIND bind[2];
char my_val[4];
ulong my_length= 3L;
- long my_null= 0L;
+ my_bool my_null= FALSE;
myheader("test_union_param");
strcpy(my_val, "abc");
@@ -9904,7 +9904,7 @@ static void test_bug4079()
MYSQL_STMT *stmt;
MYSQL_BIND bind[1];
const char *stmt_text;
- unsigned long res;
+ uint32 res;
int rc;
myheader("test_bug4079");
@@ -10048,7 +10048,7 @@ static void test_bug5126()
{
MYSQL_STMT *stmt;
MYSQL_BIND bind[2];
- long c1, c2;
+ int32 c1, c2;
const char *stmt_text;
int rc;
@@ -10086,11 +10086,83 @@ static void test_bug5126()
rc= mysql_stmt_fetch(stmt);
assert(rc == 0);
assert(c1 == 8386608 && c2 == 1);
- printf("%ld, %ld\n", c1, c2);
+ printf("%ld, %ld\n", (long) c1, (long) c2);
mysql_stmt_close(stmt);
}
+static void test_bug4231()
+{
+ MYSQL_STMT *stmt;
+ MYSQL_BIND bind[2];
+ MYSQL_TIME tm[2];
+ const char *stmt_text;
+ int rc;
+
+ myheader("test_bug4231");
+
+ stmt_text= "DROP TABLE IF EXISTS t1";
+ rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
+ myquery(rc);
+
+ stmt_text= "CREATE TABLE t1 (a int)";
+ rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
+ myquery(rc);
+
+ stmt_text= "INSERT INTO t1 VALUES (1)";
+ rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
+ myquery(rc);
+
+ stmt= mysql_stmt_init(mysql);
+ stmt_text= "SELECT a FROM t1 WHERE ? = ?";
+ rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
+ check_execute(stmt, rc);
+
+ /* Bind input buffers */
+ bzero(bind, sizeof(bind));
+ bzero(tm, sizeof(tm));
+
+ bind[0].buffer_type= MYSQL_TYPE_TIME;
+ bind[0].buffer= (void*) tm;
+ bind[1].buffer_type= MYSQL_TYPE_TIME;
+ bind[1].buffer= (void*) tm+1;
+
+ mysql_stmt_bind_param(stmt, bind);
+ check_execute(stmt, rc);
+
+ /*
+ First set server-side params to some non-zero non-equal values:
+ then we will check that they are not used when client sends
+ new (zero) times.
+ */
+ tm[0].time_type = MYSQL_TIMESTAMP_DATE;
+ tm[0].year = 2000;
+ tm[0].month = 1;
+ tm[0].day = 1;
+ tm[1]= tm[0];
+ --tm[1].year; /* tm[0] != tm[1] */
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ rc= mysql_stmt_fetch(stmt);
+
+ /* binds are unequal, no rows should be returned */
+ DBUG_ASSERT(rc == MYSQL_NO_DATA);
+
+ /* Set one of the dates to zero */
+ tm[0].year= tm[0].month= tm[0].day= 0;
+ tm[1]= tm[1];
+ mysql_stmt_execute(stmt);
+ rc= mysql_stmt_fetch(stmt);
+ DBUG_ASSERT(rc == 0);
+
+ mysql_stmt_close(stmt);
+ stmt_text= "DROP TABLE t1";
+ rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
+ myquery(rc);
+}
+
/*
Read and parse arguments and MySQL options from my.cnf
*/
@@ -10189,7 +10261,7 @@ static void get_options(int argc, char **argv)
int ho_error;
if ((ho_error= handle_options(&argc, &argv, client_test_long_options,
- get_one_option, 0)))
+ get_one_option)))
exit(ho_error);
if (tty_password)
@@ -10389,6 +10461,8 @@ int main(int argc, char **argv)
test_bug4030(); /* test conversion string -> time types in
libmysql */
test_bug5126(); /* support for mediumint type in libmysql */
+ test_bug4231(); /* proper handling of all-zero times and
+ dates in the server */
/*
XXX: PLEASE RUN THIS PROGRAM UNDER VALGRIND AND VERIFY THAT YOUR TEST
DOESN'T CONTAIN WARNINGS/ERRORS BEFORE YOU PUSH.
diff --git a/tools/mysqlmanager.c b/tools/mysqlmanager.c
index 36a8b2f394c..bb0a76d6c49 100644
--- a/tools/mysqlmanager.c
+++ b/tools/mysqlmanager.c
@@ -1335,7 +1335,7 @@ static int parse_args(int argc, char **argv)
{
int ho_error;
- if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, NULL)))
+ if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
exit(ho_error);
return 0;