2104
2104
Protocol *protocol= session->protocol;
2105
2105
protocol->prepareForResend();
2106
protocol->store(table->alias, system_charset_info);
2107
protocol->store((char*) operator_name, system_charset_info);
2108
protocol->store(STRING_WITH_LEN("error"), system_charset_info);
2109
protocol->store(errmsg, system_charset_info);
2106
protocol->store(table->alias);
2107
protocol->store((char*) operator_name);
2108
protocol->store(STRING_WITH_LEN("error"));
2109
protocol->store(errmsg);
2110
2110
session->clear_error();
2111
2111
if (protocol->write())
2376
2376
char buff[FN_REFLEN + DRIZZLE_ERRMSG_SIZE];
2377
2377
uint32_t length;
2378
2378
protocol->prepareForResend();
2379
protocol->store(table_name, system_charset_info);
2380
protocol->store(operator_name, system_charset_info);
2381
protocol->store(STRING_WITH_LEN("error"), system_charset_info);
2379
protocol->store(table_name);
2380
protocol->store(operator_name);
2381
protocol->store(STRING_WITH_LEN("error"));
2382
2382
length= snprintf(buff, sizeof(buff), ER(ER_OPEN_AS_READONLY),
2384
protocol->store(buff, length, system_charset_info);
2384
protocol->store(buff, length);
2385
2385
ha_autocommit_or_rollback(session, 0);
2386
2386
session->endTransaction(COMMIT);
2387
2387
session->close_thread_tables();
2415
2415
/* purecov: begin inspected */
2416
2416
protocol->prepareForResend();
2417
protocol->store(table_name, system_charset_info);
2418
protocol->store(operator_name, system_charset_info);
2419
protocol->store(STRING_WITH_LEN("warning"), system_charset_info);
2420
protocol->store(STRING_WITH_LEN("Table is marked as crashed"),
2421
system_charset_info);
2417
protocol->store(table_name);
2418
protocol->store(operator_name);
2419
protocol->store(STRING_WITH_LEN("warning"));
2420
protocol->store(STRING_WITH_LEN("Table is marked as crashed"));
2422
2421
if (protocol->write())
2424
2423
/* purecov: end */
2455
2454
while ((err= it++))
2457
2456
protocol->prepareForResend();
2458
protocol->store(table_name, system_charset_info);
2459
protocol->store((char*) operator_name, system_charset_info);
2457
protocol->store(table_name);
2458
protocol->store(operator_name);
2460
2459
protocol->store(warning_level_names[err->level].str,
2461
warning_level_names[err->level].length,
2462
system_charset_info);
2463
protocol->store(err->msg, system_charset_info);
2460
warning_level_names[err->level].length);
2461
protocol->store(err->msg);
2464
2462
if (protocol->write())
2467
2465
drizzle_reset_errors(session, true);
2469
2467
protocol->prepareForResend();
2470
protocol->store(table_name, system_charset_info);
2471
protocol->store(operator_name, system_charset_info);
2468
protocol->store(table_name);
2469
protocol->store(operator_name);
2473
2471
send_result_message:
2478
2476
char buf[ERRMSGSIZE+20];
2479
2477
uint32_t length=snprintf(buf, ERRMSGSIZE,
2480
2478
ER(ER_CHECK_NOT_IMPLEMENTED), operator_name);
2481
protocol->store(STRING_WITH_LEN("note"), system_charset_info);
2482
protocol->store(buf, length, system_charset_info);
2479
protocol->store(STRING_WITH_LEN("note"));
2480
protocol->store(buf, length);
2486
2484
case HA_ADMIN_OK:
2487
protocol->store(STRING_WITH_LEN("status"), system_charset_info);
2488
protocol->store(STRING_WITH_LEN("OK"), system_charset_info);
2485
protocol->store(STRING_WITH_LEN("status"));
2486
protocol->store(STRING_WITH_LEN("OK"));
2491
2489
case HA_ADMIN_FAILED:
2492
protocol->store(STRING_WITH_LEN("status"), system_charset_info);
2493
protocol->store(STRING_WITH_LEN("Operation failed"),
2494
system_charset_info);
2490
protocol->store(STRING_WITH_LEN("status"));
2491
protocol->store(STRING_WITH_LEN("Operation failed"));
2497
2494
case HA_ADMIN_REJECT:
2498
protocol->store(STRING_WITH_LEN("status"), system_charset_info);
2499
protocol->store(STRING_WITH_LEN("Operation need committed state"),
2500
system_charset_info);
2495
protocol->store(STRING_WITH_LEN("status"));
2496
protocol->store(STRING_WITH_LEN("Operation need committed state"));
2501
2497
open_for_modify= false;
2504
2500
case HA_ADMIN_ALREADY_DONE:
2505
protocol->store(STRING_WITH_LEN("status"), system_charset_info);
2506
protocol->store(STRING_WITH_LEN("Table is already up to date"),
2507
system_charset_info);
2501
protocol->store(STRING_WITH_LEN("status"));
2502
protocol->store(STRING_WITH_LEN("Table is already up to date"));
2510
2505
case HA_ADMIN_CORRUPT:
2511
protocol->store(STRING_WITH_LEN("error"), system_charset_info);
2512
protocol->store(STRING_WITH_LEN("Corrupt"), system_charset_info);
2506
protocol->store(STRING_WITH_LEN("error"));
2507
protocol->store(STRING_WITH_LEN("Corrupt"));
2516
2511
case HA_ADMIN_INVALID:
2517
protocol->store(STRING_WITH_LEN("error"), system_charset_info);
2518
protocol->store(STRING_WITH_LEN("Invalid argument"),
2519
system_charset_info);
2512
protocol->store(STRING_WITH_LEN("error"));
2513
protocol->store(STRING_WITH_LEN("Invalid argument"));
2522
2516
case HA_ADMIN_TRY_ALTER:
2563
2557
/* Hijack the row already in-progress. */
2564
protocol->store(STRING_WITH_LEN("error"), system_charset_info);
2565
protocol->store(err_msg, system_charset_info);
2558
protocol->store(STRING_WITH_LEN("error"));
2559
protocol->store(err_msg);
2566
2560
(void)protocol->write();
2567
2561
/* Start off another row for HA_ADMIN_FAILED */
2568
2562
protocol->prepareForResend();
2569
protocol->store(table_name, system_charset_info);
2570
protocol->store(operator_name, system_charset_info);
2563
protocol->store(table_name);
2564
protocol->store(operator_name);
2572
2566
session->clear_error();
2583
2577
char buf[ERRMSGSIZE];
2584
2578
uint32_t length;
2586
protocol->store(STRING_WITH_LEN("error"), system_charset_info);
2580
protocol->store(STRING_WITH_LEN("error"));
2587
2581
length=snprintf(buf, ERRMSGSIZE, ER(ER_TABLE_NEEDS_UPGRADE), table->table_name);
2588
protocol->store(buf, length, system_charset_info);
2582
protocol->store(buf, length);
2596
2590
uint32_t length=snprintf(buf, ERRMSGSIZE,
2597
2591
_("Unknown - internal error %d during operation"),
2599
protocol->store(STRING_WITH_LEN("error"), system_charset_info);
2600
protocol->store(buf, length, system_charset_info);
2593
protocol->store(STRING_WITH_LEN("error"));
2594
protocol->store(buf, length);