summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorunknown <holyfoot@mysql.com>2006-05-12 14:16:20 +0500
committerunknown <holyfoot@mysql.com>2006-05-12 14:16:20 +0500
commit0ccda0521bf8728297f7e2bd4e7da2971a2aaae0 (patch)
treebeaf2c66c877f819c851918a8b1703ca4fd5da8f /sql/sql_parse.cc
parent7fb64e0f87b0ad9b97ea63008bb2490077f7f0a7 (diff)
parent564a94da7b744442cb4721cd53cb2d6c28452e51 (diff)
downloadmariadb-git-0ccda0521bf8728297f7e2bd4e7da2971a2aaae0.tar.gz
Merge
config/ac-macros/ha_ndbcluster.m4: Auto merged sql/mysqld.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_parse.cc: Auto merged sql/log.cc: SCCS merged sql/sql_base.cc: SCCS merged
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc40
1 files changed, 19 insertions, 21 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 2a913cc66aa..ae2a173c936 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -137,7 +137,7 @@ static void unlock_locked_tables(THD *thd)
}
-static bool end_active_trans(THD *thd)
+bool end_active_trans(THD *thd)
{
int error=0;
DBUG_ENTER("end_active_trans");
@@ -1753,7 +1753,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
if (alloc_query(thd, packet, packet_length))
break; // fatal error is set
char *packet_end= thd->query + thd->query_length;
- general_log_print(thd, command, "%s", thd->query);
+ general_log_print(thd, command, "%.*b", thd->query_length, thd->query);
DBUG_PRINT("query",("%-.4096s",thd->query));
if (!(specialflag & SPECIAL_NO_PRIOR))
@@ -2963,8 +2963,7 @@ end_with_restore_list:
thd->enable_slow_log= opt_log_slow_admin_statements;
if (end_active_trans(thd))
goto error;
- else
- res = mysql_create_index(thd, first_table, lex->key_list);
+ res= mysql_create_index(thd, first_table, lex->key_list);
break;
#ifdef HAVE_REPLICATION
@@ -3071,18 +3070,16 @@ end_with_restore_list:
/* ALTER TABLE ends previous transaction */
if (end_active_trans(thd))
goto error;
- else
- {
- thd->enable_slow_log= opt_log_slow_admin_statements;
- res= mysql_alter_table(thd, select_lex->db, lex->name,
- &lex->create_info,
- first_table, lex->create_list,
- lex->key_list,
- select_lex->order_list.elements,
- (ORDER *) select_lex->order_list.first,
- lex->duplicates, lex->ignore, &lex->alter_info,
- 1);
- }
+
+ thd->enable_slow_log= opt_log_slow_admin_statements;
+ res= mysql_alter_table(thd, select_lex->db, lex->name,
+ &lex->create_info,
+ first_table, lex->create_list,
+ lex->key_list,
+ select_lex->order_list.elements,
+ (ORDER *) select_lex->order_list.first,
+ lex->duplicates, lex->ignore, &lex->alter_info,
+ 1);
break;
}
#endif /*DONT_ALLOW_SHOW_COMMANDS*/
@@ -3209,7 +3206,7 @@ end_with_restore_list:
check_table_access(thd, SELECT_ACL | INSERT_ACL, all_tables, 0))
goto error; /* purecov: inspected */
thd->enable_slow_log= opt_log_slow_admin_statements;
- res = mysql_analyze_table(thd, first_table, &lex->check_opt);
+ res= mysql_analyze_table(thd, first_table, &lex->check_opt);
/* ! we write after unlocking the table */
if (!res && !lex->no_write_to_binlog)
{
@@ -3514,8 +3511,7 @@ end_with_restore_list:
goto error; /* purecov: inspected */
if (end_active_trans(thd))
goto error;
- else
- res = mysql_drop_index(thd, first_table, &lex->alter_info);
+ res= mysql_drop_index(thd, first_table, &lex->alter_info);
break;
case SQLCOM_SHOW_PROCESSLIST:
if (!thd->security_ctx->priv_user[0] &&
@@ -5977,14 +5973,16 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type,
if (type_modifier & PRI_KEY_FLAG)
{
lex->col_list.push_back(new key_part_spec(field_name,0));
- lex->key_list.push_back(new Key(Key::PRIMARY, NullS, HA_KEY_ALG_UNDEF,
+ lex->key_list.push_back(new Key(Key::PRIMARY, NullS,
+ &default_key_create_info,
0, lex->col_list));
lex->col_list.empty();
}
if (type_modifier & (UNIQUE_FLAG | UNIQUE_KEY_FLAG))
{
lex->col_list.push_back(new key_part_spec(field_name,0));
- lex->key_list.push_back(new Key(Key::UNIQUE, NullS, HA_KEY_ALG_UNDEF, 0,
+ lex->key_list.push_back(new Key(Key::UNIQUE, NullS,
+ &default_key_create_info, 0,
lex->col_list));
lex->col_list.empty();
}