1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge serg.mylan:/usr/home/serg/Abk/mysql-5.0-xa

into serg.mylan:/usr/home/serg/Abk/mysql-5.0
This commit is contained in:
serg@serg.mylan
2004-11-11 13:44:10 +01:00
260 changed files with 10548 additions and 17085 deletions

View File

@ -537,6 +537,7 @@ mysql-max-4.0.2-alpha-pc-linux-gnu-i686.tar.gz
mysql-test/gmon.out
mysql-test/install_test_db
mysql-test/mysql-test-run
mysql-test/mysql_test_run_new
mysql-test/ndb/ndbcluster
mysql-test/r/*.reject
mysql-test/r/index_merge_load.result

View File

@ -98,12 +98,14 @@ kaj@work.mysql.com
kent@mysql.com
konstantin@mysql.com
kostja@oak.local
lars@mysql.com
lenz@kallisto.mysql.com
lenz@mysql.com
magnus@neptunus.(none)
magnus@shellback.(none)
marko@hundin.mysql.fi
matt@mysql.com
matthias@three.local.lan
miguel@hegel.(none)
miguel@hegel.br
miguel@hegel.local

View File

@ -1,4 +1,4 @@
#!PATH_TO_PERL -*- perl -*-
#!/usr/bin/perl
# Add path to perl on the previous line and make this executable
# if you want to use this as a normal script.
'di ';
@ -12,7 +12,7 @@
#-##############################################################################
# @(#)texi2html 1.52 971230 Written (mainly) by Lionel Cons, Lionel.Cons@cern.ch
# Enhanced by David Axmark, david@detron.se
# Enhanced by David Axmark
# The man page for this program is included at the end of this file and can be
# viewed using the command 'nroff -man texi2html'.
@ -40,8 +40,7 @@ $NODESRE = '[^@{}:\'`"]+'; # RE for a list of node names
$XREFRE = '[^@{}]+'; # RE for a xref (should use NODERE)
$ERROR = "***"; # prefix for errors and warnings
$THISPROG = "texi2html 1.52 (hacked by david\@detron.se)"; # program name and version
$HOMEPAGE = "http://www.mathematik.uni-kl.de/~obachman/Texi2html/"; # program home page
$THISPROG = "texi2html 1.52 (with additions by MySQL AB)"; # program name and version
$TODAY = &pretty_date; # like "20 September 1993"
$SPLITTAG = "<!-- SPLIT HERE -->\n"; # tag to know where to split
$PROTECTTAG = "_ThisIsProtected_"; # tag to recognize protected sections
@ -114,10 +113,12 @@ $html2_doctype = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//E
#
%accent_map = (
'"', 'uml',
'\'', 'acute',
',{', 'cedil',
'~', 'tilde',
'^', 'circ',
'`', 'grave',
'\'', 'acute',
'ringaccent{', 'ring',
);
#
@ -125,7 +126,7 @@ $html2_doctype = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//E
#
%simple_map = (
# cf. makeinfo.c
"*", "<BR>", # HTML+
"*", "<br />", # HTML+
" ", " ",
"\n", "\n",
"|", "",
@ -134,6 +135,8 @@ $html2_doctype = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//E
"!", "!",
"?", "?",
".", ".",
# @- means "allow word break", not &mdash;
"-", "",
);
#
@ -141,9 +144,10 @@ $html2_doctype = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//E
#
%things_map = (
'TeX', 'TeX',
'br', '<P>', # paragraph break
'br', '<p>', # paragraph break
'bullet', '*',
'copyright', '(C)',
'registeredsymbol', '(R)',
'dots', '...',
'equiv', '==',
'error', 'error-->',
@ -161,27 +165,28 @@ $html2_doctype = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//E
%style_map = (
'asis', '',
'b', 'B',
'cite', 'CITE',
'code', 'CODE',
'cite', 'cite',
'code', 'code',
'command', 'code',
'ctrl', '&do_ctrl', # special case
'dfn', 'STRONG', # DFN tag is illegal in the standard
'dfn', 'strong', # DFN tag is illegal in the standard
'dmn', '', # useless
'email', '&fix_email', # special
'emph', 'EM',
'file', '"TT', # will put quotes, cf. &apply_style
'i', 'I',
'kbd', 'KBD',
'key', 'KBD',
'emph', 'em',
'file', '"tt', # will put quotes, cf. &apply_style
'i', 'i',
'kbd', 'kbd',
'key', 'kbd',
'r', '', # unsupported
'samp', '"SAMP', # will put quotes, cf. &apply_style
'samp', '"samp', # will put quotes, cf. &apply_style
'sc', '&do_sc', # special case
'strong', 'STRONG',
't', 'TT',
'strong', 'strong',
't', 'tt',
'titlefont', '', # useless
'image', '&fix_image', # Image
'url', '&fix_url', # URL
'uref', '&fix_uref', # URL Reference
'var', 'VAR',
'var', 'var',
'w', '', # unsupported
);
@ -317,6 +322,7 @@ $usage = <<EOT;
This is $THISPROG
To convert a Texinfo file to HMTL: $0 [options] file
where options can be:
-acc : convert @"-like accents to &entities;
-expandinfo : use \@ifinfo sections, not \@iftex
-glossary : handle a glossary
-invisible name: use 'name' as an invisible anchor
@ -445,11 +451,15 @@ $html_num = 0;
if ($use_iso) {
$things_map{'bullet'} = "&bull;";
$things_map{'copyright'} = "&copy;";
$things_map{'registeredsymbol'} = "&reg;";
$things_map{'dots'} = "&hellip;";
$things_map{'equiv'} = "&equiv;";
$things_map{'expansion'} = "&rarr;";
$things_map{'point'} = "&lowast;";
$things_map{'result'} = "&rArr;";
$things_map{'ss'} = "&szlig;";
$things_map{'o'} = "&oslash;";
$things_map{'O'} = "&Oslash;";
}
#
@ -505,23 +515,27 @@ $html_element = ''; # current HTML element
# watch out for regexps, / and escaped characters!
$subst_code = '';
foreach (keys(%simple_map)) {
($re = $_) =~ s/(\W)/\\$1/g; # protect regexp chars
$subst_code .= "s/\\\@$re/$simple_map{$_}/g;\n";
$re = quotemeta $_; # protect regexp chars
$sub = quotemeta $simple_map{$_};
$subst_code .= "s/\\\@$re/$sub/g;\n";
}
foreach (keys(%things_map)) {
$subst_code .= "s/\\\@$_\\{\\}/$things_map{$_}/g;\n";
$re = quotemeta $_; # protect regexp chars
$sub = quotemeta $things_map{$_};
$subst_code .= "s/\\\@$re\\{\\}/$sub/g;\n";
}
if ($use_acc) {
# accentuated characters
foreach (keys(%accent_map)) {
my $brace = /{$/ ? '}' : '';
if ($_ eq "`") {
$subst_code .= "s/$;3";
} elsif ($_ eq "'") {
$subst_code .= "s/$;4";
} else {
$subst_code .= "s/\\\@\\$_";
$subst_code .= "s/\\\@\\Q$_\\E";
}
$subst_code .= "([aeiou])/&\${1}$accent_map{$_};/gi;\n";
$subst_code .= "(\\w)$brace/&\${1}$accent_map{$_};/gi;\n";
}
}
eval("sub simple_substitutions { $subst_code }");
@ -703,7 +717,7 @@ READ_LINE: while ($_ = &next_line)
s/{[^{}]+}//g);
print "# Multitable with $multitable_cols columns\n"
if $debug and $DEBUG_USER;
push(@lines, &debug("<TABLE BORDER WIDTH=\"100%\">\n", __LINE__));
push(@lines, &debug("<TABLE BORDER>\n", __LINE__));
} else {
warn "$ERROR Bad table line: $_";
}
@ -873,7 +887,7 @@ READ_LINE: while ($_ = &next_line)
&simple_substitutions;
s/\@value{($VARRE)}/$value{$1}/eg;
s/\@footnote\{/\@footnote$docu_doc\{/g; # mark footnotes, cf. pass 4
s|\s+\@tab\s*| </TD><TD> |g if ($in_multitable);
s/(^|\s+)\@tab\s*/ <\/TD><TD> /g if ($in_multitable);
#
# analyze the tag again
@ -885,7 +899,7 @@ READ_LINE: while ($_ = &next_line)
$name =~ s/\s+$//;
$level = $sec2level{$tag};
$name = &update_sec_num($tag, $level) . " $name"
if $number_sections && $tag !~ /^unnumbered/;
if $number_sections && $tag !~ /^unnumbered/ && $tag ne 'subsubheading';
if ($tag =~ /heading$/) {
push(@lines, &html_debug("\n", __LINE__));
if ($html_element ne 'body') {
@ -1079,7 +1093,7 @@ EOC
push(@lines, &debug("</TD></TR>\n", __LINE__))
unless $html_element eq 'TABLE';
&html_pop_if('TR');
$what =~ s|\s+\@tab\s*| </TD><TD> |g;
$what =~ s/(^|\s+)\@tab\s*/ <\/TD><TD> /g;
push(@lines, &debug("<TR><TD>$what\n", __LINE__));
&html_push('TR');
if ($deferred_ref)
@ -1463,11 +1477,7 @@ print "# end of pass 4\n" if $verbose;
# #
#---############################################################################
$header = <<EOT;
<!-- This HTML file has been created by $THISPROG
from $docu on $TODAY -->
EOT
$header = '';
$full_title = $value{'_title'} || $value{'_settitle'} || "Untitled Document";
$title = $value{'_settitle'} || $full_title;
$_ = &substitute_style($full_title);
@ -1815,8 +1825,10 @@ sub fix_image
die "error in image: '$text'" unless defined($1);
$arg1 = $1;
$arg1 =~ s/@@/@/g;
$ext = "jpg" if -f "$arg1.jpg";
$ext = "gif" if -f "$arg1.gif";
foreach (@include_dirs) {
$ext = "jpg" if -f "$_/$arg1.jpg";
$ext = "gif" if -f "$_/$arg1.gif";
}
if (defined($ext))
{
"<IMG SRC=\"$arg1.$ext\">";
@ -2010,7 +2022,7 @@ sub print_toplevel_header
{
local($_);
&print_header; # pass given arg...
&print_header unless $opt_empty_headers; # pass given arg...
print FILE $full_title;
if ($value{'_subtitle'}) {
$value{'_subtitle'} =~ s/\n+$//;
@ -2042,13 +2054,7 @@ EOT
sub print_toplevel_footer
{
&print_ruler;
print FILE <<EOT;
This document was generated on $TODAY using the
<A HREF=\"$HOMEPAGE\">texi2html</A>
translator version 1.52 (extended by davida\@detron.se).</P>
EOT
&print_footer;
&print_footer unless $opt_empty_headers;
}
sub protect_texi
@ -2065,8 +2071,10 @@ sub protect_html
{
local($what) = @_;
# protect & < >
# Avoid loop in & replacement. This instead bugs out for &# in text..
$what =~ s/\&([^#]|$)/\&\#38;$1/g;
# hack for the two entity-like variable reference in existing examples
$what =~ s/\&(length|ts);/\&\#38;$1;/g;
# this leaves alone entities, but encodes standalone ampersands
$what =~ s/\&(?!([a-z0-9]+|#\d+);)/\&\#38;/ig;
$what =~ s/\</\&\#60;/g;
$what =~ s/\>/\&\#62;/g;
# but recognize some HTML things

View File

@ -208,7 +208,7 @@ INCLUDES="$INCLUDES $ZLIB_INCLUDES"
LIBS="$LIBS $ZLIB_LIBS"
AC_CACHE_VAL([mysql_cv_compress],
[AC_TRY_LINK([#include <zlib.h>],
[int link_test() { return compress(0, (unsigned long*) 0, "", 0); }],
[return compress(0, (unsigned long*) 0, "", 0);],
[mysql_cv_compress="yes"
AC_MSG_RESULT([ok])],
[mysql_cv_compress="no"])

View File

@ -108,7 +108,7 @@ static const char *command_names[]= {
};
static TYPELIB command_typelib=
{ array_elements(command_names)-1,"commands", command_names};
{ array_elements(command_names)-1,"commands", command_names, NULL};
static struct my_option my_long_options[] =
{

View File

@ -81,8 +81,13 @@ static struct my_option my_long_options[] =
"To check several databases. Note the difference in usage; In this case no tables are given. All name arguments are regarded as databasenames.",
(gptr*) &opt_databases, (gptr*) &opt_databases, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
#ifdef DBUG_OFF
{"debug", '#', "This is a non-debug version. Catch this and exit.",
0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", (gptr*) &default_charset,
(gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},

View File

@ -126,7 +126,7 @@ const char *compatible_mode_names[]=
(1<<10) /* ANSI */\
)
TYPELIB compatible_mode_typelib= {array_elements(compatible_mode_names) - 1,
"", compatible_mode_names};
"", compatible_mode_names, NULL};
static struct my_option my_long_options[] =
@ -319,7 +319,7 @@ static struct my_option my_long_options[] =
{"comments", 'i', "Write additional information.",
(gptr*) &opt_comments, (gptr*) &opt_comments, 0, GET_BOOL, NO_ARG,
1, 0, 0, 0, 0, 0},
{"hex-blob", OPT_HEXBLOB, "Dump BLOBs in HEX. this mode does not work with extended-insert",
{"hex-blob", OPT_HEXBLOB, "Dump BLOBs in HEX.",
(gptr*) &opt_hex_blob, (gptr*) &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@ -1543,10 +1543,12 @@ static void dumpTable(uint numFields, char *table)
/*
63 is my_charset_bin. If charsetnr is not 63,
we have not a BLOB but a TEXT column.
we'll dump it in hex only BLOB columns.
we'll dump in hex only BLOB columns.
*/
is_blob= (opt_hex_blob && field->charsetnr == 63 &&
(field->type == FIELD_TYPE_BLOB ||
(field->type == FIELD_TYPE_STRING ||
field->type == FIELD_TYPE_VAR_STRING ||
field->type == FIELD_TYPE_BLOB ||
field->type == FIELD_TYPE_LONG_BLOB ||
field->type == FIELD_TYPE_MEDIUM_BLOB ||
field->type == FIELD_TYPE_TINY_BLOB)) ? 1 : 0;
@ -1564,6 +1566,13 @@ static void dumpTable(uint numFields, char *table)
{
if (!IS_NUM_FIELD(field))
{
/*
"length * 2 + 2" is OK for both HEX and non-HEX modes:
- In HEX mode we need exactly 2 bytes per character
plus 2 bytes for '0x' prefix.
- In non-HEX mode we need up to 2 bytes per character,
plus 2 bytes for leading and trailing '\'' characters.
*/
if (dynstr_realloc(&extended_row,length * 2+2))
{
fputs("Aborting dump (out of memory)",stderr);
@ -1572,15 +1581,11 @@ static void dumpTable(uint numFields, char *table)
}
if (opt_hex_blob && is_blob)
{
ulong counter;
unsigned char *ptr= row[i];
dynstr_append(&extended_row, "0x");
for (counter = 0; counter < lengths[i]; counter++)
{
char xx[3];
sprintf(xx, "%02X", ptr[counter]);
dynstr_append(&extended_row, xx);
}
extended_row.length+= mysql_hex_string(extended_row.str +
extended_row.length,
row[i], length);
extended_row.str[extended_row.length]= '\0';
}
else
{

View File

@ -42,7 +42,7 @@
**********************************************************************/
#define MTEST_VERSION "2.3"
#define MTEST_VERSION "2.4"
#include <my_global.h>
#include <mysql_embed.h>
@ -243,6 +243,7 @@ VAR var_reg[10];
HASH var_hash;
my_bool disable_query_log=0, disable_result_log=0, disable_warnings=0;
my_bool disable_info= 1; /* By default off */
my_bool abort_on_error= 1;
struct connection cons[MAX_CONS];
struct connection* cur_con, *next_con, *cons_end;
@ -274,6 +275,7 @@ Q_ENABLE_WARNINGS, Q_DISABLE_WARNINGS,
Q_ENABLE_INFO, Q_DISABLE_INFO,
Q_ENABLE_METADATA, Q_DISABLE_METADATA,
Q_EXEC, Q_DELIMITER,
Q_DISABLE_ABORT_ON_ERROR, Q_ENABLE_ABORT_ON_ERROR,
Q_DISPLAY_VERTICAL_RESULTS, Q_DISPLAY_HORIZONTAL_RESULTS,
Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL,
Q_START_TIMER, Q_END_TIMER,
@ -353,6 +355,8 @@ const char *command_names[]=
"disable_metadata",
"exec",
"delimiter",
"disable_abort_on_error",
"enable_abort_on_error",
"vertical_results",
"horizontal_results",
"query_vertical",
@ -741,7 +745,7 @@ err:
DBUG_RETURN(0);
}
static VAR* var_obtain(char* name, int len)
static VAR *var_obtain(const char* name, int len)
{
VAR* v;
if ((v = (VAR*)hash_search(&var_hash, name, len)))
@ -751,28 +755,33 @@ static VAR* var_obtain(char* name, int len)
return v;
}
int var_set(char* var_name, char* var_name_end, char* var_val,
char* var_val_end)
int var_set(const char *var_name, const char *var_name_end,
const char *var_val, const char *var_val_end)
{
int digit;
VAR* v;
DBUG_ENTER("var_set");
DBUG_PRINT("enter", ("var_name: '%.*s' = '%.*s' (length: %d)",
(int) (var_name_end - var_name), var_name,
(int) (var_val_end - var_val), var_val,
(int) (var_val_end - var_val)));
if (*var_name++ != '$')
{
--var_name;
*var_name_end = 0;
die("Variable name in %s does not start with '$'", var_name);
}
{
var_name--;
die("Variable name in %s does not start with '$'", var_name);
}
digit = *var_name - '0';
if (!(digit < 10 && digit >= 0))
{
v = var_obtain(var_name, var_name_end - var_name);
}
{
v = var_obtain(var_name, (uint) (var_name_end - var_name));
}
else
v = var_reg + digit;
v = var_reg + digit;
return eval_expr(v, var_val, (const char**)&var_val_end);
}
int open_file(const char* name)
{
char buff[FN_REFLEN];
@ -942,7 +951,6 @@ static void do_exec(struct st_query* q)
while (fgets(buf, sizeof(buf), res_file))
replace_dynstr_append_mem(ds, buf, strlen(buf));
}
error= pclose(res_file);
if (error != 0)
@ -1241,6 +1249,22 @@ int do_let(struct st_query* q)
return var_set(var_name, var_name_end, var_val_start, q->end);
}
/*
Store an integer (typically the returncode of the last SQL)
statement in the mysqltest builtin variable $mysql_errno, by
simulating of a user statement "let $mysql_errno= <integer>"
*/
int var_set_errno(int sql_errno)
{
const char *var_name= "$mysql_errno";
char var_val[21];
uint length= my_sprintf(var_val, (var_val, "%d", sql_errno));
return var_set(var_name, var_name + 12, var_val, var_val + length);
}
int do_rpl_probe(struct st_query* q __attribute__((unused)))
{
DBUG_ENTER("do_rpl_probe");
@ -1249,12 +1273,14 @@ int do_rpl_probe(struct st_query* q __attribute__((unused)))
DBUG_RETURN(0);
}
int do_enable_rpl_parse(struct st_query* q __attribute__((unused)))
{
mysql_enable_rpl_parse(&cur_con->mysql);
return 0;
}
int do_disable_rpl_parse(struct st_query* q __attribute__((unused)))
{
mysql_disable_rpl_parse(&cur_con->mysql);
@ -1998,7 +2024,7 @@ int read_query(struct st_query** q_ptr)
memcpy((gptr) q->expected_errno, (gptr) global_expected_errno,
sizeof(global_expected_errno));
q->expected_errors= global_expected_errors;
q->abort_on_error= global_expected_errors == 0;
q->abort_on_error= (global_expected_errors == 0 && abort_on_error);
bzero((gptr) global_expected_errno, sizeof(global_expected_errno));
global_expected_errors=0;
if (p[0] == '-' && p[1] == '-')
@ -2407,7 +2433,7 @@ static int run_query(MYSQL *mysql, struct st_query *q, int flags)
if (ps_protocol_enabled && disable_info &&
(flags & QUERY_SEND) && (flags & QUERY_REAP) && ps_match_re(q->query))
return run_query_stmt (mysql, q, flags);
return run_query_stmt(mysql, q, flags);
return run_query_normal(mysql, q, flags);
}
@ -2644,6 +2670,13 @@ end:
dynstr_free(&ds_tmp);
if (q->type == Q_EVAL)
dynstr_free(&eval_query);
/*
We save the return code (mysql_errno(mysql)) from the last call sent
to the server into the mysqltest builtin variable $mysql_errno. This
variable then can be used from the test case itself.
*/
var_set_errno(mysql_errno(mysql));
DBUG_RETURN(error);
}
@ -2993,6 +3026,7 @@ end:
dynstr_free(&ds_tmp);
if (q->type == Q_EVAL)
dynstr_free(&eval_query);
var_set_errno(mysql_stmt_errno(stmt));
mysql_stmt_close(stmt);
DBUG_RETURN(error);
}
@ -3300,7 +3334,7 @@ static VAR* var_from_env(const char *name, const char *def_val)
if (!(tmp = getenv(name)))
tmp = def_val;
v = var_init(0, name, 0, tmp, 0);
v = var_init(0, name, strlen(name), tmp, strlen(tmp));
my_hash_insert(&var_hash, (byte*)v);
return v;
}
@ -3396,6 +3430,13 @@ int main(int argc, char **argv)
init_var_hash(&cur_con->mysql);
/*
Initialize $mysql_errno with -1, so we can
- distinguish it from valid values ( >= 0 ) and
- detect if there was never a command sent to the server
*/
var_set_errno(-1);
while (!abort_flag && !read_query(&q))
{
int current_line_inc = 1, processed = 0;
@ -3415,6 +3456,8 @@ int main(int argc, char **argv)
case Q_DISABLE_RPL_PARSE: do_disable_rpl_parse(q); break;
case Q_ENABLE_QUERY_LOG: disable_query_log=0; break;
case Q_DISABLE_QUERY_LOG: disable_query_log=1; break;
case Q_ENABLE_ABORT_ON_ERROR: abort_on_error=1; break;
case Q_DISABLE_ABORT_ON_ERROR: abort_on_error=0; break;
case Q_ENABLE_RESULT_LOG: disable_result_log=0; break;
case Q_DISABLE_RESULT_LOG: disable_result_log=1; break;
case Q_ENABLE_WARNINGS: disable_warnings=0; break;
@ -4476,8 +4519,7 @@ static void get_replace_column(struct st_query *q)
my_free(start, MYF(0));
}
#ifdef __NETWARE__
#if defined(__NETWARE__) || defined(__WIN__)
/*
Substitute environment variables with text.
@ -4573,4 +4615,4 @@ FILE *my_popen(const char *cmd, const char *mode __attribute__((unused)))
return res_file;
}
#endif /* __NETWARE__ */
#endif /* __NETWARE__ or __WIN__*/

View File

@ -974,8 +974,11 @@ case $SYSTEM_TYPE-$MACHINE_TYPE-$ac_cv_prog_gcc in
CFLAGS="$CFLAGS -DBIG_TABLES"
CXXFLAGS="$CXXFLAGS -DBIG_TABLES"
;;
*) ;;
esac
case $SYSTEM_TYPE-$ac_cv_prog_gcc in
# workaround for Sun Forte compile problem for ndb
*solaris2.10*-sparc-no)
*solaris*-no)
ndb_cxxflags_fix="$ndb_cxxflags_fix -instances=static"
;;
*) ;;
@ -1036,8 +1039,8 @@ case $SYSTEM_TYPE in
;;
*hpux11.*)
echo "Enabling workarounds for hpux 11"
CFLAGS="$CFLAGS -DHPUX11 -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
CXXFLAGS="$CXXFLAGS -DHPUX11 -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -D_INCLUDE_LONGLONG -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
CFLAGS="$CFLAGS -DHPUX11 -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
CXXFLAGS="$CXXFLAGS -DHPUX11 -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -D_INCLUDE_LONGLONG -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
if test "$with_named_thread" = "no"
then
echo "Using --with-named-thread=-lpthread"
@ -1143,9 +1146,10 @@ dnl Is this the right match for DEC OSF on alpha?
fi
echo "Adding defines for OSF1"
# gethostbyname_r is deprecated and doesn't work ok on OSF1
CFLAGS="$CFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R"
CXXFLAGS="$CXXFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R"
ndb_cxxflags_fix="$ndb_cxxflags_fix -I/usr/include.dtk"
CFLAGS="$CFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_TRUNC"
CXXFLAGS="$CXXFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_TRUNC"
# fix to handle include of <stdint.h> correctly on OSF1 with cxx compiler
CXXFLAGS="$CXXFLAGS -I/usr/include/cxx -I/usr/include/cxx_cname -I/usr/include -I/usr/include.dtk"
;;
*netware*)
# No need for curses library so set it to null
@ -1916,7 +1920,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \
getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \
getpwuid getrlimit getrusage getwd gmtime_r index initgroups isnan \
localtime_r locking longjmp lrand48 madvise mallinfo memcpy memmove \
mkstemp mlockall perror poll pread pthread_attr_create clock_gettime \
mkstemp mlockall perror poll pread pthread_attr_create \
pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
@ -1925,6 +1929,18 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \
snprintf socket stpcpy strcasecmp strerror strnlen strpbrk strstr strtol \
strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr)
#
#
#
case "$target" in
*-*-aix4*)
# (grr) aix 4.3 has a stub for clock_gettime, (returning ENOSYS)
# and using AC_TRY_RUN is hard when cross-compiling
;;
*) AC_CHECK_FUNCS(clock_gettime)
;;
esac
# isinf() could be a function or a macro (HPUX)
AC_MSG_CHECKING(for isinf with <math.h>)
AC_TRY_LINK([#include <math.h>], [float f = 0.0; isinf(f)],

View File

@ -175,6 +175,8 @@ typedef uint rf_SetTimer;
#define sigset(A,B) signal((A),(B))
#define finite(A) _finite(A)
#define sleep(A) Sleep((A)*1000)
#define popen(A) popen(A,B) _popen((A),(B))
#define pclose(A) _pclose(A)
#ifndef __BORLANDC__
#define access(A,B) _access(A,B)

View File

@ -33,8 +33,8 @@ extern LIST *list_delete(LIST *root,LIST *element);
extern LIST *list_cons(void *data,LIST *root);
extern LIST *list_reverse(LIST *root);
extern void list_free(LIST *root,unsigned int free_data);
extern unsigned int list_length(LIST *list);
extern int list_walk(LIST *list,list_walk_action action,gptr argument);
extern unsigned int list_length(LIST *);
extern int list_walk(LIST *,list_walk_action action,gptr argument);
#define rest(a) ((a)->next)
#define list_push(a,b) (a)=list_cons((b),(a))

View File

@ -653,23 +653,6 @@ typedef struct st_mysql_methods
#endif
} MYSQL_METHODS;
#ifdef HAVE_DEPRECATED_411_API
/* Deprecated calls (since MySQL 4.1.2) */
/* Use mysql_stmt_init + mysql_stmt_prepare instead */
MYSQL_STMT * STDCALL mysql_prepare(MYSQL * mysql, const char *query,
unsigned long length);
#define mysql_execute mysql_stmt_execute
#define mysql_fetch mysql_stmt_fetch
#define mysql_fetch_column mysql_stmt_fetch_column
#define mysql_bind_param mysql_stmt_bind_param
#define mysql_bind_result mysql_stmt_bind_result
#define mysql_param_count mysql_stmt_param_count
#define mysql_param_result mysql_stmt_param_metadata
#define mysql_get_metadata mysql_stmt_result_metadata
#define mysql_send_long_data mysql_stmt_send_long_data
#endif /* HAVE_DEPRECATED_411_API */
MYSQL_STMT * STDCALL mysql_stmt_init(MYSQL *mysql);
int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query,

View File

@ -312,13 +312,7 @@ void my_net_local_init(NET *net);
void net_end(NET *net);
void net_clear(NET *net);
my_bool net_realloc(NET *net, unsigned long length);
#ifndef EMBEDDED_LIBRARY /* To be removed by HF */
my_bool net_flush(NET *net);
#else
#define net_flush(A)
#endif
my_bool my_net_write(NET *net,const char *packet,unsigned long len);
my_bool net_write_command(NET *net,unsigned char command,
const char *header, unsigned long head_len,

View File

@ -1067,6 +1067,12 @@ dict_create_or_check_foreign_constraint_tables(void)
there are 2 secondary indexes on SYS_FOREIGN, and they
are defined just like below */
/* NOTE: when designing InnoDB's foreign key support in 2001, we made
an error and made the table names and the foreign key id of type
'CHAR' (internally, really a VARCHAR). We should have made the type
VARBINARY, like in other InnoDB system tables, to get a clean
design. */
str =
"PROCEDURE CREATE_FOREIGN_SYS_TABLES_PROC () IS\n"
"BEGIN\n"
@ -1284,9 +1290,17 @@ loop:
fputs(".\nA foreign key constraint of name ", ef);
ut_print_name(ef, trx, foreign->id);
fputs("\nalready exists."
" (Note that internally InnoDB adds 'databasename/'\n"
" (Note that internally InnoDB adds 'databasename/'\n"
"in front of the user-defined constraint name).\n",
ef);
fputs("Note that InnoDB's FOREIGN KEY system tables store\n"
"constraint names as case-insensitive, with the\n"
"MySQL standard latin1_swedish_ci collation. If you\n"
"create tables or databases whose names differ only in\n"
"the character case, then collisions in constraint\n"
"names can occur. Workaround: name your constraints\n"
"explicitly with unique names.\n",
ef);
mutex_exit(&dict_foreign_err_mutex);

View File

@ -156,7 +156,7 @@ dict_index_build_internal_non_clust(
dict_index_t* index); /* in: user representation of a non-clustered
index */
/**************************************************************************
Removes a foreign constraint struct from the dictionet cache. */
Removes a foreign constraint struct from the dictionary cache. */
static
void
dict_foreign_remove_from_cache(
@ -606,7 +606,7 @@ dict_table_get_on_id(
dict_table_t* table;
if (ut_dulint_cmp(table_id, DICT_FIELDS_ID) <= 0
|| trx->dict_operation) {
|| trx->dict_operation_lock_mode == RW_X_LATCH) {
/* It is a system table which will always exist in the table
cache: we avoid acquiring the dictionary mutex, because
if we are doing a rollback to handle an error in TABLE

View File

@ -19,7 +19,9 @@ Created 4/24/1996 Heikki Tuuri
#include "mach0data.h"
#include "dict0dict.h"
#include "dict0boot.h"
#include "rem0cmp.h"
#include "srv0start.h"
#include "srv0srv.h"
/************************************************************************
Finds the first table name in the given database. */
@ -123,6 +125,13 @@ dict_print(void)
ulint len;
mtr_t mtr;
/* Enlarge the fatal semaphore wait timeout during the InnoDB table
monitor printout */
mutex_enter(&kernel_mutex);
srv_fatal_semaphore_wait_threshold += 7200; /* 2 hours */
mutex_exit(&kernel_mutex);
mutex_enter(&(dict_sys->mutex));
mtr_start(&mtr);
@ -145,6 +154,12 @@ loop:
mutex_exit(&(dict_sys->mutex));
/* Restore the fatal semaphore wait timeout */
mutex_enter(&kernel_mutex);
srv_fatal_semaphore_wait_threshold -= 7200; /* 2 hours */
mutex_exit(&kernel_mutex);
return;
}
@ -1242,13 +1257,27 @@ loop:
rec = btr_pcur_get_rec(&pcur);
field = rec_get_nth_field(rec, 0, &len);
/* Check if the table name in record is the one searched for */
if (len != ut_strlen(table_name)
|| 0 != ut_memcmp(field, table_name, len)) {
/* Check if the table name in the record is the one searched for; the
following call does the comparison in the latin1_swedish_ci
charset-collation, in a case-insensitive way. */
if (0 != cmp_data_data(dfield_get_type(dfield),
dfield_get_data(dfield), dfield_get_len(dfield),
field, len)) {
goto load_next_index;
}
/* Since table names in SYS_FOREIGN are stored in a case-insensitive
order, we have to check that the table name matches also in a binary
string comparison. On Unix, MySQL allows table names that only differ
in character case. */
if (0 != ut_memcmp(field, table_name, len)) {
goto next_rec;
}
if (rec_get_deleted_flag(rec)) {
goto next_rec;

View File

@ -627,7 +627,11 @@ eval_concat(
}
/*********************************************************************
Evaluates a predefined function node. */
Evaluates a predefined function node. If the first argument is an integer,
this function looks at the second argument which is the integer length in
bytes, and converts the integer to a VARCHAR.
If the first argument is of some other type, this function converts it to
BINARY. */
UNIV_INLINE
void
eval_to_binary(
@ -638,12 +642,24 @@ eval_to_binary(
que_node_t* arg2;
dfield_t* dfield;
byte* str1;
ulint len;
ulint len1;
arg1 = func_node->args;
str1 = dfield_get_data(que_node_get_val(arg1));
if (dtype_get_mtype(que_node_get_data_type(arg1)) != DATA_INT) {
len = dfield_get_len(que_node_get_val(arg1));
dfield = que_node_get_val(func_node);
dfield_set_data(dfield, str1, len);
return;
}
arg2 = que_node_get_next(arg1);
len1 = (ulint)eval_node_get_int_val(arg2);

View File

@ -2866,6 +2866,8 @@ ibuf_delete_rec(
#ifdef UNIV_IBUF_DEBUG
ibuf_count_set(space, page_no, ibuf_count_get(space, page_no) - 1);
#else
UT_NOT_USED(space);
#endif
ibuf_data_sizes_update(ibuf_data, root, mtr);
@ -3267,11 +3269,11 @@ leave_loop:
ibuf_data->n_merged_recs += n_inserts;
mutex_exit(&ibuf_mutex);
/*
fprintf(stderr,
"InnoDB: Discarded %lu ibuf entries for space %lu\n",
(ulong) n_inserts, (ulong) space);
*/
ibuf_exit();
mem_heap_free(heap);

View File

@ -463,6 +463,14 @@ lock_rec_hash(
ulint space, /* in: space */
ulint page_no);/* in: page number */
/*************************************************************************
Gets the table covered by an IX table lock. */
dict_table_t*
lock_get_ix_table(
/*==============*/
/* out: the table covered by the lock */
lock_t* lock); /* in: table lock */
/*************************************************************************
Checks that a transaction id is sensible, i.e., not in the future. */
ibool

View File

@ -175,8 +175,12 @@ int
row_lock_table_for_mysql(
/*=====================*/
/* out: error code or DB_SUCCESS */
row_prebuilt_t* prebuilt); /* in: prebuilt struct in the MySQL
row_prebuilt_t* prebuilt, /* in: prebuilt struct in the MySQL
table handle */
dict_table_t* table); /* in: table to LOCK_IX, or NULL
if prebuilt->table should be
locked as LOCK_TABLE_EXP |
prebuilt->select_lock_type */
/*************************************************************************
Does an insert for MySQL. */

View File

@ -395,6 +395,19 @@ lock_rec_get_nth_bit(
return(ut_bit_get_nth(b, bit_index));
}
/*************************************************************************
Gets the table covered by an IX table lock. */
dict_table_t*
lock_get_ix_table(
/*==============*/
/* out: the table covered by the lock */
lock_t* lock) /* in: table lock */
{
ut_a(lock->type_mode == (LOCK_TABLE | LOCK_IX));
return(lock->un_member.tab_lock.table);
}
/*************************************************************************/
#define lock_mutex_enter_kernel() mutex_enter(&kernel_mutex)

View File

@ -259,9 +259,13 @@ pars_resolve_func_data_type(
dtype_set(que_node_get_data_type(node), DATA_VARCHAR,
DATA_ENGLISH, 0, 0);
} else if (func == PARS_TO_BINARY_TOKEN) {
ut_a(dtype_get_mtype(que_node_get_data_type(arg)) == DATA_INT);
dtype_set(que_node_get_data_type(node), DATA_VARCHAR,
if (dtype_get_mtype(que_node_get_data_type(arg)) == DATA_INT) {
dtype_set(que_node_get_data_type(node), DATA_VARCHAR,
DATA_ENGLISH, 0, 0);
} else {
dtype_set(que_node_get_data_type(node), DATA_BINARY,
0, 0, 0);
}
} else if (func == PARS_TO_NUMBER_TOKEN) {
ut_a(dtype_get_mtype(que_node_get_data_type(arg))
== DATA_VARCHAR);

View File

@ -779,8 +779,12 @@ int
row_lock_table_for_mysql(
/*=====================*/
/* out: error code or DB_SUCCESS */
row_prebuilt_t* prebuilt) /* in: prebuilt struct in the MySQL
row_prebuilt_t* prebuilt, /* in: prebuilt struct in the MySQL
table handle */
dict_table_t* table) /* in: table to LOCK_IX, or NULL
if prebuilt->table should be
locked as LOCK_TABLE_EXP |
prebuilt->select_lock_type */
{
trx_t* trx = prebuilt->trx;
que_thr_t* thr;
@ -813,8 +817,12 @@ run_again:
trx_start_if_not_started(trx);
err = lock_table(LOCK_TABLE_EXP, prebuilt->table,
prebuilt->select_lock_type, thr);
if (table) {
err = lock_table(0, table, LOCK_IX, thr);
} else {
err = lock_table(LOCK_TABLE_EXP, prebuilt->table,
prebuilt->select_lock_type, thr);
}
trx->error_state = err;
@ -2365,7 +2373,8 @@ row_drop_table_for_mysql(
"WHILE found = 1 LOOP\n"
" SELECT ID INTO foreign_id\n"
" FROM SYS_FOREIGN\n"
" WHERE FOR_NAME = table_name;\n"
" WHERE FOR_NAME = table_name\n"
" AND TO_BINARY(FOR_NAME) = TO_BINARY(table_name);\n"
" IF (SQL % NOTFOUND) THEN\n"
" found := 0;\n"
" ELSE"
@ -2820,7 +2829,8 @@ row_rename_table_for_mysql(
"WHILE found = 1 LOOP\n"
" SELECT ID INTO foreign_id\n"
" FROM SYS_FOREIGN\n"
" WHERE FOR_NAME = old_table_name;\n"
" WHERE FOR_NAME = old_table_name\n"
" AND TO_BINARY(FOR_NAME) = TO_BINARY(old_table_name);\n"
" IF (SQL % NOTFOUND) THEN\n"
" found := 0;\n"
" ELSE\n"
@ -2853,7 +2863,8 @@ row_rename_table_for_mysql(
" END IF;\n"
"END LOOP;\n"
"UPDATE SYS_FOREIGN SET REF_NAME = new_table_name\n"
"WHERE REF_NAME = old_table_name;\n";
"WHERE REF_NAME = old_table_name\n"
" AND TO_BINARY(REF_NAME) = TO_BINARY(old_table_name);\n";
static const char str5[] =
"END;\n";
@ -3063,7 +3074,11 @@ row_rename_table_for_mysql(
if (err != DB_SUCCESS) {
if (err == DB_DUPLICATE_KEY) {
ut_print_timestamp(stderr);
fputs(" InnoDB: Error: table ", stderr);
fputs(
" InnoDB: Error; possible reasons:\n"
"InnoDB: 1) Table rename would cause two FOREIGN KEY constraints\n"
"InnoDB: to have the same internal name in case-insensitive comparison.\n"
"InnoDB: 2) table ", stderr);
ut_print_name(stderr, trx, new_name);
fputs(" exists in the InnoDB internal data\n"
"InnoDB: dictionary though MySQL is trying rename table ", stderr);

View File

@ -1563,7 +1563,8 @@ void my_net_local_init(NET *net)
trailing '. The caller must supply whichever of those is desired.
*/
ulong mysql_hex_string(char *to, const char *from, ulong length)
ulong STDCALL
mysql_hex_string(char *to, const char *from, ulong length)
{
char *to0= to;
const char *end;
@ -1887,22 +1888,6 @@ my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
DBUG_RETURN(0);
}
#ifdef HAVE_DEPRECATED_411_API
MYSQL_STMT * STDCALL mysql_prepare(MYSQL *mysql, const char *query,
unsigned long query_length)
{
MYSQL_STMT *stmt;
DBUG_ENTER("mysql_prepare");
stmt= mysql_stmt_init(mysql);
if (stmt && mysql_stmt_prepare(stmt, query, query_length))
{
mysql_stmt_close(stmt);
DBUG_RETURN(0);
}
DBUG_RETURN(stmt);
}
#endif
/*
Allocate memory and init prepared statement structure.

View File

@ -47,6 +47,7 @@ EXPORTS
mysql_errno
mysql_error
mysql_escape_string
mysql_hex_string
mysql_stmt_execute
mysql_stmt_fetch
mysql_stmt_fetch_column

View File

@ -2037,7 +2037,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
uint ft_max_word_len_for_sort=FT_MAX_WORD_LEN_FOR_SORT*
sort_param.keyinfo->seg->charset->mbmaxlen;
sort_info.max_records=
(ha_rows) (sort_info.filelength/ft_max_word_len_for_sort+1);
(ha_rows) (sort_info.filelength/ft_min_word_len+1);
sort_param.key_read=sort_ft_key_read;
sort_param.key_write=sort_ft_key_write;

View File

@ -354,8 +354,12 @@ static void usage(void)
puts("Description, check and repair of MyISAM tables.");
puts("Used without options all tables on the command will be checked for errors");
printf("Usage: %s [OPTIONS] tables[.MYI]\n", my_progname_short);
printf("\nGlobal options:\n\
-#, --debug=... Output debug log. Often this is 'd:t:o,filename'.\n\
printf("\nGlobal options:\n");
#ifndef DBUG_OFF
printf("\
-#, --debug=... Output debug log. Often this is 'd:t:o,filename'.\n");
#endif
printf("\
-?, --help Display this help and exit.\n\
-O, --set-variable var=option.\n\
Change the value of a variable. Please note that\n\

View File

@ -36,6 +36,12 @@ test_SCRIPTS = mysql-test-run install_test_db
test_DATA = std_data/client-key.pem std_data/client-cert.pem std_data/cacert.pem
CLEANFILES = $(test_SCRIPTS) $(test_DATA)
INCLUDES = -I$(srcdir)/../include -I../include -I..
bin_PROGRAMS = mysql_test_run_new
noinst_HEADERS = my_manage.h
mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c
dist-hook:
mkdir -p $(distdir)/t $(distdir)/r $(distdir)/include \
$(distdir)/std_data

View File

@ -321,8 +321,11 @@ select a,b from t1 where a >= 1000 order by a ;
delete from t1 where a >= 1000 ;
## replace
--error 1295
prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
execute stmt1;
execute stmt1;
execute stmt1;
## multi table statements

26
mysql-test/init_db.sql Normal file
View File

@ -0,0 +1,26 @@
CREATE DATABASE mysql;
CREATE DATABASE test;
USE mysql;
CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User)) comment='Database privileges';
INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y');
INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y');
CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) comment='Host privileges; Merged with database privileges';
CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(45) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) comment='Users and global privileges';
INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
INSERT INTO user VALUES ('','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
INSERT INTO user (host,user) values ('localhost','');
INSERT INTO user (host,user) values ('','');
CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) comment='User defined functions';
CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(60) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) comment='Table privileges';
CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) comment='Column privileges';

851
mysql-test/my_manage.c Normal file
View File

@ -0,0 +1,851 @@
/*
Copyright (c) 2003 Novell, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <errno.h>
#ifndef __WIN__
#include <dirent.h>
#endif
#include <string.h>
#ifdef __NETWARE__
#include <screen.h>
#include <proc.h>
#else
#include <sys/types.h>
#ifndef __WIN__
#include <sys/wait.h>
#include <unistd.h>
#include <fnmatch.h>
#else
#include <direct.h>
#include <stdlib.h>
#include <stdio.h>
#endif
#endif
#include <ctype.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <assert.h>
#include "my_manage.h"
#ifndef __NETWARE__
#define ASSERT assert
extern char **environ;
#endif
/******************************************************************************
macros
******************************************************************************/
/******************************************************************************
global variables
******************************************************************************/
/******************************************************************************
functions
******************************************************************************/
/******************************************************************************
init_args()
Init an argument list.
******************************************************************************/
void init_args(arg_list_t *al)
{
ASSERT(al != NULL);
al->argc= 0;
al->size= ARG_BUF;
al->argv= malloc(al->size * sizeof(char *));
ASSERT(al->argv != NULL);
return;
}
/******************************************************************************
add_arg()
Add an argument to a list.
******************************************************************************/
void add_arg(arg_list_t *al, const char *format, ...)
{
va_list ap;
char temp[PATH_MAX];
ASSERT(al != NULL);
/* increase size */
if (al->argc >= (int)al->size)
{
al->size+= ARG_BUF;
al->argv= realloc(al->argv, al->size * sizeof(char *));
ASSERT(al->argv != NULL);
}
if (format)
{
va_start(ap, format);
vsprintf(temp, format, ap);
va_end(ap);
al->argv[al->argc]= malloc(strlen(temp)+1);
ASSERT(al->argv[al->argc] != NULL);
strcpy(al->argv[al->argc], temp);
++(al->argc);
}
else
{
al->argv[al->argc]= NULL;
}
return;
}
/******************************************************************************
free_args()
Free an argument list.
******************************************************************************/
void free_args(arg_list_t *al)
{
int i;
ASSERT(al != NULL);
for (i= 0; i < al->argc; i++)
{
ASSERT(al->argv[i] != NULL);
free(al->argv[i]);
al->argv[i]= NULL;
}
free(al->argv);
al->argc= 0;
al->argv= NULL;
return;
}
/******************************************************************************
sleep_until_file_deleted()
Sleep until the given file is no longer found.
******************************************************************************/
#ifndef __WIN__
int sleep_until_file_deleted(char *pid_file)
#else
int sleep_until_file_deleted(HANDLE pid_file)
#endif
{
int err= 0; /* Initiate to supress warning */
#ifndef __WIN__
struct stat buf;
int i;
for (i= 0; (i < TRY_MAX) && (err= !stat(pid_file, &buf)); i++) sleep(1);
if (err != 0) err= errno;
#else
err= (WaitForSingleObject(pid_file, TRY_MAX*1000) == WAIT_TIMEOUT);
#endif
return err;
}
/******************************************************************************
sleep_until_file_exists()
Sleep until the given file exists.
******************************************************************************/
#ifndef __WIN__
int sleep_until_file_exists(char *pid_file)
#else
int sleep_until_file_exists(HANDLE pid_file)
#endif
{
int err= 0; /* Initiate to supress warning */
#ifndef __WIN__
struct stat buf;
int i;
for (i= 0; (i < TRY_MAX) && (err= stat(pid_file, &buf)); i++) sleep(1);
if (err != 0) err= errno;
#else
err= (WaitForSingleObject(pid_file, TRY_MAX*1000) == WAIT_TIMEOUT);
#endif
return err;
}
/******************************************************************************
wait_for_server_start()
Wait for the server on the given port to start.
******************************************************************************/
int wait_for_server_start(char *bin_dir __attribute__((unused)),
char *mysqladmin_file,
char *user, char *password, int port,char *tmp_dir)
{
arg_list_t al;
int err= 0, i;
char trash[PATH_MAX];
/* mysqladmin file */
snprintf(trash, PATH_MAX, "%s/trash.out",tmp_dir);
/* args */
init_args(&al);
add_arg(&al, "%s", mysqladmin_file);
add_arg(&al, "--no-defaults");
add_arg(&al, "--port=%u", port);
add_arg(&al, "--user=%s", user);
add_arg(&al, "--password=%s", password);
add_arg(&al, "--silent");
/* #ifdef NOT_USED */
#ifndef __NETWARE__
add_arg(&al, "-O");
add_arg(&al, "connect_timeout=10");
add_arg(&al, "-w");
#endif
add_arg(&al, "--host=localhost");
#ifndef __NETWARE__
add_arg(&al, "--protocol=tcp");
#endif
add_arg(&al, "ping");
/*
NetWare does not support the connect timeout in the TCP/IP stack
-- we will try the ping multiple times
*/
#ifndef __WIN__
for (i= 0; (i < TRY_MAX)
&& (err= spawn(mysqladmin_file, &al, TRUE, NULL,
trash, NULL, NULL)); i++) sleep(1);
#else
err= spawn(mysqladmin_file, &al, TRUE, NULL,trash, NULL, NULL);
#endif
/* free args */
free_args(&al);
return err;
}
/******************************************************************************
spawn()
Spawn the given path with the given arguments.
******************************************************************************/
#ifdef __NETWARE__
int spawn(char *path, arg_list_t *al, int join, char *input,
char *output, char *error, char *pid_file)
{
pid_t pid;
int result= 0;
wiring_t wiring= { FD_UNUSED, FD_UNUSED, FD_UNUSED };
unsigned long flags= PROC_CURRENT_SPACE | PROC_INHERIT_CWD;
/* open wiring */
if (input)
wiring.infd= open(input, O_RDONLY);
if (output)
wiring.outfd= open(output, O_WRONLY | O_CREAT | O_TRUNC);
if (error)
wiring.errfd= open(error, O_WRONLY | O_CREAT | O_TRUNC);
/* procve requires a NULL */
add_arg(al, NULL);
/* go */
pid= procve(path, flags, NULL, &wiring, NULL, NULL, 0,
NULL, (const char **)al->argv);
/* close wiring */
if (wiring.infd != -1)
close(wiring.infd);
if (wiring.outfd != -1)
close(wiring.outfd);
if (wiring.errfd != -1)
close(wiring.errfd);
return result;
}
#elif __WIN__
int spawn(char *path, arg_list_t *al, int join, char *input,
char *output, char *error, HANDLE *pid)
{
intptr_t result;
int i;
STARTUPINFO startup_info;
PROCESS_INFORMATION process_information;
DWORD exit_code;
char win_args[1024]= "";
char command_line[1024]= "";
/* Skip the first parameter */
for (i= 1; i < al->argc; i++)
{
ASSERT(al->argv[i] != NULL);
strcat(win_args,al->argv[i]);
strcat(win_args," ");
}
memset(&startup_info,0,sizeof(STARTUPINFO));
startup_info.cb= sizeof(STARTUPINFO);
if (input)
freopen(input, "rb", stdin);
if (output)
freopen(output, "wb", stdout);
if (error)
freopen(error, "wb", stderr);
result= CreateProcess(
path,
(LPSTR)&win_args,
NULL,
NULL,
TRUE,
0,
NULL,
NULL,
&startup_info,
&process_information
);
if (result && process_information.hProcess)
{
if (join)
{
if (WaitForSingleObject(process_information.hProcess, mysqld_timeout)
== WAIT_TIMEOUT)
{
exit_code= -1;
}
else
{
GetExitCodeProcess(process_information.hProcess, &exit_code);
}
CloseHandle(process_information.hProcess);
}
else
{
exit_code= 0;
}
if (pid != NULL)
*pid= process_information.hProcess;
}
else
{
exit_code= -1;
}
if (input)
freopen("CONIN$","rb",stdin);
if (output)
freopen("CONOUT$","wb",stdout);
if (error)
freopen("CONOUT$","wb",stderr);
return exit_code;
}
#else
int spawn(char *path, arg_list_t *al, int join, char *input,
char *output, char *error, char *pid_file __attribute__((unused)))
{
pid_t pid;
int res_exec= 0;
int result= 0;
pid= fork();
if (pid == -1)
{
fprintf(stderr, "fork was't created\n");
/* We can't create the fork...exit with error */
return EXIT_FAILURE;
}
if (pid > 0)
{
/* The parent process is waiting for child process if join is not zero */
if (join)
{
waitpid(pid, &result, 0);
if (WIFEXITED(result) != 0)
{
result= WEXITSTATUS(result);
}
else
{
result= EXIT_FAILURE;
}
}
}
else
{
/* Child process */
add_arg(al, NULL);
/* Reassign streams */
if (input)
freopen(input, "r", stdin);
if (output)
freopen(output, "w", stdout);
if (error)
freopen(error, "w", stderr);
/* Spawn the process */
if ((res_exec= execve(path, al->argv, environ)) < 0)
exit(EXIT_FAILURE);
/* Restore streams */
if (input)
freopen("/dev/tty", "r", stdin);
if (output)
freopen("/dev/tty", "w", stdout);
if (error)
freopen("/dev/tty", "w", stderr);
exit(0);
}
return result;
}
#endif
/******************************************************************************
stop_server()
Stop the server with the given port and pid file.
******************************************************************************/
int stop_server(char *bin_dir __attribute__((unused)), char *mysqladmin_file,
char *user, char *password, int port,
#ifndef __WIN__
char *pid_file,
#else
HANDLE pid_file,
#endif
char *tmp_dir)
{
arg_list_t al;
int err= 0;
char trash[PATH_MAX];
snprintf(trash, PATH_MAX, "%s/trash.out",tmp_dir);
/* args */
init_args(&al);
add_arg(&al, "%s", mysqladmin_file);
add_arg(&al, "--no-defaults");
add_arg(&al, "--port=%u", port);
add_arg(&al, "--user=%s", user);
add_arg(&al, "--password=%s", password);
add_arg(&al, "-O");
add_arg(&al, "shutdown_timeout=20");
#ifndef __NETWARE__
add_arg(&al, "--protocol=tcp");
#endif
add_arg(&al, "shutdown");
/* spawn */
if ((err= spawn(mysqladmin_file, &al, TRUE, NULL,
trash, NULL, NULL)) == 0)
{
sleep_until_file_deleted(pid_file);
}
else
{
#ifndef __WIN__
pid_t pid= get_server_pid(pid_file);
/* shutdown failed - kill server */
kill_server(pid);
sleep(TRY_MAX);
/* remove pid file if possible */
err= remove(pid_file);
#else
TerminateProcess(pid_file,err);
#endif
}
/* free args */
free_args(&al);
return err;
}
/******************************************************************************
get_server_pid()
Get the VM id with the given pid file.
******************************************************************************/
#ifndef __WIN__
pid_t get_server_pid(char *pid_file)
{
char buf[PATH_MAX];
int fd, err;
char *p;
pid_t id= 0;
/* discover id */
fd= open(pid_file, O_RDONLY);
err= read(fd, buf, PATH_MAX);
close(fd);
if (err > 0)
{
/* terminate string */
if ((p= strchr(buf, '\n')) != NULL)
{
*p= '\0';
/* check for a '\r' */
if ((p= strchr(buf, '\r')) != NULL)
{
*p= '\0';
}
}
else
{
buf[err]= '\0';
}
id= strtol(buf, NULL, 0);
}
return id;
}
/******************************************************************************
kill_server()
Force a kill of the server with the given pid.
******************************************************************************/
void kill_server(pid_t pid)
{
if (pid > 0)
{
#if !defined(__NETWARE__)
/* Send SIGTERM to pid */
kill(pid, SIGTERM);
#else /* __NETWARE__ */
/* destroy vm */
NXVmDestroy(pid);
#endif
}
}
#endif
/******************************************************************************
del_tree()
Delete the directory and subdirectories.
******************************************************************************/
void del_tree(char *dir)
{
#ifndef __WIN__
DIR *parent= opendir(dir);
struct dirent *entry;
char temp[PATH_MAX];
if (parent == NULL)
{
return;
}
while ((entry= readdir(parent)) != NULL)
{
/* create long name */
snprintf(temp, PATH_MAX, "%s/%s", dir, entry->d_name);
if (entry->d_name[0] == '.')
{
/* Skip */
}
else
if (S_ISDIR(entry->d_type))
{
/* delete subdirectory */
del_tree(temp);
}
else
{
/* remove file */
remove(temp);
}
}
/* remove directory */
rmdir(dir);
#else
struct _finddata_t parent;
intptr_t handle;
char temp[PATH_MAX];
char mask[PATH_MAX];
snprintf(mask,MAX_PATH,"%s/*.*",dir);
if ((handle=_findfirst(mask,&parent)) == -1L)
{
return;
}
do
{
/* create long name */
snprintf(temp, PATH_MAX, "%s/%s", dir, parent.name);
if (parent.name[0] == '.')
{
/* Skip */
}
else
if (parent.attrib & _A_SUBDIR)
{
/* delete subdirectory */
del_tree(temp);
}
else
{
/* remove file */
remove(temp);
}
} while (_findnext(handle,&parent) == 0);
_findclose(handle);
/* remove directory */
_rmdir(dir);
#endif
}
/******************************************************************************
removef()
******************************************************************************/
int removef(const char *format, ...)
{
#ifdef __NETWARE__
va_list ap;
char path[PATH_MAX];
va_start(ap, format);
vsnprintf(path, PATH_MAX, format, ap);
va_end(ap);
return remove(path);
#eldef __WIN__
{
va_list ap;
char path[PATH_MAX];
struct _finddata_t parent;
intptr_t handle;
char temp[PATH_MAX];
char *p;
va_start(ap, format);
vsnprintf(path, PATH_MAX, format, ap);
va_end(ap);
p= path + strlen(path);
while (*p != '\\' && *p != '/' && p > path) p--;
if ((handle=_findfirst(path,&parent)) == -1L)
{
/* if there is not files....it's ok */
return 0;
}
*p= '\0';
do
{
if (! (parent.attrib & _A_SUBDIR))
{
snprintf(temp, PATH_MAX, "%s/%s", path, parent.name);
remove(temp);
}
}while (_findnext(handle,&parent) == 0);
_findclose(handle);
}
#else
DIR *parent;
struct dirent *entry;
char temp[PATH_MAX];
va_list ap;
char path[PATH_MAX];
char *p;
/* Get path with mask */
va_start(ap, format);
vsnprintf(path, PATH_MAX, format, ap);
va_end(ap);
p= path + strlen(path);
while (*p != '\\' && *p != '/' && p > path) p--;
*p= '\0';
p++;
parent= opendir(path);
if (parent == NULL)
{
return 1; /* Error, directory missing */
}
while ((entry= readdir(parent)) != NULL)
{
/* entry is not directory and entry matches with mask */
if (!S_ISDIR(entry->d_type) && !fnmatch(p, entry->d_name,0))
{
/* create long name */
snprintf(temp, PATH_MAX, "%s/%s", path, entry->d_name);
/* Delete only files */
remove(temp);
}
}
#endif
return 0;
}
/******************************************************************************
get_basedir()
******************************************************************************/
void get_basedir(char *argv0, char *basedir)
{
char temp[PATH_MAX];
char *p;
int position;
ASSERT(argv0 != NULL);
ASSERT(basedir != NULL);
strcpy(temp, strlwr(argv0));
while ((p= strchr(temp, '\\')) != NULL) *p= '/';
if ((position= strinstr(temp, "/bin/")) != 0)
{
p= temp + position;
*p= '\0';
strcpy(basedir, temp);
}
}
uint strinstr(reg1 const char *str,reg4 const char *search)
{
reg2 my_string i,j;
my_string start= (my_string) str;
skipp:
while (*str != '\0')
{
if (*str++ == *search)
{
i=(my_string) str;
j= (my_string) search+1;
while (*j)
if (*i++ != *j++) goto skipp;
return ((uint) (str - start));
}
}
return (0);
}
/******************************************************************************
remove_empty_file()
******************************************************************************/
void remove_empty_file(const char *file_name)
{
struct stat file;
if (!stat(file_name,&file))
{
if (!file.st_size)
remove(file_name);
}
}

135
mysql-test/my_manage.h Normal file
View File

@ -0,0 +1,135 @@
/*
Copyright (c) 2002 Novell, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _MY_MANAGE
#define _MY_MANAGE
/******************************************************************************
includes
******************************************************************************/
#include <stdlib.h>
#ifndef __WIN__
#include <unistd.h>
#endif
#ifndef __NETWARE__
#include <string.h>
#include <my_global.h>
#include <m_string.h>
#ifndef __WIN__
#define strnicmp strncasecmp
#define strlwr(STRARG) (STRARG)
#else
int my_vsnprintf_(char *to, size_t n, const char* value, ...);
#endif
#endif
/******************************************************************************
macros
******************************************************************************/
#define ARG_BUF 10
#define TRY_MAX 5
#ifdef __WIN__
#define PATH_MAX _MAX_PATH
#define NAME_MAX _MAX_FNAME
#define kill(A,B) TerminateProcess((HANDLE)A,0)
#define NOT_NEED_PID 0
#define MASTER_PID 1
#define SLAVE_PID 2
#define mysqld_timeout 60000
int pid_mode;
bool run_server;
bool skip_first_param;
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#endif
/******************************************************************************
structures
******************************************************************************/
typedef struct
{
int argc;
char **argv;
size_t size;
} arg_list_t;
#ifdef __WIN__
typedef int pid_t;
#endif
/******************************************************************************
global variables
******************************************************************************/
/******************************************************************************
prototypes
******************************************************************************/
void init_args(arg_list_t *);
void add_arg(arg_list_t *, const char *, ...);
void free_args(arg_list_t *);
#ifndef __WIN__
int sleep_until_file_exists(char *);
int sleep_until_file_deleted(char *);
#else
int sleep_until_file_exists(HANDLE);
int sleep_until_file_deleted(HANDLE);
#endif
int wait_for_server_start(char *, char *, char *, char *, int,char *);
#ifndef __WIN__
int spawn(char *, arg_list_t *, int, char *, char *, char *, char *);
#else
int spawn(char *, arg_list_t *, int , char *, char *, char *, HANDLE *);
#endif
#ifndef __WIN__
int stop_server(char *, char *, char *, char *, int, char *,char *);
pid_t get_server_pid(char *);
void kill_server(pid_t pid);
#else
int stop_server(char *, char *, char *, char *, int, HANDLE,char *);
#endif
void del_tree(char *);
int removef(const char *, ...);
void get_basedir(char *, char *);
void remove_empty_file(const char *file_name);
#endif /* _MY_MANAGE */

View File

@ -996,9 +996,11 @@ start_master()
if [ -n "$1" ] ; then
id=`$EXPR $1 + 101`;
this_master_myport=`$EXPR $MASTER_MYPORT + $1`
NOT_FIRST_MASTER_EXTRA_OPTS="--skip-innodb"
else
id=1;
this_master_myport=$MASTER_MYPORT
NOT_FIRST_MASTER_EXTRA_OPTS=""
fi
if [ -z "$DO_BENCH" ]
then
@ -1022,7 +1024,8 @@ start_master()
--open-files-limit=1024 \
$MASTER_40_ARGS \
$SMALL_SERVER \
$EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT"
$EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT \
$NOT_FIRST_MASTER_EXTRA_OPTS"
else
master_args="--no-defaults --log-bin=$MYSQL_TEST_DIR/var/log/master-bin$1 \
--server-id=$id --rpl-recovery-rank=1 \
@ -1041,7 +1044,8 @@ start_master()
--innodb_data_file_path=ibdata1:50M \
$MASTER_40_ARGS \
$SMALL_SERVER \
$EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT"
$EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT \
$NOT_FIRST_MASTER_EXTRA_OPTS"
fi
CUR_MYERR=$MASTER_MYERR

1728
mysql-test/mysql_test_run.c Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -102,12 +102,43 @@ if [ ! -x "$exec_mgmtsrvr" ]; then
echo "$exec_mgmtsrvr missing"
exit 1
fi
if [ ! -x "$exec_waiter" ]; then
echo "$exec_waiter missing"
exit 1
fi
exec_mgmtclient="$exec_mgmtclient --no-defaults"
exec_mgmtsrvr="$exec_mgmtsrvr --no-defaults"
exec_ndb="$exec_ndb --no-defaults"
exec_waiter="$exec_waiter --no-defaults"
ndb_host="localhost"
ndb_mgmd_port=$port_base
NDB_CONNECTSTRING="host=$ndb_host:$ndb_mgmd_port"
export NDB_CONNECTSTRING
sleep_until_file_created () {
file=$1
loop=$2
org_time=$2
message=$3
while (test $loop -gt 0)
do
if [ -r $file ]
then
return 0
fi
sleep 1
loop=`expr $loop - 1`
done
if [ $message ]
then
echo $message
fi
echo "ERROR: $file was not created in $org_time seconds; Aborting"
return 1;
}
start_default_ndbcluster() {
# do some checks
@ -127,8 +158,8 @@ port_transporter=`expr $ndb_mgmd_port + 2`
# Start management server as deamon
# Edit file system path and ports in config file
if [ $initial_ndb ] ; then
rm -f $fs_ndb/ndb_*
sed \
-e s,"CHOOSE_MaxNoOfOrderedIndexes","$ndb_no_ord",g \
-e s,"CHOOSE_MaxNoOfConcurrentOperations","$ndb_con_op",g \
@ -146,25 +177,36 @@ fi
rm -f "$cfgfile" 2>&1 | cat > /dev/null
rm -f "$fs_ndb/$cfgfile" 2>&1 | cat > /dev/null
if ( cd "$fs_ndb" ; $exec_mgmtsrvr -c config.ini ) ; then :; else
if ( cd "$fs_ndb" ; $exec_mgmtsrvr -f config.ini ) ; then :; else
echo "Unable to start $exec_mgmtsrvr from `pwd`"
exit 1
fi
if sleep_until_file_created $fs_ndb/ndb_3.pid 30
then :; else
exit 1
fi
cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile"
# Start database node
echo "Starting ndbd"
( cd "$fs_ndb" ; $exec_ndb $flags_ndb & )
if sleep_until_file_created $fs_ndb/ndb_1.pid 30
then :; else
stop_default_ndbcluster
exit 1
fi
cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile"
# Start database node
echo "Starting ndbd"
( cd "$fs_ndb" ; $exec_ndb $flags_ndb & )
if sleep_until_file_created $fs_ndb/ndb_2.pid 30
then :; else
stop_default_ndbcluster
exit 1
fi
cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile"
# test if Ndb Cluster starts properly
@ -172,6 +214,7 @@ cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile"
echo "Waiting for started..."
if ( $exec_waiter ) | grep "NDBT_ProgramExit: 0 - OK"; then :; else
echo "Ndbcluster startup failed"
stop_default_ndbcluster
exit 1
fi
@ -198,10 +241,12 @@ if [ -f "$fs_ndb/$pidfile" ] ; then
attempt=0
while [ $attempt -lt 10 ] ; do
new_kill_pid=""
kill_pids2=""
for p in $kill_pids ; do
kill -0 $p 2> /dev/null
if [ $? -eq 0 ] ; then
new_kill_pid="$p $new_kill_pid"
kill_pids2="-$p $kill_pids2"
fi
done
kill_pids=$new_kill_pid
@ -211,9 +256,14 @@ if [ -f "$fs_ndb/$pidfile" ] ; then
sleep 1
attempt=`expr $attempt + 1`
done
if [ "$kill_pids" != "" ] ; then
echo "Failed to shutdown ndbcluster, executing kill -9 "$kill_pids
kill -9 $kill_pids
if [ "$kill_pids2" != "" ] ; then
echo "Failed to shutdown ndbcluster, executing kill "$kill_pids2
kill -9 -- $kill_pids2 2> /dev/null
/bin/kill -9 -- $kill_pids2 2> /dev/null
/usr/bin/kill -9 -- $kill_pids2 2> /dev/null
kill -9 $kill_pids2 2> /dev/null
/bin/kill -9 $kill_pids2 2> /dev/null
/usr/bin/kill -9 $kill_pids2 2> /dev/null
fi
rm "$fs_ndb/$pidfile"
fi

View File

@ -53,3 +53,10 @@ select count(distinct f) from t1;
count(distinct f)
0
drop table t1;
create table t1 (a char(3), b char(20), primary key (a, b));
insert into t1 values ('ABW', 'Dutch'), ('ABW', 'English');
select count(distinct a) from t1 group by b;
count(distinct a)
1
1
drop table t1;

View File

@ -174,3 +174,69 @@ Warnings:
Warning 1265 Data truncated for column 'a' at row 1
Warning 1265 Data truncated for column 'b' at row 1
drop table t1;
set names koi8r;
create table t1 (a char(10) character set cp1251);
insert into t1 values (_koi8r'<27><><EFBFBD><EFBFBD>');
select * from t1 where a=_koi8r'<27><><EFBFBD><EFBFBD>';
a
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
select * from t1 where a=concat(_koi8r'<27><><EFBFBD><EFBFBD>');
ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (koi8r_general_ci,COERCIBLE) for operation '='
select * from t1 where a=_latin1'<27><><EFBFBD><EFBFBD>';
ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '='
drop table t1;
set names latin1;
set names koi8r;
create table t1 (c1 char(10) character set cp1251);
insert into t1 values ('<27>');
select c1 from t1 where c1 between '<27>' and '<27>';
c1
<EFBFBD>
select ifnull(c1,'<27>'), ifnull(null,c1) from t1;
ifnull(c1,'<27>') ifnull(null,c1)
<EFBFBD> <09>
select if(1,c1,'<27>'), if(0,c1,'<27>') from t1;
if(1,c1,'<27>') if(0,c1,'<27>')
<EFBFBD> <09>
select coalesce('<27>',c1), coalesce(null,c1) from t1;
coalesce('<27>',c1) coalesce(null,c1)
<EFBFBD> <09>
select least(c1,'<27>'), greatest(c1,'<27>') from t1;
least(c1,'<27>') greatest(c1,'<27>')
<EFBFBD> <09>
select locate(c1,'<27>'), locate('<27>',c1) from t1;
locate(c1,'<27>') locate('<27>',c1)
1 1
select field(c1,'<27>'),field('<27>',c1) from t1;
field(c1,'<27>') field('<27>',c1)
1 1
select concat(c1,'<27>'), concat('<27>',c1) from t1;
concat(c1,'<27>') concat('<27>',c1)
<EFBFBD><EFBFBD> <09><>
select concat_ws(c1,'<27>','<27>'), concat_ws('<27>',c1,'<27>') from t1;
concat_ws(c1,'<27>','<27>') concat_ws('<27>',c1,'<27>')
<EFBFBD><EFBFBD><EFBFBD> <09><><EFBFBD>
select replace(c1,'<27>','<27>'), replace('<27>',c1,'<27>') from t1;
replace(c1,'<27>','<27>') replace('<27>',c1,'<27>')
<EFBFBD> <09>
select substring_index(c1,'<27><><EFBFBD><EFBFBD>',2) from t1;
substring_index(c1,'<27><><EFBFBD><EFBFBD>',2)
<EFBFBD>
select elt(1,c1,'<27>'),elt(1,'<27>',c1) from t1;
elt(1,c1,'<27>') elt(1,'<27>',c1)
<EFBFBD> <09>
select make_set(3,c1,'<27>'), make_set(3,'<27>',c1) from t1;
make_set(3,c1,'<27>') make_set(3,'<27>',c1)
<EFBFBD>,<2C> <09>,<2C>
select insert(c1,1,2,'<27>'),insert('<27>',1,2,c1) from t1;
insert(c1,1,2,'<27>') insert('<27>',1,2,c1)
<EFBFBD> <09>
select trim(c1 from '<27>'),trim('<27>' from c1) from t1;
trim(c1 from '<27>') trim('<27>' from c1)
select lpad(c1,3,'<27>'), lpad('<27>',3,c1) from t1;
lpad(c1,3,'<27>') lpad('<27>',3,c1)
<EFBFBD><EFBFBD><EFBFBD> <09><><EFBFBD>
select rpad(c1,3,'<27>'), rpad('<27>',3,c1) from t1;
rpad(c1,3,'<27>') rpad('<27>',3,c1)
<EFBFBD><EFBFBD><EFBFBD> <09><><EFBFBD>

View File

@ -60,3 +60,14 @@ hex(c)
9353
9373
drop table t1;
SET NAMES sjis;
CREATE TABLE t1 (
c char(16) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=sjis;
insert into t1 values(0xb1),(0xb2),(0xb3);
select hex(c) from t1;
hex(c)
B1
B2
B3
drop table t1;

View File

@ -480,3 +480,10 @@ a 0061
b 0062
c 0063
drop table t1;
set @ivar= 1234;
set @str1 = 'select ?';
set @str2 = convert(@str1 using ucs2);
prepare stmt1 from @str2;
execute stmt1 using @ivar;
?
1234

View File

@ -330,6 +330,9 @@ t1_id name t2_id t1_id name
select * from t2 where match name against ('a* b* c* d* e* f*' in boolean mode);
t2_id t1_id name
drop table t1,t2;
create table t1 (a text, fulltext key (a));
insert into t1 select "xxxx yyyy zzzz";
drop table t1;
SET NAMES latin1;
CREATE TABLE t1 (t text character set utf8 not null, fulltext(t));
INSERT t1 VALUES ('Mit freundlichem Gr<47><72>'), ('aus Osnabr<62>ck');
@ -352,9 +355,9 @@ t collation(t)
aus Osnabr<62>ck utf8_general_ci
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck');
t collation(t)
SELECT t, collation(t),MATCH t AGAINST ('Osnabruck') FROM t1 WHERE MATCH t AGAINST ('Osnabruck');
t collation(t) MATCH t AGAINST ('Osnabruck')
aus Osnabr<62>ck utf8_general_ci 1.591139793396
SELECT t, collation(t),FORMAT(MATCH t AGAINST ('Osnabruck'),6) FROM t1 WHERE MATCH t AGAINST ('Osnabruck');
t collation(t) FORMAT(MATCH t AGAINST ('Osnabruck'),6)
aus Osnabr<62>ck utf8_general_ci 1.591140
alter table t1 modify t varchar(200) collate latin1_german2_ci not null;
Warnings:
Warning 1265 Data truncated for column 't' at row 3

View File

@ -6,53 +6,53 @@ FULLTEXT(message)
) comment = 'original testcase by sroussey@network54.com';
INSERT INTO t1 (message) VALUES ("Testing"),("table"),("testbug"),
("steve"),("is"),("cool"),("steve is cool");
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve');
a MATCH (message) AGAINST ('steve')
4 0.90587323904037
7 0.89568990468979
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve');
a FORMAT(MATCH (message) AGAINST ('steve'),6)
4 0.905873
7 0.895690
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve');
a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE)
4 1
7 1
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE);
a MATCH (message) AGAINST ('steve')
4 0.90587323904037
7 0.89568990468979
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE);
a FORMAT(MATCH (message) AGAINST ('steve'),6)
4 0.905873
7 0.895690
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE);
a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE)
4 1
7 1
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY a;
a MATCH (message) AGAINST ('steve')
4 0.90587323904037
7 0.89568990468979
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY a;
a FORMAT(MATCH (message) AGAINST ('steve'),6)
4 0.905873
7 0.895690
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY a;
a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE)
4 1
7 1
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve') ORDER BY a DESC;
a MATCH (message) AGAINST ('steve')
7 0.89568990468979
4 0.90587323904037
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve') ORDER BY a DESC;
a FORMAT(MATCH (message) AGAINST ('steve'),6)
7 0.895690
4 0.905873
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY a DESC;
a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE)
7 1
4 1
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve') ORDER BY 1;
a MATCH (message) AGAINST ('steve')
7 0.89568990468979
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve') ORDER BY 1;
a FORMAT(MATCH (message) AGAINST ('steve'),6)
7 0.895690
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY 1;
a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE)
7 1
SELECT a, MATCH (message) AGAINST ('steve') as rel FROM t1 ORDER BY rel;
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) as rel FROM t1 ORDER BY rel;
a rel
1 0
2 0
3 0
5 0
6 0
7 0.89568990468979
4 0.90587323904037
1 0.000000
2 0.000000
3 0.000000
5 0.000000
6 0.000000
7 0.895690
4 0.905873
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) as rel FROM t1 ORDER BY rel;
a rel
1 0

View File

@ -457,3 +457,10 @@ group_concat(distinct b order by b)
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
drop table t1;
create table t1 (a char(3), b char(20), primary key (a, b));
insert into t1 values ('ABW', 'Dutch'), ('ABW', 'English');
select group_concat(a) from t1 group by b;
group_concat(a)
ABW
ABW
drop table t1;

View File

@ -179,3 +179,9 @@ select 1 in ('1.1',2);
select 1 in ('1.1',2.0);
1 in ('1.1',2.0)
0
create table t1 (a char(20) character set binary);
insert into t1 values ('aa'), ('bb');
select * from t1 where a in (NULL, 'aa');
a
aa
drop table t1;

View File

@ -581,3 +581,77 @@ t1 CREATE TABLE `t1` (
`POINT(1,3)` longblob NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
CREATE TABLE `t1` (`object_id` bigint(20) unsigned NOT NULL default '0', `geo`
geometry NOT NULL default '') ENGINE=MyISAM ;
insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363
36.305435,-114.992394 36.305202,-114.991219 36.305975,-114.991163
36.306845,-114.989432 36.309452,-114.978275 36.312642,-114.977363
36.311978,-114.975327 36.312344,-114.96502 36.31597,-114.963364
36.313629,-114.961723 36.313721,-114.956398 36.316057,-114.951882
36.320979,-114.947073 36.323475,-114.945207 36.326451,-114.945207
36.326451,-114.944132 36.326061,-114.94003 36.326588,-114.924017
36.334484,-114.923281 36.334146,-114.92564 36.331504,-114.94072
36.319282,-114.945348 36.314812,-114.948091 36.314762,-114.951755
36.316211,-114.952446 36.313883,-114.952644 36.309488,-114.944725
36.313083,-114.93706 36.32043,-114.932478 36.323497,-114.924556
36.327708,-114.922608 36.329715,-114.92009 36.328695,-114.912105
36.323566,-114.901647 36.317952,-114.897436 36.313968,-114.895344
36.309573,-114.891699 36.304398,-114.890569 36.303551,-114.886356
36.302702,-114.885141 36.301351,-114.885709 36.297391,-114.892499
36.290893,-114.902142 36.288974,-114.904941 36.288838,-114.905308
36.289845,-114.906325 36.290395,-114.909916 36.289549,-114.914527
36.287535,-114.918797 36.284423,-114.922982 36.279731,-114.924113
36.277282,-114.924057 36.275817,-114.927733 36.27053,-114.929354
36.269029,-114.929354 36.269029,-114.950856 36.268715,-114.950768
36.264324,-114.960206 36.264293,-114.960301 36.268943,-115.006662
36.268929,-115.008583 36.265619,-115.00665 36.264247,-115.006659
36.246873,-115.006659 36.246873,-115.006838 36.247697,-115.010764
36.247774,-115.015609 36.25113,-115.015765 36.254505,-115.029517
36.254619,-115.038573 36.249317,-115.038573 36.249317,-115.023403
36.25841,-115.023873 36.258994,-115.031845 36.259829,-115.03183
36.261053,-115.025561 36.261095,-115.036417 36.274632,-115.033729
36.276041,-115.032217 36.274851,-115.029845 36.273959,-115.029934
36.274966,-115.025763 36.274896,-115.025406 36.281044,-115.028731
36.284471,-115.036497 36.290377,-115.042071 36.291039,-115.026759
36.298478,-115.008995 36.301966,-115.006363 36.305435),(-115.079835
36.244369,-115.079735 36.260186,-115.076435 36.262369,-115.069758
36.265,-115.070235 36.268757,-115.064542 36.268655,-115.061843
36.269857,-115.062676 36.270693,-115.06305 36.272344,-115.059051
36.281023,-115.05918 36.283008,-115.060591 36.285246,-115.061913
36.290022,-115.062499 36.306353,-115.062499 36.306353,-115.060918
36.30642,-115.06112 36.289779,-115.05713 36.2825,-115.057314
36.279446,-115.060779 36.274659,-115.061366 36.27209,-115.057858
36.26557,-115.055805 36.262883,-115.054688 36.262874,-115.047335
36.25037,-115.044234 36.24637,-115.052434 36.24047,-115.061734
36.23507,-115.061934 36.22677,-115.061934 36.22677,-115.061491
36.225267,-115.062024 36.218194,-115.060134 36.218278,-115.060133
36.210771,-115.057833 36.210771,-115.057433 36.196271,-115.062233
36.196271,-115.062233 36.190371,-115.062233 36.190371,-115.065533
36.190371,-115.071333 36.188571,-115.098331 36.188275,-115.098331
36.188275,-115.098435 36.237569,-115.097535 36.240369,-115.097535
36.240369,-115.093235 36.240369,-115.089135 36.240469,-115.083135
36.240569,-115.083135 36.240569,-115.079835
36.244369)))')),('85998',GeomFromText('MULTIPOLYGON(((-115.333107
36.264587,-115.333168 36.280638,-115.333168 36.280638,-115.32226
36.280643,-115.322538 36.274311,-115.327222 36.274258,-115.32733
36.263026,-115.330675 36.262984,-115.332132 36.264673,-115.333107
36.264587),(-115.247239 36.247066,-115.247438 36.218267,-115.247438
36.218267,-115.278525 36.219263,-115.278525 36.219263,-115.301545
36.219559,-115.332748 36.219197,-115.332757 36.220041,-115.332757
36.220041,-115.332895 36.233514,-115.349023 36.233479,-115.351489
36.234475,-115.353681 36.237021,-115.357106 36.239789,-115.36519
36.243331,-115.368156 36.243487,-115.367389 36.244902,-115.364553
36.246014,-115.359219 36.24616,-115.356186 36.248025,-115.353347
36.248004,-115.350813 36.249507,-115.339673 36.25387,-115.333069
36.255018,-115.333069 36.255018,-115.333042 36.247767,-115.279039
36.248666,-115.263639 36.247466,-115.263839 36.252766,-115.261439
36.252666,-115.261439 36.247366,-115.247239 36.247066)))'));
select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
t1 where object_id=85998;
object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo))
85998 MULTIPOLYGON 0 POINT(115.31877315203 -36.237472821022)
select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
t1 where object_id=85984;
object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo))
85984 MULTIPOLYGON 0 POINT(-114.87787186923 36.33101763469)
drop table t1;

View File

@ -745,6 +745,71 @@ player_id match_1_h * match_id home UUX
7 4 * 1 2 2
3 3 * 1 2 1
drop table t1, t2;
create table t1 (a int, b int, unique index idx (a, b));
create table t2 (a int, b int, c int, unique index idx (a, b));
insert into t1 values (1, 10), (1,11), (2,10), (2,11);
insert into t2 values (1,10,3);
select t1.a, t1.b, t2.c from t1 left join t2
on t1.a=t2.a and t1.b=t2.b and t2.c=3
where t1.a=1 and t2.c is null;
a b c
1 11 NULL
drop table t1, t2;
CREATE TABLE t1 (
ts_id bigint(20) default NULL,
inst_id tinyint(4) default NULL,
flag_name varchar(64) default NULL,
flag_value text,
UNIQUE KEY ts_id (ts_id,inst_id,flag_name)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE t2 (
ts_id bigint(20) default NULL,
inst_id tinyint(4) default NULL,
flag_name varchar(64) default NULL,
flag_value text,
UNIQUE KEY ts_id (ts_id,inst_id,flag_name)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES
(111056548820001, 0, 'flag1', NULL),
(111056548820001, 0, 'flag2', NULL),
(2, 0, 'other_flag', NULL);
INSERT INTO t2 VALUES
(111056548820001, 3, 'flag1', 'sss');
SELECT t1.flag_name,t2.flag_value
FROM t1 LEFT JOIN t2
ON (t1.ts_id = t2.ts_id AND t1.flag_name = t2.flag_name AND
t2.inst_id = 3)
WHERE t1.inst_id = 0 AND t1.ts_id=111056548820001 AND
t2.flag_value IS NULL;
flag_name flag_value
flag2 NULL
DROP TABLE t1,t2;
CREATE TABLE invoice (
id int(11) unsigned NOT NULL auto_increment,
text_id int(10) unsigned default NULL,
PRIMARY KEY (id)
);
INSERT INTO invoice VALUES("1", "0");
INSERT INTO invoice VALUES("2", "10");
CREATE TABLE text_table (
text_id char(3) NOT NULL default '',
language_id char(3) NOT NULL default '',
text_data text,
PRIMARY KEY (text_id,language_id)
);
INSERT INTO text_table VALUES("0", "EN", "0-EN");
INSERT INTO text_table VALUES("0", "SV", "0-SV");
INSERT INTO text_table VALUES("10", "EN", "10-EN");
INSERT INTO text_table VALUES("10", "SV", "10-SV");
SELECT invoice.id, invoice.text_id, text_table.text_data
FROM invoice LEFT JOIN text_table
ON invoice.text_id = text_table.text_id
AND text_table.language_id = 'SV'
WHERE (invoice.id LIKE '%' OR text_table.text_data LIKE '%');
id text_id text_data
1 0 0-SV
2 10 10-SV
DROP TABLE invoice, text_table;
CREATE TABLE t0 (a0 int PRIMARY KEY);
CREATE TABLE t1 (a1 int PRIMARY KEY);
CREATE TABLE t2 (a2 int);

View File

@ -1,9 +1,17 @@
select -1 as "before_use_test" ;
before_use_test
-1
select otto from (select 1 as otto) as t1;
otto
1
select otto from (select 1 as otto) as t1;
otto
1
select friedrich from (select 1 as otto) as t1;
ERROR 42S22: Unknown column 'friedrich' in 'field list'
select otto from (select 1 as otto) as t1;
otto
1
select otto from (select 1 as otto) as t1;
otto
1
@ -14,10 +22,123 @@ ERROR 42S22: Unknown column 'friedrich' in 'field list'
select otto from (select 1 as otto) as t1;
otto
1
select otto from (select 1 as otto) as t1;
otto
1
select friedrich from (select 1 as otto) as t1;
ERROR 42S22: Unknown column 'friedrich' in 'field list'
select friedrich from (select 1 as otto) as t1;
ERROR 42S22: Unknown column 'friedrich' in 'field list'
select 0 as "after_successful_stmt_errno" ;
after_successful_stmt_errno
0
garbage ;
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 'garbage' at line 1
select 1064 as "after_wrong_syntax_errno" ;
after_wrong_syntax_errno
1064
garbage ;
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 'garbage' at line 1
select 1064 as "after_let_var_equal_value" ;
after_let_var_equal_value
1064
garbage ;
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 'garbage' at line 1
set @my_var= 'abc' ;
select 0 as "after_set_var_equal_value" ;
after_set_var_equal_value
0
garbage ;
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 'garbage' at line 1
select 1064 as "after_disable_warnings_command" ;
after_disable_warnings_command
1064
drop table if exists t1 ;
garbage ;
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 'garbage' at line 1
drop table if exists t1 ;
select 0 as "after_disable_warnings" ;
after_disable_warnings
0
garbage ;
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 'garbage' at line 1
select 3 from t1 ;
ERROR 42S02: Table 'test.t1' doesn't exist
select 1146 as "after_minus_masked" ;
after_minus_masked
1146
garbage ;
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 'garbage' at line 1
select 3 from t1 ;
ERROR 42S02: Table 'test.t1' doesn't exist
select 1146 as "after_!_masked" ;
after_!_masked
1146
garbage ;
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 'garbage' at line 1
select -1 as "after_let_errno_equal_value" ;
after_let_errno_equal_value
-1
garbage ;
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 'garbage' at line 1
prepare stmt from "select 3 from t1" ;
ERROR 42S02: Table 'test.t1' doesn't exist
select 1146 as "after_failing_prepare" ;
after_failing_prepare
1146
create table t1 ( f1 char(10));
garbage ;
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 'garbage' at line 1
prepare stmt from "select 3 from t1" ;
select 0 as "after_successful_prepare" ;
after_successful_prepare
0
garbage ;
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 'garbage' at line 1
execute stmt;
3
select 0 as "after_successful_execute" ;
after_successful_execute
0
drop table t1;
garbage ;
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 'garbage' at line 1
execute stmt;
ERROR 42S02: Table 'test.t1' doesn't exist
select 1146 as "after_failing_execute" ;
after_failing_execute
1146
garbage ;
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 'garbage' at line 1
execute __stmt_;
ERROR HY000: Unknown prepared statement handler (__stmt_) given to EXECUTE
select 1243 as "after_failing_execute" ;
after_failing_execute
1243
garbage ;
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 'garbage' at line 1
deallocate prepare stmt;
select 0 as "after_successful_deallocate" ;
after_successful_deallocate
0
garbage ;
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 'garbage' at line 1
deallocate prepare __stmt_;
ERROR HY000: Unknown prepared statement handler (__stmt_) given to DEALLOCATE PREPARE
select 1243 as "after_failing_deallocate" ;
after_failing_deallocate
1243
garbage ;
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 'garbage' at line 1
select 1064 as "after_--disable_abort_on_error" ;
after_--disable_abort_on_error
1064
select 3 from t1 ;
ERROR 42S02: Table 'test.t1' doesn't exist
select 3 from t1 ;
ERROR 42S02: Table 'test.t1' doesn't exist
select 3 from t1 ;
ERROR 42S02: Table 'test.t1' doesn't exist
select 1146 as "after_!errno_masked_error" ;
after_!errno_masked_error
1146
garbage ;
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 'garbage' at line 1
select 1064 as "after_--enable_abort_on_error" ;
after_--enable_abort_on_error
1064
select 3 from t1 ;
ERROR 42S02: Table 'test.t1' doesn't exist

View File

@ -40,6 +40,11 @@ SELECT * FROM t1 ORDER BY pk1;
pk1 attr1 attr2 attr3
3 1 NULL 9412
9412 9413 17 9413
UPDATE t1 SET pk1=4 WHERE pk1 = 3;
SELECT * FROM t1 ORDER BY pk1;
pk1 attr1 attr2 attr3
4 1 NULL 9412
9412 9413 17 9413
DELETE FROM t1;
SELECT * FROM t1;
pk1 attr1 attr2 attr3
@ -414,3 +419,150 @@ select * from t1 where b IS NOT NULL;
a b
1
drop table t1;
create table t1 (
c1 int,
c2 int,
c3 int,
c4 int,
c5 int,
c6 int,
c7 int,
c8 int,
c9 int,
c10 int,
c11 int,
c12 int,
c13 int,
c14 int,
c15 int,
c16 int,
c17 int,
c18 int,
c19 int,
c20 int,
c21 int,
c22 int,
c23 int,
c24 int,
c25 int,
c26 int,
c27 int,
c28 int,
c29 int,
c30 int,
c31 int,
c32 int,
c33 int,
c34 int,
c35 int,
c36 int,
c37 int,
c38 int,
c39 int,
c40 int,
c41 int,
c42 int,
c43 int,
c44 int,
c45 int,
c46 int,
c47 int,
c48 int,
c49 int,
c50 int,
c51 int,
c52 int,
c53 int,
c54 int,
c55 int,
c56 int,
c57 int,
c58 int,
c59 int,
c60 int,
c61 int,
c62 int,
c63 int,
c64 int,
c65 int,
c66 int,
c67 int,
c68 int,
c69 int,
c70 int,
c71 int,
c72 int,
c73 int,
c74 int,
c75 int,
c76 int,
c77 int,
c78 int,
c79 int,
c80 int,
c81 int,
c82 int,
c83 int,
c84 int,
c85 int,
c86 int,
c87 int,
c88 int,
c89 int,
c90 int,
c91 int,
c92 int,
c93 int,
c94 int,
c95 int,
c96 int,
c97 int,
c98 int,
c99 int,
c100 int,
c101 int,
c102 int,
c103 int,
c104 int,
c105 int,
c106 int,
c107 int,
c108 int,
c109 int,
c110 int,
c111 int,
c112 int,
c113 int,
c114 int,
c115 int,
c116 int,
c117 int,
c118 int,
c119 int,
c120 int,
c121 int,
c122 int,
c123 int,
c124 int,
c125 int,
c126 int,
c127 int,
c128 int,
primary key(c1)) engine=ndb;
drop table t1;
create table t1 (
a1234567890123456789012345678901234567890 int primary key,
a12345678901234567890123456789a1234567890 int,
index(a12345678901234567890123456789a1234567890)
) engine=ndb;
show tables;
Tables_in_test
t1
insert into t1 values (1,1),(2,1),(3,1),(4,1),(5,2),(6,1),(7,1);
explain select * from t1 where a12345678901234567890123456789a1234567890=2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref a12345678901234567890123456789a1234567890 a12345678901234567890123456789a1234567890 5 const 10 Using where
select * from t1 where a12345678901234567890123456789a1234567890=2;
a1234567890123456789012345678901234567890 a12345678901234567890123456789a1234567890
5 2
drop table t1;

View File

@ -1,25 +1,5 @@
drop table if exists t1;
drop database if exists mysqltest;
create table t1 (
a int not null primary key,
b tinytext
) engine=ndbcluster;
insert into t1 values(1, 'x');
update t1 set b = 'y';
select * from t1;
a b
1 y
delete from t1;
drop table t1;
create table t1 (
a int not null primary key,
b text not null
) engine=ndbcluster;
insert into t1 values(1, '');
select * from t1;
a b
1
drop table t1;
drop database if exists test2;
set autocommit=0;
create table t1 (
a int not null primary key,
@ -102,6 +82,53 @@ commit;
select count(*) from t1;
count(*)
0
replace t1 set a=1,b=@b1,c=111,d=@d1;
replace t1 set a=2,b=@b2,c=222,d=@d2;
commit;
explain select * from t1 where a = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
from t1 where a=1;
a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3)
1 2256 b1 3000 dd1
select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
from t1 where a=2;
a length(b) substr(b,1+2*9000,2) length(d) substr(d,1+3*9000,3)
2 20000 b2 30000 dd2
replace t1 set a=1,b=@b2,c=111,d=@d2;
replace t1 set a=2,b=@b1,c=222,d=@d1;
commit;
select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
from t1 where a=1;
a length(b) substr(b,1+2*9000,2) length(d) substr(d,1+3*9000,3)
1 20000 b2 30000 dd2
select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
from t1 where a=2;
a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3)
2 2256 b1 3000 dd1
replace t1 set a=1,b=concat(@b2,@b2),c=111,d=concat(@d2,@d2);
replace t1 set a=2,b=concat(@b1,@b1),c=222,d=concat(@d1,@d1);
commit;
select a,length(b),substr(b,1+4*9000,2),length(d),substr(d,1+6*9000,3)
from t1 where a=1;
a length(b) substr(b,1+4*9000,2) length(d) substr(d,1+6*9000,3)
1 40000 b2 60000 dd2
select a,length(b),substr(b,1+4*900,2),length(d),substr(d,1+6*900,3)
from t1 where a=2;
a length(b) substr(b,1+4*900,2) length(d) substr(d,1+6*900,3)
2 4512 b1 6000 dd1
replace t1 set a=1,b='xyz',c=111,d=null;
commit;
select a,b from t1 where d is null;
a b
1 xyz
delete from t1 where a=1;
delete from t1 where a=2;
commit;
select count(*) from t1;
count(*)
0
insert into t1 values(1,@b1,111,@d1);
insert into t1 values(2,@b2,222,@d2);
commit;
@ -241,90 +268,6 @@ a b c d
7 7xb7 777 7xdd7
8 8xb8 888 8xdd8
9 9xb9 999 9xdd9
select * from t1 order by a;
a b c d
1 1xb1 111 1xdd1
2 2xb2 222 2xdd2
3 3xb3 333 3xdd3
4 4xb4 444 4xdd4
5 5xb5 555 5xdd5
6 6xb6 666 6xdd6
7 7xb7 777 7xdd7
8 8xb8 888 8xdd8
9 9xb9 999 9xdd9
alter table t1 add x int;
select * from t1 order by a;
a b c d x
1 1xb1 111 1xdd1 NULL
2 2xb2 222 2xdd2 NULL
3 3xb3 333 3xdd3 NULL
4 4xb4 444 4xdd4 NULL
5 5xb5 555 5xdd5 NULL
6 6xb6 666 6xdd6 NULL
7 7xb7 777 7xdd7 NULL
8 8xb8 888 8xdd8 NULL
9 9xb9 999 9xdd9 NULL
alter table t1 drop x;
select * from t1 order by a;
a b c d
1 1xb1 111 1xdd1
2 2xb2 222 2xdd2
3 3xb3 333 3xdd3
4 4xb4 444 4xdd4
5 5xb5 555 5xdd5
6 6xb6 666 6xdd6
7 7xb7 777 7xdd7
8 8xb8 888 8xdd8
9 9xb9 999 9xdd9
create database mysqltest;
use mysqltest;
CREATE TABLE t2 (
a bigint unsigned NOT NULL PRIMARY KEY,
b int unsigned not null,
c int unsigned
) engine=ndbcluster;
insert into t2 values (1,1,1),(2,2,2);
select * from test.t1,t2 where test.t1.a = t2.a order by test.t1.a;
a b c d a b c
1 1xb1 111 1xdd1 1 1 1
2 2xb2 222 2xdd2 2 2 2
drop table t2;
use test;
select * from t1 order by a;
a b c d
1 1xb1 111 1xdd1
2 2xb2 222 2xdd2
3 3xb3 333 3xdd3
4 4xb4 444 4xdd4
5 5xb5 555 5xdd5
6 6xb6 666 6xdd6
7 7xb7 777 7xdd7
8 8xb8 888 8xdd8
9 9xb9 999 9xdd9
alter table t1 add x int;
select * from t1 order by a;
a b c d x
1 1xb1 111 1xdd1 NULL
2 2xb2 222 2xdd2 NULL
3 3xb3 333 3xdd3 NULL
4 4xb4 444 4xdd4 NULL
5 5xb5 555 5xdd5 NULL
6 6xb6 666 6xdd6 NULL
7 7xb7 777 7xdd7 NULL
8 8xb8 888 8xdd8 NULL
9 9xb9 999 9xdd9 NULL
alter table t1 drop x;
select * from t1 order by a;
a b c d
1 1xb1 111 1xdd1
2 2xb2 222 2xdd2
3 3xb3 333 3xdd3
4 4xb4 444 4xdd4
5 5xb5 555 5xdd5
6 6xb6 666 6xdd6
7 7xb7 777 7xdd7
8 8xb8 888 8xdd8
9 9xb9 999 9xdd9
delete from t1 where c >= 100;
commit;
select count(*) from t1;
@ -375,8 +318,128 @@ rollback;
select count(*) from t1;
count(*)
0
insert into t1 values(1,'b1',111,'dd1');
insert into t1 values(2,'b2',222,'dd2');
insert into t1 values(3,'b3',333,'dd3');
insert into t1 values(4,'b4',444,'dd4');
insert into t1 values(5,'b5',555,'dd5');
insert into t1 values(6,'b6',666,'dd6');
insert into t1 values(7,'b7',777,'dd7');
insert into t1 values(8,'b8',888,'dd8');
insert into t1 values(9,'b9',999,'dd9');
commit;
select * from t1 order by a;
a b c d
1 b1 111 dd1
2 b2 222 dd2
3 b3 333 dd3
4 b4 444 dd4
5 b5 555 dd5
6 b6 666 dd6
7 b7 777 dd7
8 b8 888 dd8
9 b9 999 dd9
alter table t1 add x int;
select * from t1 order by a;
a b c d x
1 b1 111 dd1 NULL
2 b2 222 dd2 NULL
3 b3 333 dd3 NULL
4 b4 444 dd4 NULL
5 b5 555 dd5 NULL
6 b6 666 dd6 NULL
7 b7 777 dd7 NULL
8 b8 888 dd8 NULL
9 b9 999 dd9 NULL
alter table t1 drop x;
select * from t1 order by a;
a b c d
1 b1 111 dd1
2 b2 222 dd2
3 b3 333 dd3
4 b4 444 dd4
5 b5 555 dd5
6 b6 666 dd6
7 b7 777 dd7
8 b8 888 dd8
9 b9 999 dd9
create database test2;
use test2;
CREATE TABLE t2 (
a bigint unsigned NOT NULL PRIMARY KEY,
b int unsigned not null,
c int unsigned
) engine=ndbcluster;
insert into t2 values (1,1,1),(2,2,2);
select * from test.t1,t2 where test.t1.a = t2.a order by test.t1.a;
a b c d a b c
1 b1 111 dd1 1 1 1
2 b2 222 dd2 2 2 2
drop table t2;
use test;
select * from t1 order by a;
a b c d
1 b1 111 dd1
2 b2 222 dd2
3 b3 333 dd3
4 b4 444 dd4
5 b5 555 dd5
6 b6 666 dd6
7 b7 777 dd7
8 b8 888 dd8
9 b9 999 dd9
alter table t1 add x int;
select * from t1 order by a;
a b c d x
1 b1 111 dd1 NULL
2 b2 222 dd2 NULL
3 b3 333 dd3 NULL
4 b4 444 dd4 NULL
5 b5 555 dd5 NULL
6 b6 666 dd6 NULL
7 b7 777 dd7 NULL
8 b8 888 dd8 NULL
9 b9 999 dd9 NULL
alter table t1 drop x;
select * from t1 order by a;
a b c d
1 b1 111 dd1
2 b2 222 dd2
3 b3 333 dd3
4 b4 444 dd4
5 b5 555 dd5
6 b6 666 dd6
7 b7 777 dd7
8 b8 888 dd8
9 b9 999 dd9
drop table t1;
drop database test2;
set autocommit=0;
create table t1 (
a int not null primary key,
b tinytext
) engine=ndbcluster;
insert into t1 values(1, 'x');
update t1 set b = 'y';
select * from t1;
a b
1 y
delete from t1;
select * from t1;
a b
commit;
drop table t1;
set autocommit=0;
create table t1 (
a int not null primary key,
b text not null
) engine=ndbcluster;
insert into t1 values(1, '');
select * from t1;
a b
1
commit;
drop table t1;
drop database mysqltest;
set autocommit=1;
use test;
CREATE TABLE t1 (
@ -397,6 +460,7 @@ select * from t1 order by a;
a b
1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
2 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
set autocommit=1;
alter table t1 engine=myisam;
select * from t1 order by a;
a b

View File

@ -557,3 +557,32 @@ select * from t1 where pk1=1;
pk1 b c
1 2 3
DROP TABLE t1;
CREATE TABLE t1(a INT) ENGINE=ndb;
INSERT IGNORE INTO t1 VALUES (1);
INSERT IGNORE INTO t1 VALUES (1);
INSERT IGNORE INTO t1 SELECT a FROM t1;
INSERT IGNORE INTO t1 SELECT a FROM t1;
INSERT IGNORE INTO t1 SELECT a FROM t1;
INSERT IGNORE INTO t1 VALUES (1);
INSERT IGNORE INTO t1 VALUES (1);
SELECT * FROM t1;
a
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
DROP TABLE t1;

View File

@ -106,12 +106,6 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
set @fvar= 123.4567;
prepare stmt1 from @fvar;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '123.4567' at line 1
set @str1 = 'select ?';
set @str2 = convert(@str1 using ucs2);
prepare stmt1 from @str2;
execute stmt1 using @ivar;
?
1234
drop table t1,t2;
PREPARE stmt1 FROM "select _utf8 'A' collate utf8_bin = ?";
set @var='A';

View File

@ -62,4 +62,15 @@ id emp salary l r
4 Donna 1064.80 5 6
5 Eddie 931.70 7 8
6 Fred 798.60 9 10
prepare st_round from 'update t1 set salary = salary + ? - ( salary MOD ? )';
set @arg_round= 50;
execute st_round using @arg_round, @arg_round;
select * from t1;
id emp salary l r
1 Jerry 1350.00 1 12
2 Bert 1200.00 2 3
3 Chuck 1250.00 4 11
4 Donna 1100.00 5 6
5 Eddie 950.00 7 8
6 Fred 800.00 9 10
drop table t1;

View File

@ -1580,7 +1580,9 @@ a b
1200 x1000_1updatedupdated
delete from t1 where a >= 1000 ;
prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
ERROR HY000: This command is not supported in the prepared statement protocol yet
execute stmt1;
execute stmt1;
execute stmt1;
test_sequence
------ multi table tests ------
delete from t1 ;
@ -1790,7 +1792,7 @@ t5 CREATE TABLE `t5` (
`const12` char(0) default NULL,
`param12` bigint(20) default NULL,
`param13` double default NULL,
`param14` longblob,
`param14` longtext,
`param15` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t5 ;
@ -1820,7 +1822,7 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 0 0 8
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
const01 8
param01 8
@ -1973,19 +1975,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select
@ -2063,19 +2065,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
@ -2155,19 +2157,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@ -2239,19 +2241,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;

View File

@ -1563,7 +1563,9 @@ a b
1200 x1000_1updatedupdated
delete from t1 where a >= 1000 ;
prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
ERROR HY000: This command is not supported in the prepared statement protocol yet
execute stmt1;
execute stmt1;
execute stmt1;
test_sequence
------ multi table tests ------
delete from t1 ;
@ -1773,7 +1775,7 @@ t5 CREATE TABLE `t5` (
`const12` char(0) default NULL,
`param12` bigint(20) default NULL,
`param13` double default NULL,
`param14` longblob,
`param14` longtext,
`param15` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t5 ;
@ -1803,7 +1805,7 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 0 0 8
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
const01 8
param01 8
@ -1956,19 +1958,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select
@ -2046,19 +2048,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
@ -2138,19 +2140,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@ -2222,19 +2224,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;

View File

@ -1564,7 +1564,9 @@ a b
1200 x1000_1updatedupdated
delete from t1 where a >= 1000 ;
prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
ERROR HY000: This command is not supported in the prepared statement protocol yet
execute stmt1;
execute stmt1;
execute stmt1;
test_sequence
------ multi table tests ------
delete from t1 ;
@ -1774,7 +1776,7 @@ t5 CREATE TABLE `t5` (
`const12` char(0) default NULL,
`param12` bigint(20) default NULL,
`param13` double default NULL,
`param14` longblob,
`param14` longtext,
`param15` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t5 ;
@ -1804,7 +1806,7 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 0 0 8
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
const01 8
param01 8
@ -1957,19 +1959,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 0 31 8
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 0 31 8
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 0 31 8
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 0 31 8
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select
@ -2047,19 +2049,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 0 31 8
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 0 31 8
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 0 31 8
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 0 31 8
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
@ -2139,19 +2141,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 0 31 8
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 0 31 8
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 0 31 8
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 0 31 8
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@ -2223,19 +2225,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 0 31 8
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 0 31 8
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 0 31 8
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 0 31 8
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;

View File

@ -1606,7 +1606,9 @@ a b
1200 x1000_1updatedupdated
delete from t1 where a >= 1000 ;
prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
ERROR HY000: This command is not supported in the prepared statement protocol yet
execute stmt1;
execute stmt1;
execute stmt1;
test_sequence
------ multi table tests ------
delete from t1 ;
@ -1713,7 +1715,7 @@ t5 CREATE TABLE `t5` (
`const12` char(0) default NULL,
`param12` bigint(20) default NULL,
`param13` double default NULL,
`param14` longblob,
`param14` longtext,
`param15` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t5 ;
@ -1743,7 +1745,7 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 0 0 8
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
const01 8
param01 8
@ -1896,19 +1898,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select
@ -1986,19 +1988,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
@ -2078,19 +2080,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@ -2162,19 +2164,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;
@ -4613,7 +4615,9 @@ a b
1200 x1000_1updatedupdated
delete from t1 where a >= 1000 ;
prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
ERROR HY000: This command is not supported in the prepared statement protocol yet
execute stmt1;
execute stmt1;
execute stmt1;
test_sequence
------ multi table tests ------
delete from t1 ;
@ -4720,7 +4724,7 @@ t5 CREATE TABLE `t5` (
`const12` char(0) default NULL,
`param12` bigint(20) default NULL,
`param13` double default NULL,
`param14` longblob,
`param14` longtext,
`param15` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t5 ;
@ -4750,7 +4754,7 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 0 0 8
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
const01 8
param01 8
@ -4903,19 +4907,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select
@ -4993,19 +4997,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
@ -5085,19 +5089,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@ -5169,19 +5173,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;

View File

@ -1563,7 +1563,9 @@ a b
1200 x1000_1updatedupdated
delete from t1 where a >= 1000 ;
prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
ERROR HY000: This command is not supported in the prepared statement protocol yet
execute stmt1;
execute stmt1;
execute stmt1;
test_sequence
------ multi table tests ------
delete from t1 ;
@ -1773,7 +1775,7 @@ t5 CREATE TABLE `t5` (
`const12` char(0) default NULL,
`param12` bigint(20) default NULL,
`param13` double default NULL,
`param14` longblob,
`param14` longtext,
`param15` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t5 ;
@ -1803,7 +1805,7 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 0 0 8
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
const01 8
param01 8
@ -1956,19 +1958,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select
@ -2046,19 +2048,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
@ -2138,19 +2140,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@ -2222,19 +2224,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;

View File

@ -1543,7 +1543,6 @@ a b
1000 x1000_1
delete from t1 where a >= 1000 ;
prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
ERROR HY000: This command is not supported in the prepared statement protocol yet
test_sequence
------ multi table tests ------
delete from t1 ;
@ -1753,7 +1752,7 @@ t5 CREATE TABLE `t5` (
`const12` char(0) default NULL,
`param12` bigint(20) default NULL,
`param13` double default NULL,
`param14` longblob,
`param14` longtext,
`param15` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t5 ;
@ -1783,7 +1782,7 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 0 0 8
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
const01 8
param01 8
@ -1936,19 +1935,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 0 31 8
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 0 31 8
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 0 31 8
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 0 31 8
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select
@ -2026,19 +2025,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 0 31 8
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 0 31 8
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 0 31 8
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 0 31 8
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
@ -2118,19 +2117,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 0 31 8
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 0 31 8
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 0 31 8
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 0 31 8
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@ -2202,19 +2201,19 @@ def @arg16 254 8192 0 Y 128 31 63
def @arg17 254 20 0 Y 128 31 63
def @arg18 254 20 0 Y 128 31 63
def @arg19 254 20 0 Y 128 31 63
def @arg20 254 8192 0 Y 128 31 63
def @arg21 254 8192 0 Y 128 31 63
def @arg22 254 8192 0 Y 128 31 63
def @arg23 254 8192 0 Y 128 31 63
def @arg24 254 8192 0 Y 128 31 63
def @arg25 254 8192 0 Y 128 31 63
def @arg26 254 8192 0 Y 128 31 63
def @arg27 254 8192 0 Y 128 31 63
def @arg28 254 8192 0 Y 128 31 63
def @arg29 254 8192 0 Y 128 31 63
def @arg30 254 8192 0 Y 128 31 63
def @arg31 254 8192 0 Y 128 31 63
def @arg32 254 8192 0 Y 128 31 63
def @arg20 254 8192 0 Y 0 31 8
def @arg21 254 8192 0 Y 0 31 8
def @arg22 254 8192 0 Y 0 31 8
def @arg23 254 8192 0 Y 0 31 8
def @arg24 254 8192 0 Y 0 31 8
def @arg25 254 8192 0 Y 0 31 8
def @arg26 254 8192 0 Y 0 31 8
def @arg27 254 8192 0 Y 0 31 8
def @arg28 254 8192 0 Y 0 31 8
def @arg29 254 8192 0 Y 0 31 8
def @arg30 254 8192 0 Y 0 31 8
def @arg31 254 8192 0 Y 0 31 8
def @arg32 254 8192 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;

View File

@ -547,3 +547,20 @@ select count(*) from t2 where x = 18446744073709551601;
count(*)
0
drop table t1,t2;
set names latin1;
create table t1 (a char(10), b text, key (a)) character set latin1;
INSERT INTO t1 (a) VALUES
('111'),('222'),('222'),('222'),('222'),('444'),('aaa'),('AAA'),('bbb');
explain select * from t1 where a='aaa';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref a a 11 const 2 Using where
explain select * from t1 where a=binary 'aaa';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 11 NULL 2 Using where
explain select * from t1 where a='aaa' collate latin1_bin;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 11 NULL 2 Using where
explain select * from t1 where a='aaa' collate latin1_german1_ci;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL a NULL NULL NULL 9 Using where
drop table t1;

View File

@ -0,0 +1,15 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
CREATE TABLE t1 ( a int ) ENGINE=InnoDB;
BEGIN;
INSERT INTO t1 VALUES (1);
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status Operation failed
OPTIMIZE TABLE non_existing;
Table Op Msg_type Msg_text
test.non_existing optimize error Table 'test.non_existing' doesn't exist

View File

@ -2333,3 +2333,36 @@ EXPLAIN SELECT i FROM t1 WHERE i=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index
DROP TABLE t1;
CREATE TABLE t1 (
K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '',
K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000',
F2I4 int(11) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t1 VALUES
('W%RT', '0100', 1),
('W-RT', '0100', 1),
('WART', '0100', 1),
('WART', '0200', 1),
('WERT', '0100', 2),
('WORT','0200', 2),
('WT', '0100', 2),
('W_RT', '0100', 2),
('WaRT', '0100', 3),
('WART', '0300', 3),
('WRT' , '0400', 3),
('WURM', '0500', 3),
('W%T', '0600', 4),
('WA%T', '0700', 4),
('WA_T', '0800', 4);
SELECT K2C4, K4N4, F2I4 FROM t1
WHERE K2C4 = 'WART' AND
(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200'));
K2C4 K4N4 F2I4
WART 0200 1
SELECT K2C4, K4N4, F2I4 FROM t1
WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200');
K2C4 K4N4 F2I4
WART 0100 1
WART 0200 1
WART 0300 3
DROP TABLE t1;

View File

@ -85,6 +85,36 @@ t1 CREATE TABLE "t1" (
UNIQUE KEY "email" ("email")
)
drop table t1;
CREATE TABLE t1 (
a char(10),
b char(10) collate latin1_bin,
c binary(10)
) character set latin1;
set @@sql_mode="";
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(10) default NULL,
`b` char(10) character set latin1 collate latin1_bin default NULL,
`c` binary(10) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
set @@sql_mode="mysql323";
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(10) default NULL,
`b` char(10) binary default NULL,
`c` binary(10) default NULL
) TYPE=MyISAM
set @@sql_mode="mysql40";
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(10) default NULL,
`b` char(10) binary default NULL,
`c` binary(10) default NULL
) TYPE=MyISAM
drop table t1;
set session sql_mode = '';
create table t1 ( min_num dec(6,6) default .000001);
show create table t1;

View File

@ -22,14 +22,14 @@ select * from t1;
f1 f2
10 10
100000 100000
1.23457e+09 1234567890
1.23457e+9 1234567890
1e+10 10000000000
1e+15 1e+15
1e+20 1e+20
3.40282e+38 1e+50
3.40282e+38 1e+150
-10 -10
1e-05 1e-05
1e-5 1e-5
1e-10 1e-10
1e-15 1e-15
1e-20 1e-20

View File

@ -201,3 +201,7 @@ SET @`v`:=_ucs2 0x006100620063 COLLATE ucs2_general_ci;
SET TIMESTAMP=10000;
insert into t2 values (@v);
drop table t1, t2;
set @var= NULL ;
select FIELD( @var,'1it','Hit') as my_column;
my_column
0

View File

@ -1626,3 +1626,23 @@ Field 3,'Field 4|
|Field 6| | 'Field 7'|
drop view v1;
drop table t1;
create database mysqltest;
create table mysqltest.t1 (a int);
grant all privileges on mysqltest.* to mysqltest_1@localhost;
use mysqltest;
create view v1 as select * from t1;
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
drop database mysqltest;
create table t1 (s1 smallint);
create view v1 as select * from t1 where 20 < (select (s1) from t1);
insert into v1 values (30);
ERROR HY000: The target table v1 of the INSERT is not updatable
create view v2 as select * from t1;
create view v3 as select * from t1 where 20 < (select (s1) from v2);
insert into v3 values (30);
ERROR HY000: The target table v3 of the INSERT is not updatable
create view v4 as select * from v2 where 20 < (select (s1) from t1);
insert into v4 values (30);
ERROR HY000: You can't specify target table 'v4' for update in FROM clause
drop view v4, v3, v2, v1;
drop table t1;

View File

@ -1,2 +1,2 @@
--disable_result_log
--exec $TESTS_BINDIR/client_test --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT
--exec $TESTS_BINDIR/client_test --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT --silent

View File

@ -5,7 +5,8 @@
select 1+2/*hello*/+3;
select 1 /* long
multi line comment */;
!$1065 ;
--error 1065
;
select 1 /*!32301 +1 */;
select 1 /*!52301 +1 */;
select 1--1;

View File

@ -55,3 +55,11 @@ create table t1 (f int);
select count(distinct f) from t1;
drop table t1;
#
# Bug #6515
#
create table t1 (a char(3), b char(20), primary key (a, b));
insert into t1 values ('ABW', 'Dutch'), ('ABW', 'English');
select count(distinct a) from t1 group by b;
drop table t1;

View File

@ -131,3 +131,51 @@ create table t1 (a char(10) character set koi8r, b text character set koi8r);
insert into t1 values ('test','test');
insert into t1 values ('<27><><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>');
drop table t1;
#
# Try to apply an automatic conversion in some cases:
# E.g. when mixing a column to a string, the string
# is converted into the column character set.
# If conversion loses data, then error. Otherwise,
# the string is replaced by its converted representation
#
set names koi8r;
create table t1 (a char(10) character set cp1251);
insert into t1 values (_koi8r'<27><><EFBFBD><EFBFBD>');
# this is possible:
select * from t1 where a=_koi8r'<27><><EFBFBD><EFBFBD>';
# this is not possible, because we have a function, not just a constant:
--error 1267
select * from t1 where a=concat(_koi8r'<27><><EFBFBD><EFBFBD>');
# this is not posible, cannot convert _latin1'<27><><EFBFBD><EFBFBD>' into cp1251:
--error 1267
select * from t1 where a=_latin1'<27><><EFBFBD><EFBFBD>';
drop table t1;
set names latin1;
#
# Check more automatic conversion
#
set names koi8r;
create table t1 (c1 char(10) character set cp1251);
insert into t1 values ('<27>');
select c1 from t1 where c1 between '<27>' and '<27>';
select ifnull(c1,'<27>'), ifnull(null,c1) from t1;
select if(1,c1,'<27>'), if(0,c1,'<27>') from t1;
select coalesce('<27>',c1), coalesce(null,c1) from t1;
select least(c1,'<27>'), greatest(c1,'<27>') from t1;
select locate(c1,'<27>'), locate('<27>',c1) from t1;
select field(c1,'<27>'),field('<27>',c1) from t1;
select concat(c1,'<27>'), concat('<27>',c1) from t1;
select concat_ws(c1,'<27>','<27>'), concat_ws('<27>',c1,'<27>') from t1;
select replace(c1,'<27>','<27>'), replace('<27>',c1,'<27>') from t1;
select substring_index(c1,'<27><><EFBFBD><EFBFBD>',2) from t1;
select elt(1,c1,'<27>'),elt(1,'<27>',c1) from t1;
select make_set(3,c1,'<27>'), make_set(3,'<27>',c1) from t1;
select insert(c1,1,2,'<27>'),insert('<27>',1,2,c1) from t1;
select trim(c1 from '<27>'),trim('<27>' from c1) from t1;
select lpad(c1,3,'<27>'), lpad('<27>',3,c1) from t1;
select rpad(c1,3,'<27>'), rpad('<27>',3,c1) from t1;
# TODO
#select case c1 when '<27>' then '<27>' when '<27>' then '<27>' else 'c' end from t1;
#select export_set(5,c1,'<27>'), export_set(5,'<27>',c1) from t1;

View File

@ -51,3 +51,14 @@ insert into t1 values (0x9353);
insert into t1 values (0x9373);
select hex(c) from t1;
drop table t1;
#
# Bug #6223 Japanese half-width kana characters get truncated
#
SET NAMES sjis;
CREATE TABLE t1 (
c char(16) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=sjis;
insert into t1 values(0xb1),(0xb2),(0xb3);
select hex(c) from t1;
drop table t1;

View File

@ -315,3 +315,11 @@ alter table t1 modify a char(5);
select a, hex(a) from t1;
drop table t1;
#
# Check prepare statement from an UCS2 string
#
set @ivar= 1234;
set @str1 = 'select ?';
set @str2 = convert(@str1 using ucs2);
prepare stmt1 from @str2;
execute stmt1 using @ivar;

View File

@ -645,6 +645,7 @@ insert into t1 values(1,'foo'),(2,'foobar');
select * from t1 where b like 'foob%';
--disable_warnings
alter table t1 engine=bdb;
--enable_warnings
select * from t1 where b like 'foob%';
drop table t1;

View File

@ -253,9 +253,16 @@ select * from t1 join t2 using(`t1_id`) where match (t1.name, t2.name) against('
# bug with many short (< ft_min_word_len) words in boolean search
#
select * from t2 where match name against ('a* b* c* d* e* f*' in boolean mode);
drop table t1,t2;
#
# bug with repair-by-sort and incorrect records estimation
#
create table t1 (a text, fulltext key (a));
insert into t1 select "xxxx yyyy zzzz";
drop table t1;
#
# UTF8
#
@ -272,7 +279,7 @@ SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabr
SET NAMES latin1;
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabr<62>ck');
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck');
SELECT t, collation(t),MATCH t AGAINST ('Osnabruck') FROM t1 WHERE MATCH t AGAINST ('Osnabruck');
SELECT t, collation(t),FORMAT(MATCH t AGAINST ('Osnabruck'),6) FROM t1 WHERE MATCH t AGAINST ('Osnabruck');
#alter table t1 modify t text character set latin1 collate latin1_german2_ci not null;
alter table t1 modify t varchar(200) collate latin1_german2_ci not null;
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabr<62>ck');

View File

@ -10,25 +10,25 @@ CREATE TABLE t1 (
INSERT INTO t1 (message) VALUES ("Testing"),("table"),("testbug"),
("steve"),("is"),("cool"),("steve is cool");
# basic MATCH
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve');
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve');
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve');
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE);
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE);
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE);
# MATCH + ORDER BY (with ft-ranges)
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY a;
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY a;
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY a;
# MATCH + ORDER BY (with normal ranges) + UNIQUE
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve') ORDER BY a DESC;
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve') ORDER BY a DESC;
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY a DESC;
# MATCH + ORDER BY + UNIQUE (const_table)
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve') ORDER BY 1;
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve') ORDER BY 1;
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY 1;
# ORDER BY MATCH
SELECT a, MATCH (message) AGAINST ('steve') as rel FROM t1 ORDER BY rel;
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) as rel FROM t1 ORDER BY rel;
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) as rel FROM t1 ORDER BY rel;
drop table t1;

View File

@ -277,3 +277,12 @@ select group_concat(b order by b) from t1 group by a;
select group_concat(distinct b order by b) from t1 group by a;
drop table t1;
#
# Bug #6475
#
create table t1 (a char(3), b char(20), primary key (a, b));
insert into t1 values ('ABW', 'Dutch'), ('ABW', 'English');
select group_concat(a) from t1 group by b;
drop table t1;

View File

@ -89,3 +89,10 @@ select 1 in ('1.0',2.0);
select 1 in (1.0,'2.0');
select 1 in ('1.1',2);
select 1 in ('1.1',2.0);
# Test case for bug #6365
create table t1 (a char(20) character set binary);
insert into t1 values ('aa'), ('bb');
select * from t1 where a in (NULL, 'aa');
drop table t1;

View File

@ -284,3 +284,78 @@ drop table t1;
create table t1 select POINT(1,3);
show create table t1;
drop table t1;
CREATE TABLE `t1` (`object_id` bigint(20) unsigned NOT NULL default '0', `geo`
geometry NOT NULL default '') ENGINE=MyISAM ;
insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363
36.305435,-114.992394 36.305202,-114.991219 36.305975,-114.991163
36.306845,-114.989432 36.309452,-114.978275 36.312642,-114.977363
36.311978,-114.975327 36.312344,-114.96502 36.31597,-114.963364
36.313629,-114.961723 36.313721,-114.956398 36.316057,-114.951882
36.320979,-114.947073 36.323475,-114.945207 36.326451,-114.945207
36.326451,-114.944132 36.326061,-114.94003 36.326588,-114.924017
36.334484,-114.923281 36.334146,-114.92564 36.331504,-114.94072
36.319282,-114.945348 36.314812,-114.948091 36.314762,-114.951755
36.316211,-114.952446 36.313883,-114.952644 36.309488,-114.944725
36.313083,-114.93706 36.32043,-114.932478 36.323497,-114.924556
36.327708,-114.922608 36.329715,-114.92009 36.328695,-114.912105
36.323566,-114.901647 36.317952,-114.897436 36.313968,-114.895344
36.309573,-114.891699 36.304398,-114.890569 36.303551,-114.886356
36.302702,-114.885141 36.301351,-114.885709 36.297391,-114.892499
36.290893,-114.902142 36.288974,-114.904941 36.288838,-114.905308
36.289845,-114.906325 36.290395,-114.909916 36.289549,-114.914527
36.287535,-114.918797 36.284423,-114.922982 36.279731,-114.924113
36.277282,-114.924057 36.275817,-114.927733 36.27053,-114.929354
36.269029,-114.929354 36.269029,-114.950856 36.268715,-114.950768
36.264324,-114.960206 36.264293,-114.960301 36.268943,-115.006662
36.268929,-115.008583 36.265619,-115.00665 36.264247,-115.006659
36.246873,-115.006659 36.246873,-115.006838 36.247697,-115.010764
36.247774,-115.015609 36.25113,-115.015765 36.254505,-115.029517
36.254619,-115.038573 36.249317,-115.038573 36.249317,-115.023403
36.25841,-115.023873 36.258994,-115.031845 36.259829,-115.03183
36.261053,-115.025561 36.261095,-115.036417 36.274632,-115.033729
36.276041,-115.032217 36.274851,-115.029845 36.273959,-115.029934
36.274966,-115.025763 36.274896,-115.025406 36.281044,-115.028731
36.284471,-115.036497 36.290377,-115.042071 36.291039,-115.026759
36.298478,-115.008995 36.301966,-115.006363 36.305435),(-115.079835
36.244369,-115.079735 36.260186,-115.076435 36.262369,-115.069758
36.265,-115.070235 36.268757,-115.064542 36.268655,-115.061843
36.269857,-115.062676 36.270693,-115.06305 36.272344,-115.059051
36.281023,-115.05918 36.283008,-115.060591 36.285246,-115.061913
36.290022,-115.062499 36.306353,-115.062499 36.306353,-115.060918
36.30642,-115.06112 36.289779,-115.05713 36.2825,-115.057314
36.279446,-115.060779 36.274659,-115.061366 36.27209,-115.057858
36.26557,-115.055805 36.262883,-115.054688 36.262874,-115.047335
36.25037,-115.044234 36.24637,-115.052434 36.24047,-115.061734
36.23507,-115.061934 36.22677,-115.061934 36.22677,-115.061491
36.225267,-115.062024 36.218194,-115.060134 36.218278,-115.060133
36.210771,-115.057833 36.210771,-115.057433 36.196271,-115.062233
36.196271,-115.062233 36.190371,-115.062233 36.190371,-115.065533
36.190371,-115.071333 36.188571,-115.098331 36.188275,-115.098331
36.188275,-115.098435 36.237569,-115.097535 36.240369,-115.097535
36.240369,-115.093235 36.240369,-115.089135 36.240469,-115.083135
36.240569,-115.083135 36.240569,-115.079835
36.244369)))')),('85998',GeomFromText('MULTIPOLYGON(((-115.333107
36.264587,-115.333168 36.280638,-115.333168 36.280638,-115.32226
36.280643,-115.322538 36.274311,-115.327222 36.274258,-115.32733
36.263026,-115.330675 36.262984,-115.332132 36.264673,-115.333107
36.264587),(-115.247239 36.247066,-115.247438 36.218267,-115.247438
36.218267,-115.278525 36.219263,-115.278525 36.219263,-115.301545
36.219559,-115.332748 36.219197,-115.332757 36.220041,-115.332757
36.220041,-115.332895 36.233514,-115.349023 36.233479,-115.351489
36.234475,-115.353681 36.237021,-115.357106 36.239789,-115.36519
36.243331,-115.368156 36.243487,-115.367389 36.244902,-115.364553
36.246014,-115.359219 36.24616,-115.356186 36.248025,-115.353347
36.248004,-115.350813 36.249507,-115.339673 36.25387,-115.333069
36.255018,-115.333069 36.255018,-115.333042 36.247767,-115.279039
36.248666,-115.263639 36.247466,-115.263839 36.252766,-115.261439
36.252666,-115.261439 36.247366,-115.247239 36.247066)))'));
select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
t1 where object_id=85998;
select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
t1 where object_id=85984;
drop table t1;

View File

@ -1110,6 +1110,7 @@ show create table t2;
drop table t2;
# Test error handling
--replace_result \\ /
--error 1005
create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;

View File

@ -99,22 +99,27 @@ create table t1(number int auto_increment primary key, original_value varchar(50
set @value= "aa";
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
--replace_result e-0 e- e+0 e+
--query_vertical select * from t1 where number =last_insert_id()
set @value= "1aa";
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
--replace_result e-0 e- e+0 e+
--query_vertical select * from t1 where number =last_insert_id()
set @value= "aa1";
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
--replace_result e-0 e- e+0 e+
--query_vertical select * from t1 where number =last_insert_id()
set @value= "1e+1111111111a";
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
--replace_result e-0 e- e+0 e+
--query_vertical select * from t1 where number =last_insert_id()
set @value= "-1e+1111111111a";
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
--replace_result e-0 e- e+0 e+
--query_vertical select * from t1 where number =last_insert_id()
--error 1367
@ -122,20 +127,25 @@ set @value= 1e+1111111111;
--error 1367
set @value= -1e+1111111111;
set @value= 1e+111;
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
--replace_result e-0 e- e+0 e+
--query_vertical select * from t1 where number =last_insert_id()
set @value= -1e+111;
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
--replace_result e-0 e- e+0 e+
--query_vertical select * from t1 where number =last_insert_id()
set @value= 1;
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
--replace_result e-0 e- e+0 e+
--query_vertical select * from t1 where number =last_insert_id()
set @value= -1;
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
--replace_result e-0 e- e+0 e+
--query_vertical select * from t1 where number =last_insert_id()
drop table t1;

View File

@ -34,11 +34,14 @@ explain select t1.*,t2.* from t1 left join t2 on t1.a=t2.a where isnull(t2.a)=1;
select t1.*,t2.*,t3.a from t1 left join t2 on (t1.a=t2.a) left join t1 as t3 on (t2.a=t3.a);
# The next query should rearange the left joins to get this to work
!$1120 explain select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a);
!$1120 select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a);
--error 1120
explain select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a);
--error 1120
select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a);
# The next query should give an error in MySQL
!$1120 select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t2.a=t3.a);
--error 1120
select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t2.a=t3.a);
# Test of inner join
select t1.*,t2.* from t1 inner join t2 using (a);
@ -94,7 +97,8 @@ WHERE t1.uniq_id = 4
ORDER BY t2.c_amount;
INSERT INTO t2 VALUES (2,3,3000,6000,0,0,746584,837484,'yes');
!$1062 INSERT INTO t2 VALUES (2,3,3000,6000,0,0,746584,837484,'yes');
--error 1062
INSERT INTO t2 VALUES (2,3,3000,6000,0,0,746584,837484,'yes');
INSERT INTO t2 VALUES (7,3,1000,2000,0,0,746294,937484,'yes');
#3rd select should show that one record is returned with null entries for the
@ -288,7 +292,8 @@ insert into t3 values (1);
insert into t4 values (1,1);
insert into t5 values (1,1);
!$1120 explain select * from t3 left join t4 on t4.seq_1_id = t2.t2_id left join t1 on t1.t1_id = t4.seq_0_id left join t5 on t5.seq_0_id = t1.t1_id left join t2 on t2.t2_id = t5.seq_1_id where t3.t3_id = 23;
--error 1120
explain select * from t3 left join t4 on t4.seq_1_id = t2.t2_id left join t1 on t1.t1_id = t4.seq_0_id left join t5 on t5.seq_0_id = t1.t1_id left join t2 on t2.t2_id = t5.seq_1_id where t3.t3_id = 23;
drop table t1,t2,t3,t4,t5;
@ -502,6 +507,82 @@ select s.*, '*', m.*, (s.match_1_h - m.home) UUX from
drop table t1, t2;
# Tests for bugs #6307 and 6460
create table t1 (a int, b int, unique index idx (a, b));
create table t2 (a int, b int, c int, unique index idx (a, b));
insert into t1 values (1, 10), (1,11), (2,10), (2,11);
insert into t2 values (1,10,3);
select t1.a, t1.b, t2.c from t1 left join t2
on t1.a=t2.a and t1.b=t2.b and t2.c=3
where t1.a=1 and t2.c is null;
drop table t1, t2;
CREATE TABLE t1 (
ts_id bigint(20) default NULL,
inst_id tinyint(4) default NULL,
flag_name varchar(64) default NULL,
flag_value text,
UNIQUE KEY ts_id (ts_id,inst_id,flag_name)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE t2 (
ts_id bigint(20) default NULL,
inst_id tinyint(4) default NULL,
flag_name varchar(64) default NULL,
flag_value text,
UNIQUE KEY ts_id (ts_id,inst_id,flag_name)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES
(111056548820001, 0, 'flag1', NULL),
(111056548820001, 0, 'flag2', NULL),
(2, 0, 'other_flag', NULL);
INSERT INTO t2 VALUES
(111056548820001, 3, 'flag1', 'sss');
SELECT t1.flag_name,t2.flag_value
FROM t1 LEFT JOIN t2
ON (t1.ts_id = t2.ts_id AND t1.flag_name = t2.flag_name AND
t2.inst_id = 3)
WHERE t1.inst_id = 0 AND t1.ts_id=111056548820001 AND
t2.flag_value IS NULL;
DROP TABLE t1,t2;
CREATE TABLE invoice (
id int(11) unsigned NOT NULL auto_increment,
text_id int(10) unsigned default NULL,
PRIMARY KEY (id)
);
INSERT INTO invoice VALUES("1", "0");
INSERT INTO invoice VALUES("2", "10");
CREATE TABLE text_table (
text_id char(3) NOT NULL default '',
language_id char(3) NOT NULL default '',
text_data text,
PRIMARY KEY (text_id,language_id)
);
INSERT INTO text_table VALUES("0", "EN", "0-EN");
INSERT INTO text_table VALUES("0", "SV", "0-SV");
INSERT INTO text_table VALUES("10", "EN", "10-EN");
INSERT INTO text_table VALUES("10", "SV", "10-SV");
SELECT invoice.id, invoice.text_id, text_table.text_data
FROM invoice LEFT JOIN text_table
ON invoice.text_id = text_table.text_id
AND text_table.language_id = 'SV'
WHERE (invoice.id LIKE '%' OR text_table.text_data LIKE '%');
DROP TABLE invoice, text_table;
# Test for bug #5896
CREATE TABLE t0 (a0 int PRIMARY KEY);

View File

@ -150,7 +150,8 @@ create table t1
);
INSERT INTO t1 VALUES (1, 1, 1, 1, 'a');
INSERT INTO t1 VALUES (1, 1, 1, 1, 'b');
!$1062 INSERT INTO t1 VALUES (1, 1, 1, 1, 'a');
--error 1062
INSERT INTO t1 VALUES (1, 1, 1, 1, 'a');
drop table t1;
#

View File

@ -5,18 +5,25 @@
#
# ============================================================================
# ----------------------------------------------------------------------------
# $mysql_errno contains the return code of the last command
# send to the server.
# ----------------------------------------------------------------------------
# get $mysql_errno before the first statement
# $mysql_errno should be -1
eval select $mysql_errno as "before_use_test" ;
# ----------------------------------------------------------------------------
# Positive case(statement)
# ----------------------------------------------------------------------------
select otto from (select 1 as otto) as t1;
# expectation = response
!$0 select otto from (select 1 as otto) as t1;
--error 0
select otto from (select 1 as otto) as t1;
# expectation <> response
-- // !$1054 select otto from (select 1 as otto) as t1;
-- // --error 1054
-- // select otto from (select 1 as otto) as t1;
@ -29,12 +36,10 @@ select otto from (select 1 as otto) as t1;
# ----------------------------------------------------------------------------
# expectation <> response
#!$0 select friedrich from (select 1 as otto) as t1;
#--error 0
#select friedrich from (select 1 as otto) as t1;
# expectation = response
!$1054 select friedrich from (select 1 as otto) as t1;
--error 1054
select friedrich from (select 1 as otto) as t1;
@ -76,3 +81,208 @@ select friedrich from (select 1 as otto) as t1;
#--error S00000
#select friedrich from (select 1 as otto) as t1;
# ----------------------------------------------------------------------------
# test cases for $mysql_errno
#
# $mysql_errno is a builtin variable of mysqltest and contains the return code
# of the last command send to the server.
#
# The following test cases often initialize $mysql_errno to 1064 by
# a command with wrong syntax.
# Example: --error 1064 To prevent the abort after the error.
# garbage ;
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# check mysql_errno = 0 after successful statement
# ----------------------------------------------------------------------------
select otto from (select 1 as otto) as t1;
eval select $mysql_errno as "after_successful_stmt_errno" ;
#----------------------------------------------------------------------------
# check mysql_errno = 1064 after statement with wrong syntax
# ----------------------------------------------------------------------------
--error 1064
garbage ;
eval select $mysql_errno as "after_wrong_syntax_errno" ;
# ----------------------------------------------------------------------------
# check if let $my_var= 'abc' ; affects $mysql_errno
# ----------------------------------------------------------------------------
--error 1064
garbage ;
let $my_var= 'abc' ;
eval select $mysql_errno as "after_let_var_equal_value" ;
# ----------------------------------------------------------------------------
# check if set @my_var= 'abc' ; affects $mysql_errno
# ----------------------------------------------------------------------------
--error 1064
garbage ;
set @my_var= 'abc' ;
eval select $mysql_errno as "after_set_var_equal_value" ;
# ----------------------------------------------------------------------------
# check if the setting of --disable-warnings itself affects $mysql_errno
# (May be --<whatever> modifies $mysql_errno.)
# ----------------------------------------------------------------------------
--error 1064
garbage ;
--disable_warnings
eval select $mysql_errno as "after_disable_warnings_command" ;
# ----------------------------------------------------------------------------
# check if --disable-warnings + command with warning affects the errno
# stored within $mysql_errno
# (May be disabled warnings affect $mysql_errno.)
# ----------------------------------------------------------------------------
drop table if exists t1 ;
--error 1064
garbage ;
drop table if exists t1 ;
eval select $mysql_errno as "after_disable_warnings" ;
--enable_warnings
# ----------------------------------------------------------------------------
# check if masked errors affect $mysql_errno
# ----------------------------------------------------------------------------
--error 1064
garbage ;
--error 1146
select 3 from t1 ;
eval select $mysql_errno as "after_minus_masked" ;
--error 1064
garbage ;
--error 1146
select 3 from t1 ;
eval select $mysql_errno as "after_!_masked" ;
# ----------------------------------------------------------------------------
# Will manipulations of $mysql_errno be possible and visible ?
# ----------------------------------------------------------------------------
--error 1064
garbage ;
let $mysql_errno= -1;
eval select $mysql_errno as "after_let_errno_equal_value" ;
# ----------------------------------------------------------------------------
# How affect actions on prepared statements $mysql_errno ?
# ----------------------------------------------------------------------------
# failing prepare
--error 1064
garbage ;
--error 1146
prepare stmt from "select 3 from t1" ;
eval select $mysql_errno as "after_failing_prepare" ;
create table t1 ( f1 char(10));
# successful prepare
--error 1064
garbage ;
prepare stmt from "select 3 from t1" ;
eval select $mysql_errno as "after_successful_prepare" ;
# successful execute
--error 1064
garbage ;
execute stmt;
eval select $mysql_errno as "after_successful_execute" ;
# failing execute (table dropped)
drop table t1;
--error 1064
garbage ;
--error 1146
execute stmt;
eval select $mysql_errno as "after_failing_execute" ;
# failing execute (unknown statement)
--error 1064
garbage ;
--error 1243
execute __stmt_;
eval select $mysql_errno as "after_failing_execute" ;
# successful deallocate
--error 1064
garbage ;
deallocate prepare stmt;
eval select $mysql_errno as "after_successful_deallocate" ;
# failing deallocate ( statement handle does not exist )
--error 1064
garbage ;
--error 1243
deallocate prepare __stmt_;
eval select $mysql_errno as "after_failing_deallocate" ;
# ----------------------------------------------------------------------------
# test cases for "--disable_abort_on_error"
#
# "--disable_abort_on_error" switches the abort of mysqltest
# after "unmasked" failing statements off.
#
# The default is "--enable_abort_on_error".
#
# "Maskings" are
# --error <error number> and --error <error number>
# in the line before the failing statement.
#
# There are some additional test case for $mysql_errno
# because "--disable_abort_on_error" enables a new situation.
# Example: "unmasked" statement fails + analysis of $mysql_errno
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Switch the abort on error off and check the effect on $mysql_errno
# ----------------------------------------------------------------------------
--error 1064
garbage ;
--disable_abort_on_error
eval select $mysql_errno as "after_--disable_abort_on_error" ;
# ----------------------------------------------------------------------------
# "unmasked" failing statement should not cause an abort
# ----------------------------------------------------------------------------
select 3 from t1 ;
# ----------------------------------------------------------------------------
# masked failing statements
# ----------------------------------------------------------------------------
# expected error = response
--error 1146
select 3 from t1 ;
--error 1146
select 3 from t1 ;
eval select $mysql_errno as "after_!errno_masked_error" ;
# expected error <> response
# --error 1000
# select 3 from t1 ;
# --error 1000
# select 3 from t1 ;
# ----------------------------------------------------------------------------
# Switch the abort on error on and check the effect on $mysql_errno
# ----------------------------------------------------------------------------
--error 1064
garbage ;
--enable_abort_on_error
eval select $mysql_errno as "after_--enable_abort_on_error" ;
# ----------------------------------------------------------------------------
# masked failing statements
# ----------------------------------------------------------------------------
# expected error = response
--error 1146
select 3 from t1 ;
# ----------------------------------------------------------------------------
# check that the old default behaviour is not changed
# Please remove the '#' to get the abort on error
# ----------------------------------------------------------------------------
#--error 1064
#select 3 from t1 ;
#
#select 3 from t1 ;

View File

@ -36,6 +36,8 @@ UPDATE t1 SET pk1=2 WHERE attr1=1;
SELECT * FROM t1 ORDER BY pk1;
UPDATE t1 SET pk1=pk1 + 1;
SELECT * FROM t1 ORDER BY pk1;
UPDATE t1 SET pk1=4 WHERE pk1 = 3;
SELECT * FROM t1 ORDER BY pk1;
# Delete the record
DELETE FROM t1;
@ -371,3 +373,154 @@ select * from t1 order by b;
select * from t1 where b IS NULL;
select * from t1 where b IS NOT NULL;
drop table t1;
#
# test the limit of no of attributes in one table
#
create table t1 (
c1 int,
c2 int,
c3 int,
c4 int,
c5 int,
c6 int,
c7 int,
c8 int,
c9 int,
c10 int,
c11 int,
c12 int,
c13 int,
c14 int,
c15 int,
c16 int,
c17 int,
c18 int,
c19 int,
c20 int,
c21 int,
c22 int,
c23 int,
c24 int,
c25 int,
c26 int,
c27 int,
c28 int,
c29 int,
c30 int,
c31 int,
c32 int,
c33 int,
c34 int,
c35 int,
c36 int,
c37 int,
c38 int,
c39 int,
c40 int,
c41 int,
c42 int,
c43 int,
c44 int,
c45 int,
c46 int,
c47 int,
c48 int,
c49 int,
c50 int,
c51 int,
c52 int,
c53 int,
c54 int,
c55 int,
c56 int,
c57 int,
c58 int,
c59 int,
c60 int,
c61 int,
c62 int,
c63 int,
c64 int,
c65 int,
c66 int,
c67 int,
c68 int,
c69 int,
c70 int,
c71 int,
c72 int,
c73 int,
c74 int,
c75 int,
c76 int,
c77 int,
c78 int,
c79 int,
c80 int,
c81 int,
c82 int,
c83 int,
c84 int,
c85 int,
c86 int,
c87 int,
c88 int,
c89 int,
c90 int,
c91 int,
c92 int,
c93 int,
c94 int,
c95 int,
c96 int,
c97 int,
c98 int,
c99 int,
c100 int,
c101 int,
c102 int,
c103 int,
c104 int,
c105 int,
c106 int,
c107 int,
c108 int,
c109 int,
c110 int,
c111 int,
c112 int,
c113 int,
c114 int,
c115 int,
c116 int,
c117 int,
c118 int,
c119 int,
c120 int,
c121 int,
c122 int,
c123 int,
c124 int,
c125 int,
c126 int,
c127 int,
c128 int,
primary key(c1)) engine=ndb;
drop table t1;
#
# test max size of attribute name and truncation
#
create table t1 (
a1234567890123456789012345678901234567890 int primary key,
a12345678901234567890123456789a1234567890 int,
index(a12345678901234567890123456789a1234567890)
) engine=ndb;
show tables;
insert into t1 values (1,1),(2,1),(3,1),(4,1),(5,2),(6,1),(7,1);
explain select * from t1 where a12345678901234567890123456789a1234567890=2;
select * from t1 where a12345678901234567890123456789a1234567890=2;
drop table t1;

View File

@ -2,7 +2,7 @@
--disable_warnings
drop table if exists t1;
drop database if exists mysqltest;
drop database if exists test2;
--enable_warnings
#
@ -12,31 +12,7 @@ drop database if exists mysqltest;
# A prerequisite for this handler test is that "testBlobs" succeeds.
#
# -- bug-5252 tinytext crashes --
create table t1 (
a int not null primary key,
b tinytext
) engine=ndbcluster;
insert into t1 values(1, 'x');
update t1 set b = 'y';
select * from t1;
delete from t1;
drop table t1;
# -- bug-5013 insert empty string to text --
create table t1 (
a int not null primary key,
b text not null
) engine=ndbcluster;
insert into t1 values(1, '');
select * from t1;
drop table t1;
-- general test starts --
# -- general test starts --
# make test harder with autocommit off
set autocommit=0;
@ -117,7 +93,6 @@ from t1 where a=2;
# pk update to null
update t1 set d=null where a=1;
commit;
# FIXME now fails at random due to weird mixup between the 2 rows
select a from t1 where d is null;
# pk delete
@ -126,6 +101,49 @@ delete from t1 where a=2;
commit;
select count(*) from t1;
# -- replace ( bug-6018 ) --
# insert
replace t1 set a=1,b=@b1,c=111,d=@d1;
replace t1 set a=2,b=@b2,c=222,d=@d2;
commit;
explain select * from t1 where a = 1;
# pk read
select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
from t1 where a=1;
select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
from t1 where a=2;
# update
replace t1 set a=1,b=@b2,c=111,d=@d2;
replace t1 set a=2,b=@b1,c=222,d=@d1;
commit;
select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
from t1 where a=1;
select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
from t1 where a=2;
# update
replace t1 set a=1,b=concat(@b2,@b2),c=111,d=concat(@d2,@d2);
replace t1 set a=2,b=concat(@b1,@b1),c=222,d=concat(@d1,@d1);
commit;
select a,length(b),substr(b,1+4*9000,2),length(d),substr(d,1+6*9000,3)
from t1 where a=1;
select a,length(b),substr(b,1+4*900,2),length(d),substr(d,1+6*900,3)
from t1 where a=2;
# update to null
replace t1 set a=1,b='xyz',c=111,d=null;
commit;
select a,b from t1 where d is null;
# pk delete
delete from t1 where a=1;
delete from t1 where a=2;
commit;
select count(*) from t1;
# -- hash index ops --
insert into t1 values(1,@b1,111,@d1);
@ -231,39 +249,6 @@ where c >= 100;
commit;
select * from t1 where c >= 100 order by a;
# alter table
select * from t1 order by a;
alter table t1 add x int;
select * from t1 order by a;
alter table t1 drop x;
select * from t1 order by a;
# multi db
create database mysqltest;
use mysqltest;
CREATE TABLE t2 (
a bigint unsigned NOT NULL PRIMARY KEY,
b int unsigned not null,
c int unsigned
) engine=ndbcluster;
insert into t2 values (1,1,1),(2,2,2);
select * from test.t1,t2 where test.t1.a = t2.a order by test.t1.a;
drop table t2;
use test;
# alter table
select * from t1 order by a;
alter table t1 add x int;
select * from t1 order by a;
alter table t1 drop x;
select * from t1 order by a;
# range scan delete
delete from t1 where c >= 100;
commit;
@ -306,10 +291,82 @@ 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 database mysqltest;
# bug #5349
# -- alter table and multi db --
insert into t1 values(1,'b1',111,'dd1');
insert into t1 values(2,'b2',222,'dd2');
insert into t1 values(3,'b3',333,'dd3');
insert into t1 values(4,'b4',444,'dd4');
insert into t1 values(5,'b5',555,'dd5');
insert into t1 values(6,'b6',666,'dd6');
insert into t1 values(7,'b7',777,'dd7');
insert into t1 values(8,'b8',888,'dd8');
insert into t1 values(9,'b9',999,'dd9');
commit;
select * from t1 order by a;
alter table t1 add x int;
select * from t1 order by a;
alter table t1 drop x;
select * from t1 order by a;
create database test2;
use test2;
CREATE TABLE t2 (
a bigint unsigned NOT NULL PRIMARY KEY,
b int unsigned not null,
c int unsigned
) engine=ndbcluster;
insert into t2 values (1,1,1),(2,2,2);
select * from test.t1,t2 where test.t1.a = t2.a order by test.t1.a;
drop table t2;
use test;
select * from t1 order by a;
alter table t1 add x int;
select * from t1 order by a;
alter table t1 drop x;
select * from t1 order by a;
# -- end general test --
drop table t1;
drop database test2;
# -- bug-5252 tinytext crashes plus no-commit result --
set autocommit=0;
create table t1 (
a int not null primary key,
b tinytext
) engine=ndbcluster;
insert into t1 values(1, 'x');
update t1 set b = 'y';
select * from t1;
delete from t1;
select * from t1;
commit;
drop table t1;
# -- bug-5013 insert empty string to text --
set autocommit=0;
create table t1 (
a int not null primary key,
b text not null
) engine=ndbcluster;
insert into t1 values(1, '');
select * from t1;
commit;
drop table t1;
# -- bug #5349 --
set autocommit=1;
use test;
CREATE TABLE t1 (
@ -327,7 +384,8 @@ select * from t1 order by a;
alter table t1 engine=ndb;
select * from t1 order by a;
# bug #5872
# -- bug #5872 --
set autocommit=1;
alter table t1 engine=myisam;
select * from t1 order by a;
drop table t1;

View File

@ -583,3 +583,18 @@ INSERT INTO t1 VALUES(1,1,1) ON DUPLICATE KEY UPDATE b=79;
select * from t1 where pk1=1;
DROP TABLE t1;
#
# Bug #6331: problem with 'insert ignore'
#
CREATE TABLE t1(a INT) ENGINE=ndb;
INSERT IGNORE INTO t1 VALUES (1);
INSERT IGNORE INTO t1 VALUES (1);
INSERT IGNORE INTO t1 SELECT a FROM t1;
INSERT IGNORE INTO t1 SELECT a FROM t1;
INSERT IGNORE INTO t1 SELECT a FROM t1;
INSERT IGNORE INTO t1 VALUES (1);
INSERT IGNORE INTO t1 VALUES (1);
SELECT * FROM t1;
DROP TABLE t1;

View File

@ -110,10 +110,6 @@ set @fvar= 123.4567;
--error 1064
prepare stmt1 from @fvar;
set @str1 = 'select ?';
set @str2 = convert(@str1 using ucs2);
prepare stmt1 from @str2;
execute stmt1 using @ivar;
drop table t1,t2;
#

View File

@ -61,12 +61,11 @@ while ($1)
select * from t1;
# Waiting for the resolution of bug#6138
# # Now, increase salary to a multiple of 50
# prepare st_round from 'update t1 set salary = salary + ? - ( salary MOD ? )';
# set @arg_round= 50;
# execute st_round using @arg_round, @arg_round;
#
# select * from t1;
# Now, increase salary to a multiple of 50 (checks for bug#6138)
prepare st_round from 'update t1 set salary = salary + ? - ( salary MOD ? )';
set @arg_round= 50;
execute st_round using @arg_round, @arg_round;
select * from t1;
drop table t1;

View File

@ -339,8 +339,8 @@ select a,b from t1 where a >= 1000 order by a ;
delete from t1 where a >= 1000 ;
## replace
--error 1295
prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
--error 1031
## multi table statements
--disable_query_log

View File

@ -418,3 +418,18 @@ select count(*) from t2 where x > -16;
select count(*) from t2 where x = 18446744073709551601;
drop table t1,t2;
#
# Bug #6045: Binary Comparison regression in MySQL 4.1
# Binary searches didn't use a case insensitive index.
#
set names latin1;
create table t1 (a char(10), b text, key (a)) character set latin1;
INSERT INTO t1 (a) VALUES
('111'),('222'),('222'),('222'),('222'),('444'),('aaa'),('AAA'),('bbb');
# all these three can be optimized
explain select * from t1 where a='aaa';
explain select * from t1 where a=binary 'aaa';
explain select * from t1 where a='aaa' collate latin1_bin;
# this one cannot:
explain select * from t1 where a='aaa' collate latin1_german1_ci;
drop table t1;

View File

@ -0,0 +1 @@
--loose-innodb-lock-wait-timeout=1

View File

@ -0,0 +1,18 @@
source include/have_innodb.inc;
source include/master-slave.inc;
#
# BUG#5551 "Failed OPTIMIZE TABLE is logged to binary log"
# Replication should work when OPTIMIZE TABLE timeouts, and
# when OPTIMIZE TABLE is executed on a non-existing table
#
CREATE TABLE t1 ( a int ) ENGINE=InnoDB;
BEGIN;
INSERT INTO t1 VALUES (1);
connection master1;
OPTIMIZE TABLE t1;
OPTIMIZE TABLE non_existing;
sync_slave_with_master;

View File

@ -1910,3 +1910,39 @@ EXPLAIN SELECT i FROM t1 WHERE i=1;
EXPLAIN SELECT i FROM t1 WHERE i=1;
DROP TABLE t1;
#
# Test for bug #6474
#
CREATE TABLE t1 (
K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '',
K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000',
F2I4 int(11) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t1 VALUES
('W%RT', '0100', 1),
('W-RT', '0100', 1),
('WART', '0100', 1),
('WART', '0200', 1),
('WERT', '0100', 2),
('WORT','0200', 2),
('WT', '0100', 2),
('W_RT', '0100', 2),
('WaRT', '0100', 3),
('WART', '0300', 3),
('WRT' , '0400', 3),
('WURM', '0500', 3),
('W%T', '0600', 4),
('WA%T', '0700', 4),
('WA_T', '0800', 4);
SELECT K2C4, K4N4, F2I4 FROM t1
WHERE K2C4 = 'WART' AND
(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200'));
SELECT K2C4, K4N4, F2I4 FROM t1
WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200');
DROP TABLE t1;

View File

@ -21,7 +21,8 @@ check table t1 changed;
check table t1 medium;
check table t1 extended;
show index from t1;
!$1062 insert into t1 values (5,5,5);
--error 1062
insert into t1 values (5,5,5);
optimize table t1;
optimize table t1;
drop table t1;

View File

@ -29,6 +29,37 @@ select @@sql_mode;
show create table t1;
drop table t1;
#
# Check that a binary collation adds 'binary'
# suffix into a char() column definition in
# mysql40 and mysql2323 modes. This allows
# not to lose the column's case sensitivity
# when loading the dump in pre-4.1 servers.
#
# Thus, in 4.0 and 3.23 modes we dump:
#
# 'char(10) collate xxx_bin' as 'char(10) binary'
# 'binary(10)' as 'binary(10)'
#
# In mysql-4.1 these types are different, and they will
# be recreated differently.
#
# In mysqld-4.0 the the above two types were the same,
# so it will create a 'char(10) binary' column for both definitions.
#
CREATE TABLE t1 (
a char(10),
b char(10) collate latin1_bin,
c binary(10)
) character set latin1;
set @@sql_mode="";
show create table t1;
set @@sql_mode="mysql323";
show create table t1;
set @@sql_mode="mysql40";
show create table t1;
drop table t1;
#
# BUG#5318 - failure: 'IGNORE_SPACE' affects numeric values after DEFAULT
#

View File

@ -20,8 +20,10 @@ create TEMPORARY TABLE t2 engine=heap select * from t1;
create TEMPORARY TABLE IF NOT EXISTS t2 (a int) engine=heap;
# This should give errors
!$1050 CREATE TEMPORARY TABLE t1 (a int not null, b char (10) not null);
!$1050 ALTER TABLE t1 RENAME t2;
--error 1050
CREATE TEMPORARY TABLE t1 (a int not null, b char (10) not null);
--error 1050
ALTER TABLE t1 RENAME t2;
select * from t2;
alter table t2 add primary key (a,b);

View File

@ -6,7 +6,9 @@
drop table if exists t1;
--enable_warnings
--replace_result e-0 e- e+0 e+
SELECT 10,10.0,10.,.1e+2,100.0e-1;
--replace_result e-00 e-0
SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000;
SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1;
@ -14,6 +16,7 @@ create table t1 (f1 float(24),f2 float(52));
show full columns from t1;
insert into t1 values(10,10),(1e+5,1e+5),(1234567890,1234567890),(1e+10,1e+10),(1e+15,1e+15),(1e+20,1e+20),(1e+50,1e+50),(1e+150,1e+150);
insert into t1 values(-10,-10),(1e-5,1e-5),(1e-10,1e-10),(1e-15,1e-15),(1e-20,1e-20),(1e-50,1e-50),(1e-150,1e-150);
--replace_result e-0 e- e+0 e+
select * from t1;
drop table t1;

View File

@ -135,7 +135,8 @@ drop table t1,t2;
create table t1 (c int);
insert into t1 values(1),(2);
create table t2 select * from t1;
!$1060 create table t3 select * from t1, t2; # Should give an error
--error 1060
create table t3 select * from t1, t2; # Should give an error
create table t3 select t1.c AS c1, t2.c AS c2,1 as "const" from t1, t2;
show full columns from t3;
drop table t1,t2,t3;

View File

@ -121,3 +121,9 @@ show binlog events from 95;
drop table t1, t2;
#
# Bug #6321 strange error:
# string function FIELD(<uservariable content NULL>, ...)
#
set @var= NULL ;
select FIELD( @var,'1it','Hit') as my_column;

View File

@ -20,6 +20,7 @@ select @test, @`test`, @TEST, @`TEST`, @"teSt";
set @select=2,@t5=1.23456;
select @`select`,@not_used;
set @test_int=10,@test_double=1e-10,@test_string="abcdeghi",@test_string2="abcdefghij",@select=NULL;
--replace_result e-0 e- e+0 e+
select @test_int,@test_double,@test_string,@test_string2,@select;
set @test_int="hello",@test_double="hello",@test_string="hello",@test_string2="hello";
select @test_int,@test_double,@test_string,@test_string2;

View File

@ -1554,3 +1554,37 @@ select concat('|',a,'|'), concat('|',b,'|') from v1;
drop view v1;
drop table t1;
#
# user with global DB privileges
#
connection root;
--disable_warnings
create database mysqltest;
--enable_warnings
create table mysqltest.t1 (a int);
grant all privileges on mysqltest.* to mysqltest_1@localhost;
connection user1;
use mysqltest;
create view v1 as select * from t1;
connection root;
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
drop database mysqltest;
#
# Trys update table from which we select using views and subqueries
#
create table t1 (s1 smallint);
create view v1 as select * from t1 where 20 < (select (s1) from t1);
-- error 1288
insert into v1 values (30);
create view v2 as select * from t1;
create view v3 as select * from t1 where 20 < (select (s1) from v2);
-- error 1288
insert into v3 values (30);
create view v4 as select * from v2 where 20 < (select (s1) from t1);
-- error 1093
insert into v4 values (30);
drop view v4, v3, v2, v1;
drop table t1;

Some files were not shown because too many files have changed in this diff Show More