Below is the list of changes that have just been committed into a local
5.1 repository of lars. When lars does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-11-13 12:17:40+01:00, lars@black.(none) +12 -0
Merge mysql.com:/home/bkroot/mysql-5.1-new-rpl
into mysql.com:/home/bk/MERGE/mysql-5.1-merge
MERGE: 1.2334.7.7
BitKeeper/etc/collapsed@stripped, 2006-11-13 12:17:24+01:00, lars@stripped +2 -2
auto-union
MERGE: 1.15.1.2
mysql-test/r/view.result@stripped, 2006-11-13 12:17:31+01:00, lars@black.(none) +0 -0
Auto merged
MERGE: 1.190.1.3
mysql-test/t/view.test@stripped, 2006-11-13 12:17:31+01:00, lars@black.(none) +0 -0
Auto merged
MERGE: 1.172.1.3
sql/Makefile.am@stripped, 2006-11-13 12:17:31+01:00, lars@black.(none) +0 -0
Auto merged
MERGE: 1.162.1.2
sql/handler.cc@stripped, 2006-11-13 12:17:31+01:00, lars@black.(none) +0 -0
Auto merged
MERGE: 1.273.1.6
sql/log.cc@stripped, 2006-11-13 12:17:31+01:00, lars@black.(none) +0 -0
Auto merged
MERGE: 1.240.1.1
sql/mysql_priv.h@stripped, 2006-11-13 12:17:32+01:00, lars@black.(none) +0 -0
Auto merged
MERGE: 1.452.1.1
sql/mysqld.cc@stripped, 2006-11-13 12:17:32+01:00, lars@black.(none) +0 -0
Auto merged
MERGE: 1.583.7.3
sql/slave.cc@stripped, 2006-11-13 12:17:32+01:00, lars@black.(none) +0 -0
Auto merged
MERGE: 1.288.2.1
sql/sql_parse.cc@stripped, 2006-11-13 12:17:33+01:00, lars@black.(none) +0 -0
Auto merged
MERGE: 1.592.1.1
sql/sql_select.cc@stripped, 2006-11-13 12:17:33+01:00, lars@black.(none) +0 -0
Auto merged
MERGE: 1.463.1.1
sql/sql_view.cc@stripped, 2006-11-13 12:17:33+01:00, lars@black.(none) +0 -0
Auto merged
MERGE: 1.110.1.8
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: lars
# Host: black.(none)
# Root: /home/bk/MERGE/mysql-5.1-merge/RESYNC
--- 1.164/sql/Makefile.am 2006-11-13 12:17:47 +01:00
+++ 1.165/sql/Makefile.am 2006-11-13 12:17:47 +01:00
@@ -54,7 +54,7 @@
ha_ndbcluster.h ha_ndbcluster_binlog.h \
ha_ndbcluster_tables.h \
opt_range.h protocol.h rpl_tblmap.h rpl_utility.h \
- log.h sql_show.h rpl_rli.h \
+ log.h sql_show.h rpl_rli.h rpl_mi.h \
sql_select.h structs.h table.h sql_udf.h hash_filo.h \
lex.h lex_symbol.h sql_acl.h sql_crypt.h \
log_event.h sql_repl.h slave.h rpl_filter.h \
@@ -94,7 +94,7 @@
sql_load.cc mf_iocache.cc field_conv.cc sql_show.cc \
sql_udf.cc sql_analyse.cc sql_analyse.h sql_cache.cc \
slave.cc sql_repl.cc rpl_filter.cc rpl_tblmap.cc \
- rpl_utility.cc rpl_injector.cc \
+ rpl_utility.cc rpl_injector.cc rpl_rli.cc rpl_mi.cc \
sql_union.cc sql_derived.cc \
client.c sql_client.cc mini_client_errors.c pack.c\
stacktrace.c repl_failsafe.h repl_failsafe.cc \
--- 1.278/sql/handler.cc 2006-11-13 12:17:47 +01:00
+++ 1.279/sql/handler.cc 2006-11-13 12:17:47 +01:00
@@ -3460,38 +3460,15 @@
declared static, but it works by putting it into an anonymous
namespace. */
namespace {
- struct st_table_data {
- char const *db;
- char const *name;
- };
-
- static int table_name_compare(void const *a, void const *b)
- {
- st_table_data const *x = (st_table_data const*) a;
- st_table_data const *y = (st_table_data const*) b;
-
- /* Doing lexical compare in order (db,name) */
- int const res= strcmp(x->db, y->db);
- return res != 0 ? res : strcmp(x->name, y->name);
- }
-
bool check_table_binlog_row_based(THD *thd, TABLE *table)
{
- static st_table_data const ignore[] = {
- { "mysql", "event" },
- { "mysql", "general_log" },
- { "mysql", "slow_log" }
- };
-
- my_size_t const ignore_size = sizeof(ignore)/sizeof(*ignore);
- st_table_data const item = { table->s->db.str, table->s->table_name.str };
-
if (table->s->cached_row_logging_check == -1)
- table->s->cached_row_logging_check=
- (table->s->tmp_table == NO_TMP_TABLE) &&
- binlog_filter->db_ok(table->s->db.str) &&
- bsearch(&item, ignore, ignore_size,
- sizeof(st_table_data), table_name_compare) == NULL;
+ {
+ int const check(table->s->tmp_table == NO_TMP_TABLE &&
+ binlog_filter->db_ok(table->s->db.str) &&
+ strcmp("mysql", table->s->db.str) != 0);
+ table->s->cached_row_logging_check= check;
+ }
DBUG_ASSERT(table->s->cached_row_logging_check == 0 ||
table->s->cached_row_logging_check == 1);
--- 1.241/sql/log.cc 2006-11-13 12:17:47 +01:00
+++ 1.242/sql/log.cc 2006-11-13 12:17:47 +01:00
@@ -2098,7 +2098,7 @@
goto err;
/* command_type, thread_id */
- length= my_snprintf(buff, 32, "%5ld ", thread_id);
+ length= my_snprintf(buff, 32, "%5ld ", (long) thread_id);
if (my_b_write(&log_file, (byte*) buff, length))
goto err;
--- 1.455/sql/mysql_priv.h 2006-11-13 12:17:47 +01:00
+++ 1.456/sql/mysql_priv.h 2006-11-13 12:17:47 +01:00
@@ -105,6 +105,17 @@
extern CHARSET_INFO *national_charset_info, *table_alias_charset;
+enum Derivation
+{
+ DERIVATION_IGNORABLE= 5,
+ DERIVATION_COERCIBLE= 4,
+ DERIVATION_SYSCONST= 3,
+ DERIVATION_IMPLICIT= 2,
+ DERIVATION_NONE= 1,
+ DERIVATION_EXPLICIT= 0
+};
+
+
typedef struct my_locale_st
{
const char *name;
--- 1.589/sql/mysqld.cc 2006-11-13 12:17:48 +01:00
+++ 1.590/sql/mysqld.cc 2006-11-13 12:17:48 +01:00
@@ -3149,11 +3149,6 @@
}
if (global_system_variables.binlog_format == BINLOG_FORMAT_UNSPEC)
{
-#if defined(HAVE_NDB_BINLOG) && defined(HAVE_ROW_BASED_REPLICATION)
- if (opt_bin_log && have_ndbcluster == SHOW_OPTION_YES)
- global_system_variables.binlog_format= BINLOG_FORMAT_ROW;
- else
-#endif
#if defined(HAVE_ROW_BASED_REPLICATION)
global_system_variables.binlog_format= BINLOG_FORMAT_MIXED;
#else
--- 1.293/sql/slave.cc 2006-11-13 12:17:48 +01:00
+++ 1.294/sql/slave.cc 2006-11-13 12:17:48 +01:00
@@ -1369,9 +1369,21 @@
void set_slave_thread_options(THD* thd)
{
DBUG_ENTER("set_slave_thread_options");
-
- thd->options = ((opt_log_slave_updates) ? OPTION_BIN_LOG:0) |
- OPTION_AUTO_IS_NULL;
+ /*
+ It's nonsense to constrain the slave threads with max_join_size; if a
+ query succeeded on master, we HAVE to execute it. So set
+ OPTION_BIG_SELECTS. Setting max_join_size to HA_POS_ERROR is not enough
+ (and it's not needed if we have OPTION_BIG_SELECTS) because an INSERT
+ SELECT examining more than 4 billion rows would still fail (yes, because
+ when max_join_size is 4G, OPTION_BIG_SELECTS is automatically set, but
+ only for client threads.
+ */
+ ulonglong options= thd->options | OPTION_BIG_SELECTS;
+ if (opt_log_slave_updates)
+ options|= OPTION_BIN_LOG;
+ else
+ options&= ~OPTION_BIN_LOG;
+ thd->options= options;
thd->variables.completion_type= 0;
DBUG_VOID_RETURN;
}
@@ -1405,17 +1417,6 @@
thd->net.read_timeout = slave_net_timeout;
thd->slave_thread = 1;
set_slave_thread_options(thd);
- /*
- It's nonsense to constrain the slave threads with max_join_size; if a
- query succeeded on master, we HAVE to execute it. So set
- OPTION_BIG_SELECTS. Setting max_join_size to HA_POS_ERROR is not enough
- (and it's not needed if we have OPTION_BIG_SELECTS) because an INSERT
- SELECT examining more than 4 billion rows would still fail (yes, because
- when max_join_size is 4G, OPTION_BIG_SELECTS is automatically set, but
- only for client threads.
- */
- thd->options = ((opt_log_slave_updates) ? OPTION_BIN_LOG:0) |
- OPTION_AUTO_IS_NULL | OPTION_BIG_SELECTS;
thd->client_capabilities = CLIENT_LOCAL_FILES;
thd->real_id=pthread_self();
pthread_mutex_lock(&LOCK_thread_count);
--- 1.594/sql/sql_parse.cc 2006-11-13 12:17:48 +01:00
+++ 1.595/sql/sql_parse.cc 2006-11-13 12:17:48 +01:00
@@ -3927,6 +3927,12 @@
case SQLCOM_ALTER_EVENT:
{
DBUG_ASSERT(lex->event_parse_data);
+ if (lex->table_or_sp_used())
+ {
+ my_error(ER_NOT_SUPPORTED_YET, MYF(0), "Usage of subqueries or stored "
+ "function calls as part of this statement");
+ break;
+ }
switch (lex->sql_command) {
case SQLCOM_CREATE_EVENT:
res= Events::get_instance()->
@@ -4198,6 +4204,13 @@
{
Item *it= (Item *)lex->value_list.head();
+ if (lex->table_or_sp_used())
+ {
+ my_error(ER_NOT_SUPPORTED_YET, MYF(0), "Usage of subqueries or stored "
+ "function calls as part of this statement");
+ break;
+ }
+
if ((!it->fixed && it->fix_fields(lex->thd, &it)) || it->check_cols(1))
{
my_message(ER_SET_CONSTANTS_ONLY, ER(ER_SET_CONSTANTS_ONLY),
@@ -4640,7 +4653,10 @@
send_ok(thd, (ulong) (thd->row_count_func < 0 ? 0 :
thd->row_count_func));
else
+ {
+ DBUG_ASSERT(thd->net.report_error == 1 || thd->killed);
goto error; // Substatement should already have sent error
+ }
}
break;
}
--- 1.464/sql/sql_select.cc 2006-11-13 12:17:48 +01:00
+++ 1.465/sql/sql_select.cc 2006-11-13 12:17:48 +01:00
@@ -8723,6 +8723,7 @@
item->collation.collation);
else
new_field= item->make_string_field(table);
+ new_field->set_derivation(item->collation.derivation);
break;
case DECIMAL_RESULT:
new_field= new Field_new_decimal(item->max_length, maybe_null, item->name,
@@ -8908,7 +8909,9 @@
(make_copy_field ? 0 : copy_func),
modify_item, convert_blob_length);
case Item::TYPE_HOLDER:
- return ((Item_type_holder *)item)->make_field_by_type(table);
+ result= ((Item_type_holder *)item)->make_field_by_type(table);
+ result->set_derivation(item->collation.derivation);
+ return result;
default: // Dosen't have to be stored
return 0;
}
--- 1.192/mysql-test/r/view.result 2006-11-13 12:17:48 +01:00
+++ 1.193/mysql-test/r/view.result 2006-11-13 12:17:48 +01:00
@@ -3015,3 +3015,22 @@
DROP VIEW v1, v2;
DROP TABLE t1;
End of 5.0 tests.
+DROP DATABASE IF EXISTS `d-1`;
+CREATE DATABASE `d-1`;
+USE `d-1`;
+CREATE TABLE `t-1` (c1 INT);
+CREATE VIEW `v-1` AS SELECT c1 FROM `t-1`;
+SHOW TABLES;
+Tables_in_d-1
+t-1
+v-1
+RENAME TABLE `t-1` TO `t-2`;
+RENAME TABLE `v-1` TO `v-2`;
+SHOW TABLES;
+Tables_in_d-1
+t-2
+v-2
+DROP TABLE `t-2`;
+DROP VIEW `v-2`;
+DROP DATABASE `d-1`;
+USE test;
--- 1.174/mysql-test/t/view.test 2006-11-13 12:17:48 +01:00
+++ 1.175/mysql-test/t/view.test 2006-11-13 12:17:48 +01:00
@@ -2959,3 +2959,22 @@
--echo End of 5.0 tests.
+
+#
+# Bug#21370 View renaming lacks tablename_to_filename encoding
+#
+--disable_warnings
+DROP DATABASE IF EXISTS `d-1`;
+--enable_warnings
+CREATE DATABASE `d-1`;
+USE `d-1`;
+CREATE TABLE `t-1` (c1 INT);
+CREATE VIEW `v-1` AS SELECT c1 FROM `t-1`;
+SHOW TABLES;
+RENAME TABLE `t-1` TO `t-2`;
+RENAME TABLE `v-1` TO `v-2`;
+SHOW TABLES;
+DROP TABLE `t-2`;
+DROP VIEW `v-2`;
+DROP DATABASE `d-1`;
+USE test;
--- 1.112/sql/sql_view.cc 2006-11-13 12:17:48 +01:00
+++ 1.113/sql/sql_view.cc 2006-11-13 12:17:48 +01:00
@@ -562,7 +562,7 @@
LEX_STRING *name;
int i;
- for (i= 0; name= names++; i++)
+ for (i= 0; (name= names++); i++)
{
buff.append(i ? ", " : "(");
append_identifier(thd, &buff, name->str, name->length);
@@ -1101,6 +1101,8 @@
bool view_is_mergeable= (table->algorithm != VIEW_ALGORITHM_TMPTABLE &&
lex->can_be_merged());
TABLE_LIST *view_main_select_tables;
+ LINT_INIT(view_main_select_tables);
+
if (view_is_mergeable)
{
/*
--- 1.16/BitKeeper/etc/collapsed 2006-11-13 12:17:48 +01:00
+++ 1.17/BitKeeper/etc/collapsed 2006-11-13 12:17:48 +01:00
@@ -15,5 +15,7 @@
45214442pBGT9KuZEGixBH71jTzbOA
45214a07hVsIGwvwa-WrO-jpeaSwVw
452a92d0-31-8wSzSfZi165fcGcXPA
+452c6c6dAjuNghfc1ObZ_UQ5SCl85g
+4538a7b0EbDHHkWPbIwxO6ZIDdg6Dg
454a7ef8gdvE_ddMlJyghvOAkKPNOQ
454f8960jsVT_kMKJtZ9OCgXoba0xQ
| Thread |
|---|
| • bk commit into 5.1 tree (lars:1.2357) | Lars Thalmann | 13 Nov |