Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas 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, 2007-05-10 08:06:09+02:00, tomas@stripped +8 -0
Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-opt
into whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-single-user
MERGE: 1.2506.1.7
sql/field.cc@stripped, 2007-05-10 07:16:58+02:00, tomas@stripped +0 -0
Auto merged
MERGE: 1.387.1.1
sql/field.h@stripped, 2007-05-10 07:16:58+02:00, tomas@stripped +0 -0
Auto merged
MERGE: 1.222.1.1
sql/ha_ndbcluster.cc@stripped, 2007-05-10 07:16:59+02:00, tomas@stripped +0 -0
Auto merged
MERGE: 1.443.1.3
sql/handler.cc@stripped, 2007-05-10 08:06:06+02:00, tomas@stripped +0 -0
manual merge
MERGE: 1.304.1.1
sql/mysqld.cc@stripped, 2007-05-10 08:06:06+02:00, tomas@stripped +4 -0
manual merge
MERGE: 1.638.1.1
sql/set_var.cc@stripped, 2007-05-10 08:06:06+02:00, tomas@stripped +3 -6
manual merge
MERGE: 1.229.1.2
sql/sql_plugin.cc@stripped, 2007-05-10 08:06:06+02:00, tomas@stripped +0 -0
manual merge
MERGE: 1.47.1.2
sql/sql_table.cc@stripped, 2007-05-10 07:16:59+02:00, tomas@stripped +0 -0
Auto merged
MERGE: 1.413.1.1
# 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: tomas
# Host: whalegate.ndb.mysql.com
# Root: /home/tomas/mysql-5.1-single-user/RESYNC
--- 1.306/sql/handler.cc 2007-05-09 17:07:05 +02:00
+++ 1.307/sql/handler.cc 2007-05-10 08:06:06 +02:00
@@ -2886,20 +2886,21 @@
DBUG_RETURN(error);
}
-
-/** @brief
+/*
Ask handler if the table exists in engine
RETURN
- 0 Table does not exist
- 1 Table exists
- # Error code
+ HA_ERR_NO_SUCH_TABLE Table does not exist
+ HA_ERR_TABLE_EXIST Table exists
+ # Error code
+
+ */
-*/
struct st_table_exists_in_engine_args
{
const char *db;
const char *name;
+ int err;
};
static my_bool table_exists_in_engine_handlerton(THD *thd, plugin_ref plugin,
@@ -2908,23 +2909,27 @@
st_table_exists_in_engine_args *vargs= (st_table_exists_in_engine_args *)arg;
handlerton *hton= plugin_data(plugin, handlerton *);
+ int err= HA_ERR_NO_SUCH_TABLE;
+
if (hton->state == SHOW_OPTION_YES && hton->table_exists_in_engine)
- if ((hton->table_exists_in_engine(hton, thd, vargs->db, vargs->name)) == 1)
- return TRUE;
+ err = hton->table_exists_in_engine(hton, thd, vargs->db, vargs->name);
+
+ vargs->err = err;
+ if (vargs->err == HA_ERR_TABLE_EXIST)
+ return TRUE;
return FALSE;
}
int ha_table_exists_in_engine(THD* thd, const char* db, const char* name)
{
- int error= 0;
DBUG_ENTER("ha_table_exists_in_engine");
DBUG_PRINT("enter", ("db: %s, name: %s", db, name));
- st_table_exists_in_engine_args args= {db, name};
- error= plugin_foreach(thd, table_exists_in_engine_handlerton,
+ st_table_exists_in_engine_args args= {db, name, HA_ERR_NO_SUCH_TABLE};
+ plugin_foreach(thd, table_exists_in_engine_handlerton,
MYSQL_STORAGE_ENGINE_PLUGIN, &args);
- DBUG_PRINT("exit", ("error: %d", error));
- DBUG_RETURN(error);
+ DBUG_PRINT("exit", ("error: %d", args.err));
+ DBUG_RETURN(args.err);
}
#ifdef HAVE_NDB_BINLOG
--- 1.643/sql/mysqld.cc 2007-05-04 16:10:05 +02:00
+++ 1.644/sql/mysqld.cc 2007-05-10 08:06:06 +02:00
@@ -368,7 +368,7 @@
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
const char *opt_ndbcluster_connectstring= 0;
const char *opt_ndb_connectstring= 0;
-char opt_ndb_constrbuf[1024];
+char opt_ndb_constrbuf[1024]= {0};
unsigned opt_ndb_constrbuf_len= 0;
my_bool opt_ndb_shm, opt_ndb_optimized_node_selection;
ulong opt_ndb_cache_check_time;
--- 1.414/sql/sql_table.cc 2007-05-05 08:20:33 +02:00
+++ 1.415/sql/sql_table.cc 2007-05-10 07:16:59 +02:00
@@ -3511,15 +3511,25 @@
{
bool create_if_not_exists =
create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS;
-
- if (ha_table_exists_in_engine(thd, db, table_name))
+ int retcode = ha_table_exists_in_engine(thd, db, table_name);
+ DBUG_PRINT("info", ("exists_in_engine: %u",retcode));
+ switch (retcode)
{
- DBUG_PRINT("info", ("Table with same name already existed in handler"));
+ case HA_ERR_NO_SUCH_TABLE:
+ /* Normal case, no table exists. we can go and create it */
+ break;
+ case HA_ERR_TABLE_EXIST:
+ DBUG_PRINT("info", ("Table existed in handler"));
- if (create_if_not_exists)
- goto warn;
- my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
- goto unlock_and_end;
+ if (create_if_not_exists)
+ goto warn;
+ my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
+ goto unlock_and_end;
+ break;
+ default:
+ DBUG_PRINT("info", ("error: %u from storage engine", retcode));
+ my_error(retcode, MYF(0),table_name);
+ goto unlock_and_end;
}
}
--- 1.446/sql/ha_ndbcluster.cc 2007-05-07 21:32:03 +02:00
+++ 1.447/sql/ha_ndbcluster.cc 2007-05-10 07:16:59 +02:00
@@ -6561,9 +6561,9 @@
if (my_strcasecmp(system_charset_info, elmt.name, name))
continue;
DBUG_PRINT("info", ("Found table"));
- DBUG_RETURN(1);
+ DBUG_RETURN(HA_ERR_TABLE_EXIST);
}
- DBUG_RETURN(0);
+ DBUG_RETURN(HA_ERR_NO_SUCH_TABLE);
}
@@ -6927,7 +6927,7 @@
DBUG_PRINT("info", ("%s existed on disk", name));
// The .ndb file exists on disk, but it's not in list of tables in ndb
// Verify that handler agrees table is gone.
- if (ndbcluster_table_exists_in_engine(hton, thd, db, file_name) == 0)
+ if (ndbcluster_table_exists_in_engine(hton, thd, db, file_name) == HA_ERR_NO_SUCH_TABLE)
{
DBUG_PRINT("info", ("NDB says %s does not exists", file_name));
it.remove();
--- 1.230/sql/set_var.cc 2007-04-27 19:03:50 +02:00
+++ 1.231/sql/set_var.cc 2007-05-10 08:06:06 +02:00
@@ -58,8 +58,12 @@
#include "events.h"
/* WITH_NDBCLUSTER_STORAGE_ENGINE */
+#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
extern ulong ndb_cache_check_time;
+extern char opt_ndb_constrbuf[];
extern ulong ndb_extra_logging;
+#endif
+
#ifdef HAVE_NDB_BINLOG
extern ulong ndb_report_thresh_binlog_epoch_slip;
extern ulong ndb_report_thresh_binlog_mem_usage;
@@ -471,6 +475,7 @@
sys_engine_condition_pushdown(&vars, "engine_condition_pushdown",
&SV::engine_condition_pushdown);
+#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
/* ndb thread specific variable settings */
static sys_var_thd_ulong
sys_ndb_autoincrement_prefetch_sz(&vars, "ndb_autoincrement_prefetch_sz",
@@ -491,6 +496,8 @@
sys_ndb_use_transactions(&vars, "ndb_use_transactions", &SV::ndb_use_transactions);
static sys_var_long_ptr
sys_ndb_cache_check_time(&vars, "ndb_cache_check_time", &ndb_cache_check_time);
+static sys_var_const_str
+sys_ndb_connectstring(&vars, "ndb_connectstring", opt_ndb_constrbuf);
static sys_var_thd_bool
sys_ndb_index_stat_enable(&vars, "ndb_index_stat_enable",
&SV::ndb_index_stat_enable);
@@ -504,6 +511,7 @@
sys_ndb_extra_logging(&vars, "ndb_extra_logging", &ndb_extra_logging);
static sys_var_thd_bool
sys_ndb_use_copying_alter_table(&vars, "ndb_use_copying_alter_table", &SV::ndb_use_copying_alter_table);
+#endif //WITH_NDBCLUSTER_STORAGE_ENGINE
/* Time/date/datetime formats */
--- 1.63/sql/sql_plugin.cc 2007-05-05 01:43:58 +02:00
+++ 1.64/sql/sql_plugin.cc 2007-05-10 08:06:06 +02:00
@@ -1740,6 +1740,7 @@
pthread_mutex_unlock(&LOCK_plugin);
}
plugin= plugins[idx];
+ /* It will stop iterating on first engine error when "func" returns TRUE */
if (plugin && func(thd, plugin_int_to_ref(plugin), arg))
goto err;
}
| Thread |
|---|
| • bk commit into 5.1 tree (tomas:1.2513) | tomas | 10 May |