Below is the list of changes that have just been committed into a local
5.1 repository of reggie. When reggie 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
1.2154 06/02/21 10:29:41 reggie@stripped +5 -0
Merge rburnett@stripped:/home/bk/mysql-5.1-new
into linux.site:/home/reggie/work/mysql-5.1-bug15408
sql/sql_show.cc
1.309 06/02/21 10:29:30 reggie@stripped +0 -0
Auto merged
sql/opt_range.cc
1.203 06/02/21 10:29:30 reggie@stripped +0 -0
Auto merged
sql/handler.h
1.194 06/02/21 10:29:29 reggie@stripped +0 -0
Auto merged
sql/ha_partition.cc
1.32 06/02/21 10:29:29 reggie@stripped +0 -0
Auto merged
sql/ha_ndbcluster.cc
1.273 06/02/21 10:29:29 reggie@stripped +0 -0
Auto merged
# 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: reggie
# Host: linux.site
# Root: /home/reggie/work/mysql-5.1-bug15408/RESYNC
--- 1.193/sql/handler.h 2006-02-16 11:07:16 -06:00
+++ 1.194/sql/handler.h 2006-02-21 10:29:29 -06:00
@@ -43,6 +43,9 @@
#define HA_ADMIN_TRY_ALTER -7
#define HA_ADMIN_WRONG_CHECKSUM -8
#define HA_ADMIN_NOT_BASE_TABLE -9
+#define HA_ADMIN_NEEDS_UPGRADE -10
+#define HA_ADMIN_NEEDS_ALTER -11
+#define HA_ADMIN_NEEDS_CHECK -12
/* Bits in table_flags() to show what database can do */
@@ -566,6 +569,7 @@
#define HTON_HIDDEN (1 << 3) //Engine does not appear in lists
#define HTON_FLUSH_AFTER_RENAME (1 << 4)
#define HTON_NOT_USER_SELECTABLE (1 << 5)
+#define HTON_TEMPORARY_NOT_SUPPORTED (1 << 6) //Having temporary tables not supported
typedef struct st_thd_trans
{
@@ -1162,10 +1166,26 @@
{ return HA_ERR_WRONG_COMMAND; }
virtual void update_create_info(HA_CREATE_INFO *create_info) {}
+protected:
+ /* to be implemented in handlers */
/* admin commands - called from mysql_admin_table */
virtual int check(THD* thd, HA_CHECK_OPT* check_opt)
{ return HA_ADMIN_NOT_IMPLEMENTED; }
+
+ /*
+ in these two methods check_opt can be modified
+ to specify CHECK option to use to call check()
+ upon the table
+ */
+ virtual int check_for_upgrade(HA_CHECK_OPT *check_opt)
+ { return 0; }
+public:
+ int ha_check_for_upgrade(HA_CHECK_OPT *check_opt);
+ int check_old_types();
+ /* to be actually called to get 'check()' functionality*/
+ int ha_check(THD *thd, HA_CHECK_OPT *check_opt);
+
virtual int backup(THD* thd, HA_CHECK_OPT* check_opt)
{ return HA_ADMIN_NOT_IMPLEMENTED; }
/*
@@ -1174,8 +1194,11 @@
*/
virtual int restore(THD* thd, HA_CHECK_OPT* check_opt)
{ return HA_ADMIN_NOT_IMPLEMENTED; }
+protected:
virtual int repair(THD* thd, HA_CHECK_OPT* check_opt)
{ return HA_ADMIN_NOT_IMPLEMENTED; }
+public:
+ int ha_repair(THD* thd, HA_CHECK_OPT* check_opt);
virtual int optimize(THD* thd, HA_CHECK_OPT* check_opt)
{ return HA_ADMIN_NOT_IMPLEMENTED; }
virtual int analyze(THD* thd, HA_CHECK_OPT* check_opt)
--- 1.202/sql/opt_range.cc 2006-02-16 10:57:35 -06:00
+++ 1.203/sql/opt_range.cc 2006-02-21 10:29:30 -06:00
@@ -1951,9 +1951,12 @@
read_time= (double) HA_POS_ERROR;
goto free_mem;
}
- if (tree->type != SEL_TREE::KEY &&
- tree->type != SEL_TREE::KEY_SMALLER)
- goto free_mem;
+ /*
+ If the tree can't be used for range scans, proceed anyway, as we
+ can construct a group-min-max quick select
+ */
+ if (tree->type != SEL_TREE::KEY && tree->type != SEL_TREE::KEY_SMALLER)
+ tree= NULL;
}
}
--- 1.308/sql/sql_show.cc 2006-02-16 10:57:35 -06:00
+++ 1.309/sql/sql_show.cc 2006-02-21 10:29:30 -06:00
@@ -1058,15 +1058,20 @@
if (i == primary_key && !strcmp(key_info->name, primary_key_name))
{
found_primary=1;
- packet->append(STRING_WITH_LEN("PRIMARY "));
+ /*
+ No space at end, because a space will be added after where the
+ identifier would go, but that is not added for primary key.
+ */
+ packet->append(STRING_WITH_LEN("PRIMARY KEY"));
}
else if (key_info->flags & HA_NOSAME)
- packet->append(STRING_WITH_LEN("UNIQUE "));
+ packet->append(STRING_WITH_LEN("UNIQUE KEY "));
else if (key_info->flags & HA_FULLTEXT)
- packet->append(STRING_WITH_LEN("FULLTEXT "));
+ packet->append(STRING_WITH_LEN("FULLTEXT KEY "));
else if (key_info->flags & HA_SPATIAL)
- packet->append(STRING_WITH_LEN("SPATIAL "));
- packet->append(STRING_WITH_LEN("KEY "));
+ packet->append(STRING_WITH_LEN("SPATIAL KEY "));
+ else
+ packet->append(STRING_WITH_LEN("KEY "));
if (!found_primary)
append_identifier(thd, packet, key_info->name, strlen(key_info->name));
@@ -3949,8 +3954,16 @@
sch_table->field[3]->store(et.definer.str, et.definer.length, scs);
sch_table->field[4]->store(et.body.str, et.body.length, scs);
- // [9] is SQL_MODE and is NULL for now, will be fixed later
- sch_table->field[9]->set_null();
+ // [9] is SQL_MODE
+ {
+ byte *sql_mode_str;
+ ulong sql_mode_len=0;
+ sql_mode_str=
+ sys_var_thd_sql_mode::symbolic_mode_representation(thd, et.sql_mode,
+ &sql_mode_len);
+ sch_table->field[9]->store((const char*)sql_mode_str, sql_mode_len, scs);
+ }
+
if (et.expression)
{
String show_str;
@@ -4797,7 +4810,7 @@
{"EXECUTE_AT", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, "Execute at"},
{"INTERVAL_VALUE", 256, MYSQL_TYPE_STRING, 0, 1, "Interval value"},
{"INTERVAL_FIELD", 18, MYSQL_TYPE_STRING, 0, 1, "Interval field"},
- {"SQL_MODE", 65535, MYSQL_TYPE_STRING, 0, 1, 0},
+ {"SQL_MODE", 65535, MYSQL_TYPE_STRING, 0, 0, 0},
{"STARTS", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, "Starts"},
{"ENDS", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, "Ends"},
{"STATUS", 8, MYSQL_TYPE_STRING, 0, 0, "Status"},
--- 1.272/sql/ha_ndbcluster.cc 2006-02-16 15:02:36 -06:00
+++ 1.273/sql/ha_ndbcluster.cc 2006-02-21 10:29:29 -06:00
@@ -4430,29 +4430,24 @@
Always create an event for the table, as other mysql servers
expect it to be there.
*/
- if (ndbcluster_create_event(ndb, t, event_name.c_ptr(), share) < 0)
+ if (!ndbcluster_create_event(ndb, t, event_name.c_ptr(), share,
+ share && do_event_op /* push warning */))
{
- /* this is only a serious error if the binlog is on */
- if (share && do_event_op)
- {
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
- ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
- "Creating event for logging table failed. "
- "See error log for details.");
- }
- break;
- }
- if (ndb_extra_logging)
- sql_print_information("NDB Binlog: CREATE TABLE Event: %s",
- event_name.c_ptr());
-
- if (share && do_event_op &&
- ndbcluster_create_event_ops(share, t, event_name.c_ptr()) < 0)
- {
- sql_print_error("NDB Binlog: FAILED CREATE TABLE event operations."
- " Event: %s", name);
- /* a warning has been issued to the client */
+ if (ndb_extra_logging)
+ sql_print_information("NDB Binlog: CREATE TABLE Event: %s",
+ event_name.c_ptr());
+ if (share && do_event_op &&
+ ndbcluster_create_event_ops(share, t, event_name.c_ptr()))
+ {
+ sql_print_error("NDB Binlog: FAILED CREATE TABLE event operations."
+ " Event: %s", name);
+ /* a warning has been issued to the client */
+ }
}
+ /*
+ warning has been issued if ndbcluster_create_event failed
+ and (share && do_event_op)
+ */
if (share && !do_event_op)
share->flags|= NSF_NO_BINLOG;
ndbcluster_log_schema_op(current_thd, share,
@@ -4793,31 +4788,24 @@
ndb_rep_event_name(&event_name, to + sizeof(share_prefix) - 1, 0);
const NDBTAB *ndbtab= dict->getTable(new_tabname);
- if (ndbcluster_create_event(ndb, ndbtab, event_name.c_ptr(), share) >= 0)
+ if (!ndbcluster_create_event(ndb, ndbtab, event_name.c_ptr(), share,
+ share && ndb_binlog_running /* push warning */))
{
if (ndb_extra_logging)
sql_print_information("NDB Binlog: RENAME Event: %s",
event_name.c_ptr());
- if (share && ndb_binlog_running)
+ if (share && ndb_binlog_running &&
+ ndbcluster_create_event_ops(share, ndbtab, event_name.c_ptr()))
{
- if (ndbcluster_create_event_ops(share, ndbtab,
- event_name.c_ptr()) < 0)
- {
- sql_print_error("NDB Binlog: FAILED create event operations "
- "during RENAME. Event %s", event_name.c_ptr());
- /* a warning has been issued to the client */
- }
+ sql_print_error("NDB Binlog: FAILED create event operations "
+ "during RENAME. Event %s", event_name.c_ptr());
+ /* a warning has been issued to the client */
}
}
- else
- {
- sql_print_error("NDB Binlog: FAILED create event during RENAME. "
- "Event: %s", event_name.c_ptr());
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
- ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
- "Creating event for logging table failed. "
- "See error log for details.");
- }
+ /*
+ warning has been issued if ndbcluster_create_event failed
+ and (share && ndb_binlog_running)
+ */
if (!is_old_table_tmpfile)
ndbcluster_log_schema_op(current_thd, share,
current_thd->query, current_thd->query_length,
@@ -5525,7 +5513,7 @@
{
NDBDICT::List::Element& elmt= list.elements[i];
int do_handle_table= 0;
- if (IS_TMP_PREFIX(elmt.name))
+ if (IS_TMP_PREFIX(elmt.name) || IS_NDB_BLOB_PREFIX(elmt.name))
{
DBUG_PRINT("info", ("Skipping %s.%s in NDB", elmt.database, elmt.name));
continue;
@@ -5662,7 +5650,7 @@
for (i= 0 ; i < list.count ; i++)
{
NDBDICT::List::Element& elmt= list.elements[i];
- if (IS_TMP_PREFIX(elmt.name))
+ if (IS_TMP_PREFIX(elmt.name) || IS_NDB_BLOB_PREFIX(elmt.name))
{
DBUG_PRINT("info", ("Skipping %s.%s in NDB", elmt.database, elmt.name));
continue;
@@ -5848,7 +5836,7 @@
#ifdef HAVE_NDB_BINLOG
ndbcluster_binlog_init_handlerton();
#endif
- h.flags= HTON_NO_FLAGS;
+ h.flags= HTON_TEMPORARY_NOT_SUPPORTED;
}
// Set connectstring if specified
--- 1.31/sql/ha_partition.cc 2006-02-16 10:57:35 -06:00
+++ 1.32/sql/ha_partition.cc 2006-02-21 10:29:29 -06:00
@@ -1078,9 +1078,9 @@
else if (flag == ANALYZE_PARTS)
error= file->analyze(thd, check_opt);
else if (flag == CHECK_PARTS)
- error= file->check(thd, check_opt);
+ error= file->ha_check(thd, check_opt);
else if (flag == REPAIR_PARTS)
- error= file->repair(thd, check_opt);
+ error= file->ha_repair(thd, check_opt);
else
{
DBUG_ASSERT(FALSE);
| Thread |
|---|
| • bk commit into 5.1 tree (reggie:1.2154) | reggie | 21 Feb |