Commit d9732be2 authored by unknown's avatar unknown

Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0

into  mysql.com:/usr/home/bar/mysql-5.0

parents b2c77079 48c3c329
...@@ -979,3 +979,14 @@ WHERE TABLE_SCHEMA='test' AND TABLE_TYPE='BASE TABLE'); ...@@ -979,3 +979,14 @@ WHERE TABLE_SCHEMA='test' AND TABLE_TYPE='BASE TABLE');
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MyISAM 10 Fixed 0 0 0 # 1024 0 NULL # # NULL latin1_swedish_ci NULL t1 MyISAM 10 Fixed 0 0 0 # 1024 0 NULL # # NULL latin1_swedish_ci NULL
t2 MyISAM 10 Fixed 0 0 0 # 1024 0 NULL # # NULL latin1_swedish_ci NULL t2 MyISAM 10 Fixed 0 0 0 # 1024 0 NULL # # NULL latin1_swedish_ci NULL
DROP TABLE t1,t2;
create table t1(f1 int);
create view v1 (c) as select f1 from t1;
select database();
database()
NULL
show fields from test.v1;
Field Type Null Key Default Extra
c int(11) YES NULL
drop view v1;
drop table t1;
...@@ -545,3 +545,10 @@ select @@max_heap_table_size > 0; ...@@ -545,3 +545,10 @@ select @@max_heap_table_size > 0;
select @@have_innodb; select @@have_innodb;
@@have_innodb @@have_innodb
# #
select @@character_set_system;
@@character_set_system
utf8
set global character_set_system = latin1;
ERROR HY000: Variable 'character_set_system' is a read only variable
set @@global.version_compile_os='234';
ERROR HY000: Variable 'version_compile_os' is a read only variable
...@@ -665,4 +665,16 @@ SHOW TABLE STATUS FROM test ...@@ -665,4 +665,16 @@ SHOW TABLE STATUS FROM test
WHERE name IN ( SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE name IN ( SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA='test' AND TABLE_TYPE='BASE TABLE'); WHERE TABLE_SCHEMA='test' AND TABLE_TYPE='BASE TABLE');
DROP TABLE t1,t2 DROP TABLE t1,t2;
#
# Bug #12905 show fields from view behaving erratically with current database
#
create table t1(f1 int);
create view v1 (c) as select f1 from t1;
connect (con5,localhost,root,,*NO-ONE*);
select database();
show fields from test.v1;
connection default;
drop view v1;
drop table t1;
...@@ -435,3 +435,12 @@ select @@max_heap_table_size > 0; ...@@ -435,3 +435,12 @@ select @@max_heap_table_size > 0;
--replace_column 1 # --replace_column 1 #
select @@have_innodb; select @@have_innodb;
#
# Bug #11775 Variable character_set_system does not exist (sometimes)
#
select @@character_set_system;
--error 1238
set global character_set_system = latin1;
--error 1238
set @@global.version_compile_os='234';
...@@ -142,11 +142,8 @@ sys_var_long_ptr sys_binlog_cache_size("binlog_cache_size", ...@@ -142,11 +142,8 @@ sys_var_long_ptr sys_binlog_cache_size("binlog_cache_size",
sys_var_thd_ulong sys_bulk_insert_buff_size("bulk_insert_buffer_size", sys_var_thd_ulong sys_bulk_insert_buff_size("bulk_insert_buffer_size",
&SV::bulk_insert_buff_size); &SV::bulk_insert_buff_size);
sys_var_character_set_server sys_character_set_server("character_set_server"); sys_var_character_set_server sys_character_set_server("character_set_server");
sys_var_str sys_charset_system("character_set_system", sys_var_const_str sys_charset_system("character_set_system",
sys_check_charset, (char *)my_charset_utf8_general_ci.name);
sys_update_charset,
sys_set_default_charset,
(char *)my_charset_utf8_general_ci.name);
sys_var_character_set_database sys_character_set_database("character_set_database"); sys_var_character_set_database sys_character_set_database("character_set_database");
sys_var_character_set_client sys_character_set_client("character_set_client"); sys_var_character_set_client sys_character_set_client("character_set_client");
sys_var_character_set_connection sys_character_set_connection("character_set_connection"); sys_var_character_set_connection sys_character_set_connection("character_set_connection");
...@@ -569,6 +566,7 @@ sys_var *sys_variables[]= ...@@ -569,6 +566,7 @@ sys_var *sys_variables[]=
&sys_character_set_client, &sys_character_set_client,
&sys_character_set_connection, &sys_character_set_connection,
&sys_character_set_results, &sys_character_set_results,
&sys_charset_system,
&sys_collation_connection, &sys_collation_connection,
&sys_collation_database, &sys_collation_database,
&sys_collation_server, &sys_collation_server,
...@@ -1117,27 +1115,6 @@ static void sys_default_ftb_syntax(THD *thd, enum_var_type type) ...@@ -1117,27 +1115,6 @@ static void sys_default_ftb_syntax(THD *thd, enum_var_type type)
sizeof(ft_boolean_syntax)-1); sizeof(ft_boolean_syntax)-1);
} }
/*
The following 3 functions need to be changed in 4.1 when we allow
one to change character sets
*/
static int sys_check_charset(THD *thd, set_var *var)
{
return 0;
}
static bool sys_update_charset(THD *thd, set_var *var)
{
return 0;
}
static void sys_set_default_charset(THD *thd, enum_var_type type)
{
}
/* /*
If one sets the LOW_PRIORIY UPDATES flag, we also must change the If one sets the LOW_PRIORIY UPDATES flag, we also must change the
......
...@@ -190,6 +190,7 @@ public: ...@@ -190,6 +190,7 @@ public:
return 1; return 1;
} }
bool check_default(enum_var_type type) { return 1; } bool check_default(enum_var_type type) { return 1; }
bool is_readonly() const { return 1; }
}; };
...@@ -900,7 +901,7 @@ int sql_set_variables(THD *thd, List<set_var_base> *var_list); ...@@ -900,7 +901,7 @@ int sql_set_variables(THD *thd, List<set_var_base> *var_list);
bool not_all_support_one_shot(List<set_var_base> *var_list); bool not_all_support_one_shot(List<set_var_base> *var_list);
void fix_delay_key_write(THD *thd, enum_var_type type); void fix_delay_key_write(THD *thd, enum_var_type type);
ulong fix_sql_mode(ulong sql_mode); ulong fix_sql_mode(ulong sql_mode);
extern sys_var_str sys_charset_system; extern sys_var_const_str sys_charset_system;
extern sys_var_str sys_init_connect; extern sys_var_str sys_init_connect;
extern sys_var_str sys_init_slave; extern sys_var_str sys_init_slave;
extern sys_var_thd_time_zone sys_time_zone; extern sys_var_thd_time_zone sys_time_zone;
......
...@@ -1988,10 +1988,20 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) ...@@ -1988,10 +1988,20 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
/* /*
get_all_tables() returns 1 on failure and 0 on success thus get_all_tables() returns 1 on failure and 0 on success thus
return only these and not the result code of ::process_table() return only these and not the result code of ::process_table()
We should use show_table_list->alias instead of
show_table_list->table_name because table_name
could be changed during opening of I_S tables. It's safe
to use alias because alias contains original table name
in this case(this part of code is used only for
'show columns' & 'show statistics' commands).
*/ */
error= test(schema_table->process_table(thd, show_table_list, error= test(schema_table->process_table(thd, show_table_list,
table, res, show_table_list->db, table, res,
show_table_list->alias)); (show_table_list->view ?
show_table_list->view_db.str :
show_table_list->db),
show_table_list->alias));
close_thread_tables(thd); close_thread_tables(thd);
show_table_list->table= 0; show_table_list->table= 0;
goto err; goto err;
...@@ -2092,6 +2102,13 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) ...@@ -2092,6 +2102,13 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
lex->derived_tables= 0; lex->derived_tables= 0;
res= open_normal_and_derived_tables(thd, show_table_list, res= open_normal_and_derived_tables(thd, show_table_list,
MYSQL_LOCK_IGNORE_FLUSH); MYSQL_LOCK_IGNORE_FLUSH);
/*
We should use show_table_list->alias instead of
show_table_list->table_name because table_name
could be changed during opening of I_S tables. It's safe
to use alias because alias contains original table name
in this case.
*/
res= schema_table->process_table(thd, show_table_list, table, res= schema_table->process_table(thd, show_table_list, table,
res, base_name, res, base_name,
show_table_list->alias); show_table_list->alias);
......
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