Commit 02dacd20 authored by mhansson@dl145s.mysql.com's avatar mhansson@dl145s.mysql.com

Merge mhansson@bk-internal:/home/bk/mysql-5.1-opt

into  dl145s.mysql.com:/data0/mhansson/bug30942/my51-bug30942
parents eb8d5c36 16c07b16
...@@ -80,6 +80,6 @@ enum options_client ...@@ -80,6 +80,6 @@ enum options_client
OPT_MYSQL_REPLACE_INTO, OPT_BASE64_OUTPUT, OPT_SERVER_ID, OPT_MYSQL_REPLACE_INTO, OPT_BASE64_OUTPUT, OPT_SERVER_ID,
OPT_FIX_TABLE_NAMES, OPT_FIX_DB_NAMES, OPT_SSL_VERIFY_SERVER_CERT, OPT_FIX_TABLE_NAMES, OPT_FIX_DB_NAMES, OPT_SSL_VERIFY_SERVER_CERT,
OPT_DEBUG_INFO, OPT_DEBUG_CHECK, OPT_COLUMN_TYPES, OPT_ERROR_LOG_FILE, OPT_DEBUG_INFO, OPT_DEBUG_CHECK, OPT_COLUMN_TYPES, OPT_ERROR_LOG_FILE,
OPT_DUMP_DATE, OPT_WRITE_BINLOG, OPT_DUMP_DATE,
OPT_WRITE_BINLOG, OPT_MAX_CLIENT_OPTION OPT_MAX_CLIENT_OPTION
}; };
...@@ -1470,6 +1470,10 @@ f7 datetime NO NULL ...@@ -1470,6 +1470,10 @@ f7 datetime NO NULL
f8 datetime YES 2006-01-01 00:00:00 f8 datetime YES 2006-01-01 00:00:00
drop table t1; drop table t1;
End of 5.0 tests. End of 5.0 tests.
show fields from information_schema.TABLE_NAMES;
ERROR 42S02: Unknown table 'TABLE_NAMES' in information_schema
show keys from information_schema.TABLE_NAMES;
ERROR 42S02: Unknown table 'TABLE_NAMES' in information_schema
select * from information_schema.engines WHERE ENGINE="MyISAM"; select * from information_schema.engines WHERE ENGINE="MyISAM";
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
MyISAM DEFAULT Default engine as of MySQL 3.23 with great performance NO NO NO MyISAM DEFAULT Default engine as of MySQL 3.23 with great performance NO NO NO
......
...@@ -715,3 +715,14 @@ a SUM(a) ...@@ -715,3 +715,14 @@ a SUM(a)
4 4 4 4
NULL 14 NULL 14
DROP TABLE t1; DROP TABLE t1;
#
# Bug#31095: Unexpected NULL constant caused server crash.
#
create table t1(a int);
insert into t1 values (1),(2),(3);
select count(a) from t1 group by null with rollup;
count(a)
3
3
drop table t1;
##############################################################
...@@ -1090,6 +1090,15 @@ show columns from t1; ...@@ -1090,6 +1090,15 @@ show columns from t1;
drop table t1; drop table t1;
--echo End of 5.0 tests. --echo End of 5.0 tests.
#
# Bug#30079 A check for "hidden" I_S tables is flawed
#
--error 1109
show fields from information_schema.TABLE_NAMES;
--error 1109
show keys from information_schema.TABLE_NAMES;
# #
# Show engines # Show engines
# #
......
...@@ -358,3 +358,12 @@ SELECT * FROM (SELECT a, SUM(a) FROM t1 GROUP BY a WITH ROLLUP) as t; ...@@ -358,3 +358,12 @@ SELECT * FROM (SELECT a, SUM(a) FROM t1 GROUP BY a WITH ROLLUP) as t;
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # Bug#31095: Unexpected NULL constant caused server crash.
--echo #
create table t1(a int);
insert into t1 values (1),(2),(3);
select count(a) from t1 group by null with rollup;
drop table t1;
--echo ##############################################################
...@@ -756,6 +756,8 @@ public: ...@@ -756,6 +756,8 @@ public:
collation= args[0]->collation; collation= args[0]->collation;
max_length= args[0]->max_length; max_length= args[0]->max_length;
decimals=args[0]->decimals; decimals=args[0]->decimals;
/* The item could be a NULL constant. */
null_value= args[0]->null_value;
} }
}; };
......
...@@ -5766,7 +5766,12 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd, ...@@ -5766,7 +5766,12 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
ST_SCHEMA_TABLE *schema_table= find_schema_table(thd, ptr->table_name); ST_SCHEMA_TABLE *schema_table= find_schema_table(thd, ptr->table_name);
if (!schema_table || if (!schema_table ||
(schema_table->hidden && (schema_table->hidden &&
(sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND) == 0)) ((sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND) == 0 ||
/*
this check is used for show columns|keys from I_S hidden table
*/
lex->sql_command == SQLCOM_SHOW_FIELDS ||
lex->sql_command == SQLCOM_SHOW_KEYS)))
{ {
my_error(ER_UNKNOWN_TABLE, MYF(0), my_error(ER_UNKNOWN_TABLE, MYF(0),
ptr->table_name, INFORMATION_SCHEMA_NAME.str); ptr->table_name, INFORMATION_SCHEMA_NAME.str);
......
...@@ -16035,13 +16035,15 @@ static void test_bug21635() ...@@ -16035,13 +16035,15 @@ static void test_bug21635()
{ {
field= mysql_fetch_field_direct(result, i); field= mysql_fetch_field_direct(result, i);
if (!opt_silent) if (!opt_silent)
printf("%s -> %s ... ", expr[i * 2], field->name); if (!opt_silent)
printf("%s -> %s ... ", expr[i * 2], field->name);
fflush(stdout); fflush(stdout);
DIE_UNLESS(field->db[0] == 0 && field->org_table[0] == 0 && DIE_UNLESS(field->db[0] == 0 && field->org_table[0] == 0 &&
field->table[0] == 0 && field->org_name[0] == 0); field->table[0] == 0 && field->org_name[0] == 0);
DIE_UNLESS(strcmp(field->name, expr[i * 2 + 1]) == 0); DIE_UNLESS(strcmp(field->name, expr[i * 2 + 1]) == 0);
if (!opt_silent) if (!opt_silent)
puts("OK"); if (!opt_silent)
puts("OK");
} }
mysql_free_result(result); mysql_free_result(result);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment