summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BitKeeper/etc/logging_ok1
-rw-r--r--client/mysqldump.c117
-rw-r--r--cmd-line-utils/libedit/makelist.sh4
-rw-r--r--cmd-line-utils/libedit/readline.c2
-rw-r--r--cmd-line-utils/libedit/search.c1
-rw-r--r--configure.in1
-rw-r--r--myisam/mi_check.c36
-rw-r--r--mysql-test/mysql-test-run.sh2
-rw-r--r--mysql-test/r/myisam.result14
-rw-r--r--mysql-test/r/olap.result33
-rw-r--r--mysql-test/r/subselect.result24
-rw-r--r--mysql-test/t/myisam.test15
-rw-r--r--mysql-test/t/mysqldump.test339
-rw-r--r--mysql-test/t/olap.test24
-rw-r--r--mysql-test/t/range.test2
-rw-r--r--mysql-test/t/subselect.test23
-rw-r--r--ndb/src/common/util/version.c2
-rw-r--r--ndb/src/ndbapi/ndberror.c4
-rw-r--r--sql/item.cc2
-rw-r--r--sql/sql_select.cc6
20 files changed, 593 insertions, 59 deletions
diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok
index 31ed6abe28c..8e03cb3bad2 100644
--- a/BitKeeper/etc/logging_ok
+++ b/BitKeeper/etc/logging_ok
@@ -282,6 +282,7 @@ tonu@x3.internalnet
tsmith@build.mysql.com
tulin@build.mysql.com
tulin@dl145b.mysql.com
+tulin@dl145c.mysql.com
tulin@mysql.com
ulli@morbus.(none)
venu@hundin.mysql.fi
diff --git a/client/mysqldump.c b/client/mysqldump.c
index f8314444051..4a84bc3f250 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -75,18 +75,22 @@ static ulong find_set(TYPELIB *lib, const char *x, uint length,
char **err_pos, uint *err_len);
static char *field_escape(char *to,const char *from,uint length);
-static my_bool verbose=0,tFlag=0,cFlag=0,dFlag=0,quick= 1, extended_insert= 1,
+static my_bool verbose=0,tFlag=0,dFlag=0,quick= 1, extended_insert= 1,
lock_tables=1,ignore_errors=0,flush_logs=0,
opt_drop=1,opt_keywords=0,opt_lock=1,opt_compress=0,
opt_delayed=0,create_options=1,opt_quoted=0,opt_databases=0,
- opt_alldbs=0,opt_create_db=0,opt_lock_all_tables=0,opt_set_charset,
+ opt_alldbs=0,opt_create_db=0,opt_lock_all_tables=0,
+ opt_set_charset=0,
opt_autocommit=0,opt_disable_keys=1,opt_xml=0,
opt_delete_master_logs=0, tty_password=0,
opt_single_transaction=0, opt_comments= 0, opt_compact= 0,
- opt_hex_blob=0, opt_order_by_primary=0, opt_ignore=0;
+ opt_hex_blob=0, opt_order_by_primary=0, opt_ignore=0,
+ opt_complete_insert= 0;
static ulong opt_max_allowed_packet, opt_net_buffer_length;
static MYSQL mysql_connection,*sock=0;
-static char insert_pat[12 * 1024],*opt_password=0,*current_user=0,
+static my_bool insert_pat_inited=0;
+static DYNAMIC_STRING insert_pat;
+static char *opt_password=0,*current_user=0,
*current_host=0,*path=0,*fields_terminated=0,
*lines_terminated=0, *enclosed=0, *opt_enclosed=0, *escaped=0,
*where=0, *order_by=0,
@@ -180,8 +184,9 @@ static struct my_option my_long_options[] =
"Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --no-set-names --skip-disable-keys --skip-add-locks",
(gptr*) &opt_compact, (gptr*) &opt_compact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
- {"complete-insert", 'c', "Use complete insert statements.", (gptr*) &cFlag,
- (gptr*) &cFlag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"complete-insert", 'c', "Use complete insert statements.",
+ (gptr*) &opt_complete_insert, (gptr*) &opt_complete_insert, 0, GET_BOOL,
+ NO_ARG, 0, 0, 0, 0, 0, 0},
{"compress", 'C', "Use compression in server/client protocol.",
(gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
@@ -1110,7 +1115,7 @@ static void print_xml_row(FILE *xml_file, const char *row_name,
/*
- getStructure -- retrievs database structure, prints out corresponding
+ getTableStructure -- retrievs database structure, prints out corresponding
CREATE statement and fills out insert_pat.
RETURN
@@ -1123,13 +1128,22 @@ static uint get_table_structure(char *table, char *db)
MYSQL_ROW row;
my_bool init=0;
uint numFields;
- char *strpos, *result_table, *opt_quoted_table;
+ char *result_table, *opt_quoted_table;
const char *insert_option;
char name_buff[NAME_LEN+3],table_buff[NAME_LEN*2+3];
char table_buff2[NAME_LEN*2+3];
+ char query_buff[512];
FILE *sql_file = md_result_file;
+ int len;
DBUG_ENTER("get_table_structure");
+ if (!insert_pat_inited)
+ {
+ insert_pat_inited= init_dynamic_string(&insert_pat, "", 1024, 1024);
+ }
+ else
+ dynstr_set(&insert_pat, "");
+
insert_option= (opt_delayed && opt_ignore) ? " DELAYED IGNORE " :
opt_delayed ? " DELAYED " :
opt_ignore ? " IGNORE " : "";
@@ -1137,11 +1151,11 @@ static uint get_table_structure(char *table, char *db)
if (verbose)
fprintf(stderr, "-- Retrieving table structure for table %s...\n", table);
- my_snprintf(insert_pat, sizeof(insert_pat),
- "SET OPTION SQL_QUOTE_SHOW_CREATE=%d",
- (opt_quoted || opt_keywords));
+ len= my_snprintf(query_buff, sizeof(query_buff),
+ "SET OPTION SQL_QUOTE_SHOW_CREATE=%d",
+ (opt_quoted || opt_keywords));
if (!create_options)
- strmov(strend(insert_pat), "/*!40102 ,SQL_MODE=concat(@@sql_mode, _utf8 ',NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS') */");
+ strmov(query_buff+len, "/*!40102 ,SQL_MODE=concat(@@sql_mode, _utf8 ',NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS') */");
result_table= quote_name(table, table_buff, 1);
opt_quoted_table= quote_name(table, table_buff2, 0);
@@ -1149,7 +1163,7 @@ static uint get_table_structure(char *table, char *db)
if (opt_order_by_primary)
order_by = primary_key_fields(opt_quoted_table);
- if (!opt_xml && !mysql_query_with_error_report(sock, 0, insert_pat))
+ if (!opt_xml && !mysql_query_with_error_report(sock, 0, query_buff))
{
/* using SHOW CREATE statement */
if (!tFlag)
@@ -1204,9 +1218,9 @@ static uint get_table_structure(char *table, char *db)
check_io(sql_file);
mysql_free_result(tableRes);
}
- my_snprintf(insert_pat, sizeof(insert_pat), "show fields from %s",
+ my_snprintf(query_buff, sizeof(query_buff), "show fields from %s",
result_table);
- if (mysql_query_with_error_report(sock, &tableRes, insert_pat))
+ if (mysql_query_with_error_report(sock, &tableRes, query_buff))
{
if (path)
my_fclose(sql_file, MYF(MY_WME));
@@ -1214,28 +1228,32 @@ static uint get_table_structure(char *table, char *db)
DBUG_RETURN(0);
}
- if (cFlag)
- my_snprintf(insert_pat, sizeof(insert_pat), "INSERT %sINTO %s (",
- insert_option, opt_quoted_table);
+ dynstr_append_mem(&insert_pat, "INSERT ", 7);
+ dynstr_append(&insert_pat, insert_option);
+ dynstr_append_mem(&insert_pat, "INTO ", 5);
+ dynstr_append(&insert_pat, opt_quoted_table);
+ if (opt_complete_insert)
+ {
+ dynstr_append_mem(&insert_pat, " (", 2);
+ }
else
{
- my_snprintf(insert_pat, sizeof(insert_pat), "INSERT %sINTO %s VALUES ",
- insert_option, opt_quoted_table);
+ dynstr_append_mem(&insert_pat, " VALUES ", 8);
if (!extended_insert)
- strcat(insert_pat,"(");
+ dynstr_append_mem(&insert_pat, "(", 1);
}
- strpos=strend(insert_pat);
while ((row=mysql_fetch_row(tableRes)))
{
if (init)
{
- if (cFlag)
- strpos=strmov(strpos,", ");
+ if (opt_complete_insert)
+ dynstr_append_mem(&insert_pat, ", ", 2);
}
init=1;
- if (cFlag)
- strpos=strmov(strpos,quote_name(row[SHOW_FIELDNAME], name_buff, 0));
+ if (opt_complete_insert)
+ dynstr_append(&insert_pat,
+ quote_name(row[SHOW_FIELDNAME], name_buff, 0));
}
numFields = (uint) mysql_num_rows(tableRes);
mysql_free_result(tableRes);
@@ -1247,9 +1265,9 @@ static uint get_table_structure(char *table, char *db)
"%s: Warning: Can't set SQL_QUOTE_SHOW_CREATE option (%s)\n",
my_progname, mysql_error(sock));
- my_snprintf(insert_pat, sizeof(insert_pat), "show fields from %s",
+ my_snprintf(query_buff, sizeof(query_buff), "show fields from %s",
result_table);
- if (mysql_query_with_error_report(sock, &tableRes, insert_pat))
+ if (mysql_query_with_error_report(sock, &tableRes, query_buff))
{
safe_exit(EX_MYSQLERR);
DBUG_RETURN(0);
@@ -1282,18 +1300,22 @@ static uint get_table_structure(char *table, char *db)
print_xml_tag1(sql_file, "\t", "table_structure name=", table, "\n");
check_io(sql_file);
}
- if (cFlag)
- my_snprintf(insert_pat, sizeof(insert_pat), "INSERT %sINTO %s (",
- insert_option, result_table);
+
+ dynstr_append_mem(&insert_pat, "INSERT ", 7);
+ dynstr_append(&insert_pat, insert_option);
+ dynstr_append_mem(&insert_pat, "INTO ", 5);
+ dynstr_append(&insert_pat, result_table);
+ if (opt_complete_insert)
+ {
+ dynstr_append_mem(&insert_pat, " (", 2);
+ }
else
{
- my_snprintf(insert_pat, sizeof(insert_pat), "INSERT %sINTO %s VALUES ",
- insert_option, result_table);
+ dynstr_append_mem(&insert_pat, " VALUES ", 8);
if (!extended_insert)
- strcat(insert_pat,"(");
+ dynstr_append_mem(&insert_pat, "(", 1);
}
- strpos=strend(insert_pat);
while ((row=mysql_fetch_row(tableRes)))
{
ulong *lengths=mysql_fetch_lengths(tableRes);
@@ -1304,12 +1326,13 @@ static uint get_table_structure(char *table, char *db)
fputs(",\n",sql_file);
check_io(sql_file);
}
- if (cFlag)
- strpos=strmov(strpos,", ");
+ if (opt_complete_insert)
+ dynstr_append_mem(&insert_pat, ", ", 2);
}
init=1;
- if (cFlag)
- strpos=strmov(strpos,quote_name(row[SHOW_FIELDNAME], name_buff, 0));
+ if (opt_complete_insert)
+ dynstr_append(&insert_pat,
+ quote_name(row[SHOW_FIELDNAME], name_buff, 0));
if (!tFlag)
{
if (opt_xml)
@@ -1317,7 +1340,7 @@ static uint get_table_structure(char *table, char *db)
print_xml_row(sql_file, "field", tableRes, &row);
continue;
}
-
+
if (opt_keywords)
fprintf(sql_file, " %s.%s %s", result_table,
quote_name(row[SHOW_FIELDNAME],name_buff, 0),
@@ -1470,11 +1493,11 @@ continue_xml:
check_io(sql_file);
}
}
- if (cFlag)
+ if (opt_complete_insert)
{
- strpos=strmov(strpos,") VALUES ");
+ dynstr_append_mem(&insert_pat, ") VALUES ", 9);
if (!extended_insert)
- strpos=strmov(strpos,"(");
+ dynstr_append_mem(&insert_pat, "(", 1);
}
if (sql_file != md_result_file)
{
@@ -1699,7 +1722,7 @@ static void dump_table(uint numFields, char *table)
total_length= opt_net_buffer_length; /* Force row break */
row_break=0;
rownr=0;
- init_length=(uint) strlen(insert_pat)+4;
+ init_length=(uint) insert_pat.length+4;
if (opt_xml)
print_xml_tag1(md_result_file, "\t", "table_data name=", table, "\n");
@@ -1716,7 +1739,7 @@ static void dump_table(uint numFields, char *table)
rownr++;
if (!extended_insert && !opt_xml)
{
- fputs(insert_pat,md_result_file);
+ fputs(insert_pat.str,md_result_file);
check_io(md_result_file);
}
mysql_field_seek(res,0);
@@ -1914,7 +1937,7 @@ static void dump_table(uint numFields, char *table)
fputs(";\n", md_result_file);
row_break=1; /* This is first row */
- fputs(insert_pat,md_result_file);
+ fputs(insert_pat.str,md_result_file);
fputs(extended_row.str,md_result_file);
total_length = row_length+init_length;
}
@@ -2798,6 +2821,8 @@ err:
my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR));
if (extended_insert)
dynstr_free(&extended_row);
+ if (insert_pat_inited)
+ dynstr_free(&insert_pat);
my_end(0);
return(first_error);
} /* main */
diff --git a/cmd-line-utils/libedit/makelist.sh b/cmd-line-utils/libedit/makelist.sh
index 502604791f5..f15b3d1eb9f 100644
--- a/cmd-line-utils/libedit/makelist.sh
+++ b/cmd-line-utils/libedit/makelist.sh
@@ -87,7 +87,7 @@ case $FLAG in
cat $FILES | $AWK '
BEGIN {
printf("/* Automatically generated file, do not edit */\n");
- printf("#include \"sys.h\"\n#include \"el.h\"\n");
+ printf("#include \"config.h\"\n#include \"el.h\"\n");
printf("private const struct el_bindings_t el_func_help[] = {\n");
low = "abcdefghijklmnopqrstuvwxyz_";
high = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_";
@@ -170,7 +170,7 @@ case $FLAG in
cat $FILES | $AWK '/el_action_t/ { print $3 }' | sort | $AWK '
BEGIN {
printf("/* Automatically generated file, do not edit */\n");
- printf("#include \"sys.h\"\n#include \"el.h\"\n");
+ printf("#include \"config.h\"\n#include \"el.h\"\n");
printf("private const el_func_t el_func[] = {");
maxlen = 80;
needn = 1;
diff --git a/cmd-line-utils/libedit/readline.c b/cmd-line-utils/libedit/readline.c
index 3a38e8a99ab..616b55a877e 100644
--- a/cmd-line-utils/libedit/readline.c
+++ b/cmd-line-utils/libedit/readline.c
@@ -70,10 +70,10 @@ extern char *alloca ();
#include <fcntl.h>
#include <vis.h>
+#include "readline/readline.h"
#include "el.h"
#include "fcns.h" /* for EL_NUM_FCNS */
#include "histedit.h"
-#include "readline/readline.h"
/* for rl_complete() */
#define TAB '\r'
diff --git a/cmd-line-utils/libedit/search.c b/cmd-line-utils/libedit/search.c
index 848429e091b..850c5f27140 100644
--- a/cmd-line-utils/libedit/search.c
+++ b/cmd-line-utils/libedit/search.c
@@ -37,6 +37,7 @@
/*
* search.c: History and character search functions
*/
+#include <sys/types.h>
#include <stdlib.h>
#if defined(REGEX)
#include <regex.h>
diff --git a/configure.in b/configure.in
index 26e30486ba5..bc00a15fed1 100644
--- a/configure.in
+++ b/configure.in
@@ -1812,6 +1812,7 @@ fi
fi
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
+AC_CHECK_TYPES([u_int32_t])
MYSQL_PTHREAD_YIELD
diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index 2949b39183d..38f3ebaa20a 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -3244,6 +3244,9 @@ static int sort_key_write(MI_SORT_PARAM *sort_param, const void *a)
cmp=ha_key_cmp(sort_param->seg,sort_info->key_block->lastkey,
(uchar*) a, USE_WHOLE_KEY,SEARCH_FIND | SEARCH_UPDATE,
&diff_pos);
+ ha_key_cmp(sort_param->seg,sort_info->key_block->lastkey,
+ (uchar*) a, USE_WHOLE_KEY,SEARCH_FIND | SEARCH_NULL_ARE_NOT_EQUAL,
+ &diff_pos);
sort_param->unique[diff_pos-1]++;
}
else
@@ -3956,7 +3959,38 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info,
return;
}
- /* calculate unique keys for each part key */
+
+/*
+ Update statistics for each part of an index
+
+ SYNOPSIS
+ update_key_parts()
+ keyinfo Index information (only key->keysegs used)
+ rec_per_key_part OUT Store statistics here
+ unique IN Array of #distinct values collected over index
+ run.
+ records Number of records in the table
+
+ NOTES
+ Unique is an array:
+ unique[0]= (#different values of {keypart1}) - 1
+ unique[1]= (#different values of {keypart2,keypart1} tuple) - unique[0] - 1
+ ...
+ Here we assume that NULL != NULL (see SEARCH_NULL_ARE_NOT_EQUAL). The
+ 'unique' array is collected in one sequential scan through the entire
+ index. This is done in two places: in chk_index() and in sort_key_write().
+
+ Output is an array:
+ rec_per_key_part[k] =
+ = E(#records in the table such that keypart_1=c_1 AND ... AND
+ keypart_k=c_k for arbitrary constants c_1 ... c_k)
+
+ = {assuming that values have uniform distribution and index contains all
+ tuples from the domain (or that {c_1, ..., c_k} tuple is choosen from
+ index tuples}
+
+ = #tuples-in-the-index / #distinct-tuples-in-the-index.
+*/
void update_key_parts(MI_KEYDEF *keyinfo, ulong *rec_per_key_part,
ulonglong *unique, ulonglong records)
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh
index 967d6e6408e..cd1e634a831 100644
--- a/mysql-test/mysql-test-run.sh
+++ b/mysql-test/mysql-test-run.sh
@@ -710,7 +710,7 @@ MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=
MYSQL_SHOW="$MYSQL_SHOW -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLSHOW_OPT"
MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR --character-sets-dir=$CHARSETSDIR $EXTRA_MYSQLBINLOG_OPT"
MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose"
-MYSQL="$MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD"
+MYSQL="$MYSQL --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD"
export MYSQL MYSQL_DUMP MYSQL_SHOW MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES
export CLIENT_BINDIR MYSQL_CLIENT_TEST CHARSETSDIR
export NDB_TOOLS_DIR
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index 30e573fa31e..8239202fc04 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -1260,3 +1260,17 @@ Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
set global concurrent_insert=@save_concurrent_insert;
+create table t1 (a int, key(a));
+insert into t1 values (1),(2),(3),(4),(NULL),(NULL),(NULL),(NULL);
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+show keys from t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t1 1 a 1 a A 8 NULL NULL YES BTREE
+alter table t1 disable keys;
+alter table t1 enable keys;
+show keys from t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t1 1 a 1 a A 8 NULL NULL YES BTREE
+drop table t1;
diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result
index 1d8830b7d5f..9411edcdc00 100644
--- a/mysql-test/r/olap.result
+++ b/mysql-test/r/olap.result
@@ -456,3 +456,36 @@ a m
NULL 3
DROP TABLE t1;
set div_precision_increment= @sav_dpi;
+CREATE TABLE t1 (a int(11));
+INSERT INTO t1 VALUES (1),(2);
+SELECT a, SUM(a), SUM(a)+1 FROM (SELECT a FROM t1 UNION select 2) d
+GROUP BY a;
+a SUM(a) SUM(a)+1
+1 1 2
+2 2 3
+SELECT a, SUM(a), SUM(a)+1 FROM (SELECT a FROM t1 UNION select 2) d
+GROUP BY a WITH ROLLUP;
+a SUM(a) SUM(a)+1
+1 1 2
+2 2 3
+NULL 3 4
+SELECT a, SUM(a), SUM(a)+1 FROM (SELECT 1 a UNION select 2) d
+GROUP BY a;
+a SUM(a) SUM(a)+1
+1 1 2
+2 2 3
+SELECT a, SUM(a), SUM(a)+1 FROM (SELECT 1 a UNION select 2) d
+GROUP BY a WITH ROLLUP;
+a SUM(a) SUM(a)+1
+1 1 2
+2 2 3
+NULL 3 4
+SELECT a, SUM(a), SUM(a)+1, CONCAT(SUM(a),'x'), SUM(a)+SUM(a), SUM(a)
+FROM (SELECT 1 a, 2 b UNION SELECT 2,3 UNION SELECT 5,6 ) d
+GROUP BY a WITH ROLLUP;
+a SUM(a) SUM(a)+1 CONCAT(SUM(a),'x') SUM(a)+SUM(a) SUM(a)
+1 1 2 1x 2 1
+2 2 3 2x 4 2
+5 5 6 5x 10 5
+NULL 8 9 8x 16 8
+DROP TABLE t1;
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index fa5f27b7eed..115f95978fc 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -2781,3 +2781,27 @@ c1 c2
2 NULL
3 NULL
DROP TABLE t1,t2,t3;
+drop table t1
+#;
+CREATE TABLE `t1` (
+`itemid` bigint(20) unsigned NOT NULL auto_increment,
+`sessionid` bigint(20) unsigned default NULL,
+`time` int(10) unsigned NOT NULL default '0',
+`type` set('A','D','E','F','G','I','L','N','U') collate latin1_general_ci NOT
+NULL default '',
+`data` text collate latin1_general_ci NOT NULL,
+PRIMARY KEY (`itemid`)
+) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+INSERT INTO `t1` VALUES (1, 1, 1, 'D', '');
+CREATE TABLE `t2` (
+`sessionid` bigint(20) unsigned NOT NULL auto_increment,
+`pid` int(10) unsigned NOT NULL default '0',
+`date` int(10) unsigned NOT NULL default '0',
+`ip` varchar(15) collate latin1_general_ci NOT NULL default '',
+PRIMARY KEY (`sessionid`)
+) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+INSERT INTO `t2` VALUES (1, 1, 1, '10.10.10.1');
+SELECT s.ip, count( e.itemid ) FROM `t1` e JOIN t2 s ON s.sessionid = e.sessionid WHERE e.sessionid = ( SELECT sessionid FROM t2 ORDER BY sessionid DESC LIMIT 1 ) GROUP BY s.ip HAVING count( e.itemid ) >0 LIMIT 0 , 30;
+ip count( e.itemid )
+10.10.10.1 1
+drop tables t1,t2;
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index 04f0de47e43..fccc7642eb0 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -660,3 +660,18 @@ select a from t1;
check table t1;
drop table t1;
set global concurrent_insert=@save_concurrent_insert;
+
+# BUG#9622 - ANALYZE TABLE and ALTER TABLE .. ENABLE INDEX produce
+# different statistics on the same table with NULL values.
+create table t1 (a int, key(a));
+
+insert into t1 values (1),(2),(3),(4),(NULL),(NULL),(NULL),(NULL);
+analyze table t1;
+show keys from t1;
+
+alter table t1 disable keys;
+alter table t1 enable keys;
+show keys from t1;
+
+drop table t1;
+
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index ceae60c4577..4af62fe3b01 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -215,3 +215,342 @@ INSERT INTO t1 VALUES (4),(5),(6);
--exec $MYSQL_DUMP --skip-comments --insert-ignore test t1
--exec $MYSQL_DUMP --skip-comments --insert-ignore --delayed-insert test t1
DROP TABLE t1;
+
+#
+# Bug #10286: mysqldump -c crashes on table that has many fields with long
+# names
+#
+create table t1 (
+ F_c4ca4238a0b923820dcc509a6f75849b int,
+ F_c81e728d9d4c2f636f067f89cc14862c int,
+ F_eccbc87e4b5ce2fe28308fd9f2a7baf3 int,
+ F_a87ff679a2f3e71d9181a67b7542122c int,
+ F_e4da3b7fbbce2345d7772b0674a318d5 int,
+ F_1679091c5a880faf6fb5e6087eb1b2dc int,
+ F_8f14e45fceea167a5a36dedd4bea2543 int,
+ F_c9f0f895fb98ab9159f51fd0297e236d int,
+ F_45c48cce2e2d7fbdea1afc51c7c6ad26 int,
+ F_d3d9446802a44259755d38e6d163e820 int,
+ F_6512bd43d9caa6e02c990b0a82652dca int,
+ F_c20ad4d76fe97759aa27a0c99bff6710 int,
+ F_c51ce410c124a10e0db5e4b97fc2af39 int,
+ F_aab3238922bcc25a6f606eb525ffdc56 int,
+ F_9bf31c7ff062936a96d3c8bd1f8f2ff3 int,
+ F_c74d97b01eae257e44aa9d5bade97baf int,
+ F_70efdf2ec9b086079795c442636b55fb int,
+ F_6f4922f45568161a8cdf4ad2299f6d23 int,
+ F_1f0e3dad99908345f7439f8ffabdffc4 int,
+ F_98f13708210194c475687be6106a3b84 int,
+ F_3c59dc048e8850243be8079a5c74d079 int,
+ F_b6d767d2f8ed5d21a44b0e5886680cb9 int,
+ F_37693cfc748049e45d87b8c7d8b9aacd int,
+ F_1ff1de774005f8da13f42943881c655f int,
+ F_8e296a067a37563370ded05f5a3bf3ec int,
+ F_4e732ced3463d06de0ca9a15b6153677 int,
+ F_02e74f10e0327ad868d138f2b4fdd6f0 int,
+ F_33e75ff09dd601bbe69f351039152189 int,
+ F_6ea9ab1baa0efb9e19094440c317e21b int,
+ F_34173cb38f07f89ddbebc2ac9128303f int,
+ F_c16a5320fa475530d9583c34fd356ef5 int,
+ F_6364d3f0f495b6ab9dcf8d3b5c6e0b01 int,
+ F_182be0c5cdcd5072bb1864cdee4d3d6e int,
+ F_e369853df766fa44e1ed0ff613f563bd int,
+ F_1c383cd30b7c298ab50293adfecb7b18 int,
+ F_19ca14e7ea6328a42e0eb13d585e4c22 int,
+ F_a5bfc9e07964f8dddeb95fc584cd965d int,
+ F_a5771bce93e200c36f7cd9dfd0e5deaa int,
+ F_d67d8ab4f4c10bf22aa353e27879133c int,
+ F_d645920e395fedad7bbbed0eca3fe2e0 int,
+ F_3416a75f4cea9109507cacd8e2f2aefc int,
+ F_a1d0c6e83f027327d8461063f4ac58a6 int,
+ F_17e62166fc8586dfa4d1bc0e1742c08b int,
+ F_f7177163c833dff4b38fc8d2872f1ec6 int,
+ F_6c8349cc7260ae62e3b1396831a8398f int,
+ F_d9d4f495e875a2e075a1a4a6e1b9770f int,
+ F_67c6a1e7ce56d3d6fa748ab6d9af3fd7 int,
+ F_642e92efb79421734881b53e1e1b18b6 int,
+ F_f457c545a9ded88f18ecee47145a72c0 int,
+ F_c0c7c76d30bd3dcaefc96f40275bdc0a int,
+ F_2838023a778dfaecdc212708f721b788 int,
+ F_9a1158154dfa42caddbd0694a4e9bdc8 int,
+ F_d82c8d1619ad8176d665453cfb2e55f0 int,
+ F_a684eceee76fc522773286a895bc8436 int,
+ F_b53b3a3d6ab90ce0268229151c9bde11 int,
+ F_9f61408e3afb633e50cdf1b20de6f466 int,
+ F_72b32a1f754ba1c09b3695e0cb6cde7f int,
+ F_66f041e16a60928b05a7e228a89c3799 int,
+ F_093f65e080a295f8076b1c5722a46aa2 int,
+ F_072b030ba126b2f4b2374f342be9ed44 int,
+ F_7f39f8317fbdb1988ef4c628eba02591 int,
+ F_44f683a84163b3523afe57c2e008bc8c int,
+ F_03afdbd66e7929b125f8597834fa83a4 int,
+ F_ea5d2f1c4608232e07d3aa3d998e5135 int,
+ F_fc490ca45c00b1249bbe3554a4fdf6fb int,
+ F_3295c76acbf4caaed33c36b1b5fc2cb1 int,
+ F_735b90b4568125ed6c3f678819b6e058 int,
+ F_a3f390d88e4c41f2747bfa2f1b5f87db int,
+ F_14bfa6bb14875e45bba028a21ed38046 int,
+ F_7cbbc409ec990f19c78c75bd1e06f215 int,
+ F_e2c420d928d4bf8ce0ff2ec19b371514 int,
+ F_32bb90e8976aab5298d5da10fe66f21d int,
+ F_d2ddea18f00665ce8623e36bd4e3c7c5 int,
+ F_ad61ab143223efbc24c7d2583be69251 int,
+ F_d09bf41544a3365a46c9077ebb5e35c3 int,
+ F_fbd7939d674997cdb4692d34de8633c4 int,
+ F_28dd2c7955ce926456240b2ff0100bde int,
+ F_35f4a8d465e6e1edc05f3d8ab658c551 int,
+ F_d1fe173d08e959397adf34b1d77e88d7 int,
+ F_f033ab37c30201f73f142449d037028d int,
+ F_43ec517d68b6edd3015b3edc9a11367b int,
+ F_9778d5d219c5080b9a6a17bef029331c int,
+ F_fe9fc289c3ff0af142b6d3bead98a923 int,
+ F_68d30a9594728bc39aa24be94b319d21 int,
+ F_3ef815416f775098fe977004015c6193 int,
+ F_93db85ed909c13838ff95ccfa94cebd9 int,
+ F_c7e1249ffc03eb9ded908c236bd1996d int,
+ F_2a38a4a9316c49e5a833517c45d31070 int,
+ F_7647966b7343c29048673252e490f736 int,
+ F_8613985ec49eb8f757ae6439e879bb2a int,
+ F_54229abfcfa5649e7003b83dd4755294 int,
+ F_92cc227532d17e56e07902b254dfad10 int,
+ F_98dce83da57b0395e163467c9dae521b int,
+ F_f4b9ec30ad9f68f89b29639786cb62ef int,
+ F_812b4ba287f5ee0bc9d43bbf5bbe87fb int,
+ F_26657d5ff9020d2abefe558796b99584 int,
+ F_e2ef524fbf3d9fe611d5a8e90fefdc9c int,
+ F_ed3d2c21991e3bef5e069713af9fa6ca int,
+ F_ac627ab1ccbdb62ec96e702f07f6425b int,
+ F_f899139df5e1059396431415e770c6dd int,
+ F_38b3eff8baf56627478ec76a704e9b52 int,
+ F_ec8956637a99787bd197eacd77acce5e int,
+ F_6974ce5ac660610b44d9b9fed0ff9548 int,
+ F_c9e1074f5b3f9fc8ea15d152add07294 int,
+ F_65b9eea6e1cc6bb9f0cd2a47751a186f int,
+ F_f0935e4cd5920aa6c7c996a5ee53a70f int,
+ F_a97da629b098b75c294dffdc3e463904 int,
+ F_a3c65c2974270fd093ee8a9bf8ae7d0b int,
+ F_2723d092b63885e0d7c260cc007e8b9d int,
+ F_5f93f983524def3dca464469d2cf9f3e int,
+ F_698d51a19d8a121ce581499d7b701668 int,
+ F_7f6ffaa6bb0b408017b62254211691b5 int,
+ F_73278a4a86960eeb576a8fd4c9ec6997 int,
+ F_5fd0b37cd7dbbb00f97ba6ce92bf5add int,
+ F_2b44928ae11fb9384c4cf38708677c48 int,
+ F_c45147dee729311ef5b5c3003946c48f int,
+ F_eb160de1de89d9058fcb0b968dbbbd68 int,
+ F_5ef059938ba799aaa845e1c2e8a762bd int,
+ F_07e1cd7dca89a1678042477183b7ac3f int,
+ F_da4fb5c6e93e74d3df8527599fa62642 int,
+ F_4c56ff4ce4aaf9573aa5dff913df997a int,
+ F_a0a080f42e6f13b3a2df133f073095dd int,
+ F_202cb962ac59075b964b07152d234b70 int,
+ F_c8ffe9a587b126f152ed3d89a146b445 int,
+ F_3def184ad8f4755ff269862ea77393dd int,
+ F_069059b7ef840f0c74a814ec9237b6ec int,
+ F_ec5decca5ed3d6b8079e2e7e7bacc9f2 int,
+ F_76dc611d6ebaafc66cc0879c71b5db5c int,
+ F_d1f491a404d6854880943e5c3cd9ca25 int,
+ F_9b8619251a19057cff70779273e95aa6 int,
+ F_1afa34a7f984eeabdbb0a7d494132ee5 int,
+ F_65ded5353c5ee48d0b7d48c591b8f430 int,
+ F_9fc3d7152ba9336a670e36d0ed79bc43 int,
+ F_02522a2b2726fb0a03bb19f2d8d9524d int,
+ F_7f1de29e6da19d22b51c68001e7e0e54 int,
+ F_42a0e188f5033bc65bf8d78622277c4e int,
+ F_3988c7f88ebcb58c6ce932b957b6f332 int,
+ F_013d407166ec4fa56eb1e1f8cbe183b9 int,
+ F_e00da03b685a0dd18fb6a08af0923de0 int,
+ F_1385974ed5904a438616ff7bdb3f7439 int,
+ F_0f28b5d49b3020afeecd95b4009adf4c int,
+ F_a8baa56554f96369ab93e4f3bb068c22 int,
+ F_903ce9225fca3e988c2af215d4e544d3 int,
+ F_0a09c8844ba8f0936c20bd791130d6b6 int,
+ F_2b24d495052a8ce66358eb576b8912c8 int,
+ F_a5e00132373a7031000fd987a3c9f87b int,
+ F_8d5e957f297893487bd98fa830fa6413 int,
+ F_47d1e990583c9c67424d369f3414728e int,
+ F_f2217062e9a397a1dca429e7d70bc6ca int,
+ F_7ef605fc8dba5425d6965fbd4c8fbe1f int,
+ F_a8f15eda80c50adb0e71943adc8015cf int,
+ F_37a749d808e46495a8da1e5352d03cae int,
+ F_b3e3e393c77e35a4a3f3cbd1e429b5dc int,
+ F_1d7f7abc18fcb43975065399b0d1e48e int,
+ F_2a79ea27c279e471f4d180b08d62b00a int,
+ F_1c9ac0159c94d8d0cbedc973445af2da int,
+ F_6c4b761a28b734fe93831e3fb400ce87 int,
+ F_06409663226af2f3114485aa4e0a23b4 int,
+ F_140f6969d5213fd0ece03148e62e461e int,
+ F_b73ce398c39f506af761d2277d853a92 int,
+ F_bd4c9ab730f5513206b999ec0d90d1fb int,
+ F_82aa4b0af34c2313a562076992e50aa3 int,
+ F_0777d5c17d4066b82ab86dff8a46af6f int,
+ F_fa7cdfad1a5aaf8370ebeda47a1ff1c3 int,
+ F_9766527f2b5d3e95d4a733fcfb77bd7e int,
+ F_7e7757b1e12abcb736ab9a754ffb617a int,
+ F_5878a7ab84fb43402106c575658472fa int,
+ F_006f52e9102a8d3be2fe5614f42ba989 int,
+ F_3636638817772e42b59d74cff571fbb3 int,
+ F_149e9677a5989fd342ae44213df68868 int,
+ F_a4a042cf4fd6bfb47701cbc8a1653ada int,
+ F_1ff8a7b5dc7a7d1f0ed65aaa29c04b1e int,
+ F_f7e6c85504ce6e82442c770f7c8606f0 int,
+ F_bf8229696f7a3bb4700cfddef19fa23f int,
+ F_82161242827b703e6acf9c726942a1e4 int,
+ F_38af86134b65d0f10fe33d30dd76442e int,
+ F_96da2f590cd7246bbde0051047b0d6f7 int,
+ F_8f85517967795eeef66c225f7883bdcb int,
+ F_8f53295a73878494e9bc8dd6c3c7104f int,
+ F_045117b0e0a11a242b9765e79cbf113f int,
+ F_fc221309746013ac554571fbd180e1c8 int,
+ F_4c5bde74a8f110656874902f07378009 int,
+ F_cedebb6e872f539bef8c3f919874e9d7 int,
+ F_6cdd60ea0045eb7a6ec44c54d29ed402 int,
+ F_eecca5b6365d9607ee5a9d336962c534 int,
+ F_9872ed9fc22fc182d371c3e9ed316094 int,
+ F_31fefc0e570cb3860f2a6d4b38c6490d int,
+ F_9dcb88e0137649590b755372b040afad int,
+ F_a2557a7b2e94197ff767970b67041697 int,
+ F_cfecdb276f634854f3ef915e2e980c31 int,
+ F_0aa1883c6411f7873cb83dacb17b0afc int,
+ F_58a2fc6ed39fd083f55d4182bf88826d int,
+ F_bd686fd640be98efaae0091fa301e613 int,
+ F_a597e50502f5ff68e3e25b9114205d4a int,
+ F_0336dcbab05b9d5ad24f4333c7658a0e int,
+ F_084b6fbb10729ed4da8c3d3f5a3ae7c9 int,
+ F_85d8ce590ad8981ca2c8286f79f59954 int,
+ F_0e65972dce68dad4d52d063967f0a705 int,
+ F_84d9ee44e457ddef7f2c4f25dc8fa865 int,
+ F_3644a684f98ea8fe223c713b77189a77 int,
+ F_757b505cfd34c64c85ca5b5690ee5293 int,
+ F_854d6fae5ee42911677c739ee1734486 int,
+ F_e2c0be24560d78c5e599c2a9c9d0bbd2 int,
+ F_274ad4786c3abca69fa097b85867d9a4 int,
+ F_eae27d77ca20db309e056e3d2dcd7d69 int,
+ F_7eabe3a1649ffa2b3ff8c02ebfd5659f int,
+ F_69adc1e107f7f7d035d7baf04342e1ca int,
+ F_091d584fced301b442654dd8c23b3fc9 int,
+ F_b1d10e7bafa4421218a51b1e1f1b0ba2 int,
+ F_6f3ef77ac0e3619e98159e9b6febf557 int,
+ F_eb163727917cbba1eea208541a643e74 int,
+ F_1534b76d325a8f591b52d302e7181331 int,
+ F_979d472a84804b9f647bc185a877a8b5 int,
+ F_ca46c1b9512a7a8315fa3c5a946e8265 int,
+ F_3b8a614226a953a8cd9526fca6fe9ba5 int,
+ F_45fbc6d3e05ebd93369ce542e8f2322d int,
+ F_63dc7ed1010d3c3b8269faf0ba7491d4 int,
+ F_e96ed478dab8595a7dbda4cbcbee168f int,
+ F_c0e190d8267e36708f955d7ab048990d int,
+ F_ec8ce6abb3e952a85b8551ba726a1227 int,
+ F_060ad92489947d410d897474079c1477 int,
+ F_bcbe3365e6ac95ea2c0343a2395834dd int,
+ F_115f89503138416a242f40fb7d7f338e int,
+ F_13fe9d84310e77f13a6d184dbf1232f3 int,
+ F_d1c38a09acc34845c6be3a127a5aacaf int,
+ F_9cfdf10e8fc047a44b08ed031e1f0ed1 int,
+ F_705f2172834666788607efbfca35afb3 int,
+ F_74db120f0a8e5646ef5a30154e9f6deb int,
+ F_57aeee35c98205091e18d1140e9f38cf int,
+ F_6da9003b743b65f4c0ccd295cc484e57 int,
+ F_9b04d152845ec0a378394003c96da594 int,
+ F_be83ab3ecd0db773eb2dc1b0a17836a1 int,
+ F_e165421110ba03099a1c0393373c5b43 int,
+ F_289dff07669d7a23de0ef88d2f7129e7 int,
+ F_577ef1154f3240ad5b9b413aa7346a1e int,
+ F_01161aaa0b6d1345dd8fe4e481144d84 int,
+ F_539fd53b59e3bb12d203f45a912eeaf2 int,
+ F_ac1dd209cbcc5e5d1c6e28598e8cbbe8 int,
+ F_555d6702c950ecb729a966504af0a635 int,
+ F_335f5352088d7d9bf74191e006d8e24c int,
+ F_f340f1b1f65b6df5b5e3f94d95b11daf int,
+ F_e4a6222cdb5b34375400904f03d8e6a5 int,
+ F_cb70ab375662576bd1ac5aaf16b3fca4 int,
+ F_9188905e74c28e489b44e954ec0b9bca int,
+ F_0266e33d3f546cb5436a10798e657d97 int,
+ F_38db3aed920cf82ab059bfccbd02be6a int,
+ F_3cec07e9ba5f5bb252d13f5f431e4bbb int,
+ F_621bf66ddb7c962aa0d22ac97d69b793 int,
+ F_077e29b11be80ab57e1a2ecabb7da330 int,
+ F_6c9882bbac1c7093bd25041881277658 int,
+ F_19f3cd308f1455b3fa09a282e0d496f4 int,
+ F_03c6b06952c750899bb03d998e631860 int,
+ F_c24cd76e1ce41366a4bbe8a49b02a028 int,
+ F_c52f1bd66cc19d05628bd8bf27af3ad6 int,
+ F_fe131d7f5a6b38b23cc967316c13dae2 int,
+ F_f718499c1c8cef6730f9fd03c8125cab int,
+ F_d96409bf894217686ba124d7356686c9 int,
+ F_502e4a16930e414107ee22b6198c578f int,
+ F_cfa0860e83a4c3a763a7e62d825349f7 int,
+ F_a4f23670e1833f3fdb077ca70bbd5d66 int,
+ F_b1a59b315fc9a3002ce38bbe070ec3f5 int,
+ F_36660e59856b4de58a219bcf4e27eba3 int,
+ F_8c19f571e251e61cb8dd3612f26d5ecf int,
+ F_d6baf65e0b240ce177cf70da146c8dc8 int,
+ F_e56954b4f6347e897f954495eab16a88 int,
+ F_f7664060cc52bc6f3d620bcedc94a4b6 int,
+ F_eda80a3d5b344bc40f3bc04f65b7a357 int,
+ F_8f121ce07d74717e0b1f21d122e04521 int,
+ F_06138bc5af6023646ede0e1f7c1eac75 int,
+ F_39059724f73a9969845dfe4146c5660e int,
+ F_7f100b7b36092fb9b06dfb4fac360931 int,
+ F_7a614fd06c325499f1680b9896beedeb int,
+ F_4734ba6f3de83d861c3176a6273cac6d int,
+ F_d947bf06a885db0d477d707121934ff8 int,
+ F_63923f49e5241343aa7acb6a06a751e7 int,
+ F_db8e1af0cb3aca1ae2d0018624204529 int,
+ F_20f07591c6fcb220ffe637cda29bb3f6 int,
+ F_07cdfd23373b17c6b337251c22b7ea57 int,
+ F_d395771085aab05244a4fb8fd91bf4ee int,
+ F_92c8c96e4c37100777c7190b76d28233 int,
+ F_e3796ae838835da0b6f6ea37bcf8bcb7 int,
+ F_6a9aeddfc689c1d0e3b9ccc3ab651bc5 int,
+ F_0f49c89d1e7298bb9930789c8ed59d48 int,
+ F_46ba9f2a6976570b0353203ec4474217 int,
+ F_0e01938fc48a2cfb5f2217fbfb00722d int,
+ F_16a5cdae362b8d27a1d8f8c7b78b4330 int,
+ F_918317b57931b6b7a7d29490fe5ec9f9 int,
+ F_48aedb8880cab8c45637abc7493ecddd int,
+ F_839ab46820b524afda05122893c2fe8e int,
+ F_f90f2aca5c640289d0a29417bcb63a37 int,
+ F_9c838d2e45b2ad1094d42f4ef36764f6 int,
+ F_1700002963a49da13542e0726b7bb758 int,
+ F_53c3bce66e43be4f209556518c2fcb54 int,
+ F_6883966fd8f918a4aa29be29d2c386fb int,
+ F_49182f81e6a13cf5eaa496d51fea6406 int,
+ F_d296c101daa88a51f6ca8cfc1ac79b50 int,
+ F_9fd81843ad7f202f26c1a174c7357585 int,
+ F_26e359e83860db1d11b6acca57d8ea88 int,
+ F_ef0d3930a7b6c95bd2b32ed45989c61f int,
+ F_94f6d7e04a4d452035300f18b984988c int,
+ F_34ed066df378efacc9b924ec161e7639 int,
+ F_577bcc914f9e55d5e4e4f82f9f00e7d4 int,
+ F_11b9842e0a271ff252c1903e7132cd68 int,
+ F_37bc2f75bf1bcfe8450a1a41c200364c int,
+ F_496e05e1aea0a9c4655800e8a7b9ea28 int,
+ F_b2eb7349035754953b57a32e2841bda5 int,
+ F_8e98d81f8217304975ccb23337bb5761 int,
+ F_a8c88a0055f636e4a163a5e3d16adab7 int,
+ F_eddea82ad2755b24c4e168c5fc2ebd40 int,
+ F_06eb61b839a0cefee4967c67ccb099dc int,
+ F_9dfcd5e558dfa04aaf37f137a1d9d3e5 int,
+ F_950a4152c2b4aa3ad78bdd6b366cc179 int,
+ F_158f3069a435b314a80bdcb024f8e422 int,
+ F_758874998f5bd0c393da094e1967a72b int,
+ F_ad13a2a07ca4b7642959dc0c4c740ab6 int,
+ F_3fe94a002317b5f9259f82690aeea4cd int,
+ F_5b8add2a5d98b1a652ea7fd72d942dac int,
+ F_432aca3a1e345e339f35a30c8f65edce int,
+ F_8d3bba7425e7c98c50f52ca1b52d3735 int,
+ F_320722549d1751cf3f247855f937b982 int,
+ F_caf1a3dfb505ffed0d024130f58c5cfa int,
+ F_5737c6ec2e0716f3d8a7a5c4e0de0d9a int,
+ F_bc6dc48b743dc5d013b1abaebd2faed2 int,
+ F_f2fc990265c712c49d51a18a32b39f0c int,
+ F_89f0fd5c927d466d6ec9a21b9ac34ffa int,
+ F_a666587afda6e89aec274a3657558a27 int,
+ F_b83aac23b9528732c23cc7352950e880 int,
+ F_cd00692c3bfe59267d5ecfac5310286c int,
+ F_6faa8040da20ef399b63a72d0e4ab575 int,
+ F_fe73f687e5bc5280214e0486b273a5f9 int);
+insert into t1 (F_8d3bba7425e7c98c50f52ca1b52d3735) values (1);
+--exec $MYSQL_DUMP --skip-comments -c test
+drop table t1;
diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test
index 378f195406b..88f778be4d5 100644
--- a/mysql-test/t/olap.test
+++ b/mysql-test/t/olap.test
@@ -196,3 +196,27 @@ SELECT * FROM ( SELECT a, SUM(a) m FROM t1 GROUP BY a WITH ROLLUP ) t2;
DROP TABLE t1;
set div_precision_increment= @sav_dpi;
+
+#
+# Tests for bug #7914: ROLLUP over expressions on temporary table
+#
+
+CREATE TABLE t1 (a int(11));
+INSERT INTO t1 VALUES (1),(2);
+
+SELECT a, SUM(a), SUM(a)+1 FROM (SELECT a FROM t1 UNION select 2) d
+ GROUP BY a;
+SELECT a, SUM(a), SUM(a)+1 FROM (SELECT a FROM t1 UNION select 2) d
+ GROUP BY a WITH ROLLUP;
+
+SELECT a, SUM(a), SUM(a)+1 FROM (SELECT 1 a UNION select 2) d
+ GROUP BY a;
+SELECT a, SUM(a), SUM(a)+1 FROM (SELECT 1 a UNION select 2) d
+ GROUP BY a WITH ROLLUP;
+
+SELECT a, SUM(a), SUM(a)+1, CONCAT(SUM(a),'x'), SUM(a)+SUM(a), SUM(a)
+ FROM (SELECT 1 a, 2 b UNION SELECT 2,3 UNION SELECT 5,6 ) d
+ GROUP BY a WITH ROLLUP;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test
index 5d5f845e2bc..12759d9edb5 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -1,5 +1,3 @@
--- source include/have_innodb.inc
-
#
# Problem with range optimizer
#
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index fe7cd42995d..c58a9f9de8e 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -1799,3 +1799,26 @@ SELECT c1,c2 FROM t1 LEFT JOIN t2 ON c1 = c2
DROP TABLE t1,t2,t3;
+#
+# Item_int_with_ref check (BUG#10020)
+#
+CREATE TABLE `t1` (
+ `itemid` bigint(20) unsigned NOT NULL auto_increment,
+ `sessionid` bigint(20) unsigned default NULL,
+ `time` int(10) unsigned NOT NULL default '0',
+ `type` set('A','D','E','F','G','I','L','N','U') collate latin1_general_ci NOT
+NULL default '',
+ `data` text collate latin1_general_ci NOT NULL,
+ PRIMARY KEY (`itemid`)
+) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+INSERT INTO `t1` VALUES (1, 1, 1, 'D', '');
+CREATE TABLE `t2` (
+ `sessionid` bigint(20) unsigned NOT NULL auto_increment,
+ `pid` int(10) unsigned NOT NULL default '0',
+ `date` int(10) unsigned NOT NULL default '0',
+ `ip` varchar(15) collate latin1_general_ci NOT NULL default '',
+ PRIMARY KEY (`sessionid`)
+) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+INSERT INTO `t2` VALUES (1, 1, 1, '10.10.10.1');
+SELECT s.ip, count( e.itemid ) FROM `t1` e JOIN t2 s ON s.sessionid = e.sessionid WHERE e.sessionid = ( SELECT sessionid FROM t2 ORDER BY sessionid DESC LIMIT 1 ) GROUP BY s.ip HAVING count( e.itemid ) >0 LIMIT 0 , 30;
+drop tables t1,t2;
diff --git a/ndb/src/common/util/version.c b/ndb/src/common/util/version.c
index dfbb1e4a2e6..3157f3bc356 100644
--- a/ndb/src/common/util/version.c
+++ b/ndb/src/common/util/version.c
@@ -91,6 +91,8 @@ void ndbSetOwnVersion() {}
#ifndef TEST_VERSION
struct NdbUpGradeCompatible ndbCompatibleTable_full[] = {
{ MAKE_VERSION(5,0,3), MAKE_VERSION(5,0,2), UG_Exact },
+ { MAKE_VERSION(4,1,12), MAKE_VERSION(4,1,10), UG_Range },
+ { MAKE_VERSION(4,1,10), MAKE_VERSION(4,1,9), UG_Exact },
{ MAKE_VERSION(4,1,9), MAKE_VERSION(4,1,8), UG_Exact },
{ MAKE_VERSION(3,5,2), MAKE_VERSION(3,5,1), UG_Exact },
{ 0, 0, UG_Null }
diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c
index be9e5084a47..840d358f225 100644
--- a/ndb/src/ndbapi/ndberror.c
+++ b/ndb/src/ndbapi/ndberror.c
@@ -330,8 +330,8 @@ ErrorBundle ErrorCodes[] = {
{ 703, SE, "Invalid table format" },
{ 704, SE, "Attribute name too long" },
{ 705, SE, "Table name too long" },
- { 707, SE, "No more table metadata records" },
- { 708, SE, "No more attribute metadata records" },
+ { 707, SE, "No more table metadata records (increase MaxNoOfTables)" },
+ { 708, SE, "No more attribute metadata records (increase MaxNoOfAttributes)" },
{ 709, SE, "No such table existed" },
{ 721, OE, "Table or index with given name already exists" },
{ 723, SE, "No such table existed" },
diff --git a/sql/item.cc b/sql/item.cc
index 5f215c29578..aacf2f8cbdd 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -3554,7 +3554,7 @@ bool Item_int::eq(const Item *arg, bool binary_cmp) const
Item *Item_int_with_ref::new_item()
{
- DBUG_ASSERT(ref->basic_const_item());
+ DBUG_ASSERT(ref->const_item());
/*
We need to evaluate the constant to make sure it works with
parameter markers.
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index e6d6db05242..99373276410 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1320,7 +1320,7 @@ JOIN::exec()
}
curr_all_fields= &tmp_all_fields1;
curr_fields_list= &tmp_fields_list1;
- set_items_ref_array(items1);
+ curr_join->set_items_ref_array(items1);
if (sort_and_group || curr_tmp_table->group)
{
@@ -1455,7 +1455,7 @@ JOIN::exec()
}
curr_fields_list= &curr_join->tmp_fields_list2;
curr_all_fields= &curr_join->tmp_all_fields2;
- set_items_ref_array(items2);
+ curr_join->set_items_ref_array(items2);
curr_join->tmp_table_param.field_count+=
curr_join->tmp_table_param.sum_func_count;
curr_join->tmp_table_param.sum_func_count= 0;
@@ -1516,7 +1516,7 @@ JOIN::exec()
}
curr_fields_list= &tmp_fields_list3;
curr_all_fields= &tmp_all_fields3;
- set_items_ref_array(items3);
+ curr_join->set_items_ref_array(items3);
if (curr_join->make_sum_func_list(*curr_all_fields, *curr_fields_list,
1, TRUE) ||