1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Merge sanja.is.com.ua:/home/bell/mysql/bk/work-bug1-5.0

into  sanja.is.com.ua:/home/bell/mysql/bk/work-merge-5.0
This commit is contained in:
bell@sanja.is.com.ua
2005-11-21 21:15:48 +02:00
44 changed files with 710 additions and 506 deletions

View File

@ -705,7 +705,8 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
MY_CS_BINSORT,MYF(0))))
{
char tmp[64];
strmake(strmake(tmp, save_cs->csname, sizeof(tmp)-4), "_bin", 4);
strmake(strmake(tmp, save_cs->csname, sizeof(tmp)-4),
STRING_WITH_LEN("_bin"));
my_error(ER_UNKNOWN_COLLATION, MYF(0), tmp);
DBUG_RETURN(-1);
}
@ -1951,7 +1952,7 @@ static int send_check_errmsg(THD *thd, TABLE_LIST* table,
protocol->prepare_for_resend();
protocol->store(table->alias, system_charset_info);
protocol->store((char*) operator_name, system_charset_info);
protocol->store("error", 5, system_charset_info);
protocol->store(STRING_WITH_LEN("error"), system_charset_info);
protocol->store(errmsg, system_charset_info);
thd->clear_error();
if (protocol->write())
@ -2242,7 +2243,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
protocol->prepare_for_resend();
protocol->store(table_name, system_charset_info);
protocol->store(operator_name, system_charset_info);
protocol->store("error",5, system_charset_info);
protocol->store(STRING_WITH_LEN("error"), system_charset_info);
if (!(err_msg=thd->net.last_error))
err_msg=ER(ER_CHECK_NO_SUCH_TABLE);
/* if it was a view will check md5 sum */
@ -2279,7 +2280,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
protocol->prepare_for_resend();
protocol->store(table_name, system_charset_info);
protocol->store(operator_name, system_charset_info);
protocol->store("error", 5, system_charset_info);
protocol->store(STRING_WITH_LEN("error"), system_charset_info);
length= my_snprintf(buff, sizeof(buff), ER(ER_OPEN_AS_READONLY),
table_name);
protocol->store(buff, length, system_charset_info);
@ -2314,8 +2315,9 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
protocol->prepare_for_resend();
protocol->store(table_name, system_charset_info);
protocol->store(operator_name, system_charset_info);
protocol->store("warning", 7, system_charset_info);
protocol->store("Table is marked as crashed", 26, system_charset_info);
protocol->store(STRING_WITH_LEN("warning"), system_charset_info);
protocol->store(STRING_WITH_LEN("Table is marked as crashed"),
system_charset_info);
if (protocol->write())
goto err;
}
@ -2339,7 +2341,7 @@ send_result_message:
char buf[ERRMSGSIZE+20];
uint length=my_snprintf(buf, ERRMSGSIZE,
ER(ER_CHECK_NOT_IMPLEMENTED), operator_name);
protocol->store("note", 4, system_charset_info);
protocol->store(STRING_WITH_LEN("note"), system_charset_info);
protocol->store(buf, length, system_charset_info);
}
break;
@ -2349,41 +2351,45 @@ send_result_message:
char buf[ERRMSGSIZE+20];
uint length= my_snprintf(buf, ERRMSGSIZE,
ER(ER_BAD_TABLE_ERROR), table_name);
protocol->store("note", 4, system_charset_info);
protocol->store(STRING_WITH_LEN("note"), system_charset_info);
protocol->store(buf, length, system_charset_info);
}
break;
case HA_ADMIN_OK:
protocol->store("status", 6, system_charset_info);
protocol->store("OK",2, system_charset_info);
protocol->store(STRING_WITH_LEN("status"), system_charset_info);
protocol->store(STRING_WITH_LEN("OK"), system_charset_info);
break;
case HA_ADMIN_FAILED:
protocol->store("status", 6, system_charset_info);
protocol->store("Operation failed",16, system_charset_info);
protocol->store(STRING_WITH_LEN("status"), system_charset_info);
protocol->store(STRING_WITH_LEN("Operation failed"),
system_charset_info);
break;
case HA_ADMIN_REJECT:
protocol->store("status", 6, system_charset_info);
protocol->store("Operation need committed state",30, system_charset_info);
protocol->store(STRING_WITH_LEN("status"), system_charset_info);
protocol->store(STRING_WITH_LEN("Operation need committed state"),
system_charset_info);
open_for_modify= FALSE;
break;
case HA_ADMIN_ALREADY_DONE:
protocol->store("status", 6, system_charset_info);
protocol->store("Table is already up to date", 27, system_charset_info);
protocol->store(STRING_WITH_LEN("status"), system_charset_info);
protocol->store(STRING_WITH_LEN("Table is already up to date"),
system_charset_info);
break;
case HA_ADMIN_CORRUPT:
protocol->store("error", 5, system_charset_info);
protocol->store("Corrupt", 7, system_charset_info);
protocol->store(STRING_WITH_LEN("error"), system_charset_info);
protocol->store(STRING_WITH_LEN("Corrupt"), system_charset_info);
fatal_error=1;
break;
case HA_ADMIN_INVALID:
protocol->store("error", 5, system_charset_info);
protocol->store("Invalid argument",16, system_charset_info);
protocol->store(STRING_WITH_LEN("error"), system_charset_info);
protocol->store(STRING_WITH_LEN("Invalid argument"),
system_charset_info);
break;
case HA_ADMIN_TRY_ALTER:
@ -2419,7 +2425,7 @@ send_result_message:
else
{
/* Hijack the row already in-progress. */
protocol->store("error", 5, system_charset_info);
protocol->store(STRING_WITH_LEN("error"), system_charset_info);
protocol->store(err_msg, system_charset_info);
(void)protocol->write();
/* Start off another row for HA_ADMIN_FAILED */
@ -2436,7 +2442,7 @@ send_result_message:
}
case HA_ADMIN_WRONG_CHECKSUM:
{
protocol->store("note", 4, system_charset_info);
protocol->store(STRING_WITH_LEN("note"), system_charset_info);
protocol->store(ER(ER_VIEW_CHECKSUM), strlen(ER(ER_VIEW_CHECKSUM)),
system_charset_info);
break;
@ -2448,7 +2454,7 @@ send_result_message:
uint length=my_snprintf(buf, ERRMSGSIZE,
"Unknown - internal error %d during operation",
result_code);
protocol->store("error", 5, system_charset_info);
protocol->store(STRING_WITH_LEN("error"), system_charset_info);
protocol->store(buf, length, system_charset_info);
fatal_error=1;
break;