~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • Committer: Monty Taylor
  • Date: 2009-06-08 13:39:05 UTC
  • mto: This revision was merged to the branch mainline in revision 1060.
  • Revision ID: mordred@inaugust.com-20090608133905-3hogrrafmfg6e5hs
Removed CHARSET_INFO stuff from protocol plugin interface - it makes no sense.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2103
2103
{
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())
2112
2112
    return -1;
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),
2383
2383
                       table_name);
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();
2414
2414
    {
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())
2423
2422
        goto err;
2424
2423
      /* purecov: end */
2455
2454
      while ((err= it++))
2456
2455
      {
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())
2465
2463
          goto err;
2466
2464
      }
2467
2465
      drizzle_reset_errors(session, true);
2468
2466
    }
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);
2472
2470
 
2473
2471
send_result_message:
2474
2472
 
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);
2483
2481
      }
2484
2482
      break;
2485
2483
 
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"));
2489
2487
      break;
2490
2488
 
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"));
2495
2492
      break;
2496
2493
 
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;
2502
2498
      break;
2503
2499
 
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"));
2508
2503
      break;
2509
2504
 
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"));
2513
2508
      fatal_error=1;
2514
2509
      break;
2515
2510
 
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"));
2520
2514
      break;
2521
2515
 
2522
2516
    case HA_ADMIN_TRY_ALTER:
2561
2555
          else
2562
2556
          {
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);
2571
2565
          }
2572
2566
          session->clear_error();
2573
2567
        }
2583
2577
      char buf[ERRMSGSIZE];
2584
2578
      uint32_t length;
2585
2579
 
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);
2589
2583
      fatal_error=1;
2590
2584
      break;
2591
2585
    }
2596
2590
        uint32_t length=snprintf(buf, ERRMSGSIZE,
2597
2591
                             _("Unknown - internal error %d during operation"),
2598
2592
                             result_code);
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);
2601
2595
        fatal_error=1;
2602
2596
        break;
2603
2597
      }
4525
4519
    session->clear_error();                     // these errors shouldn't get client
4526
4520
 
4527
4521
    protocol->prepareForResend();
4528
 
    protocol->store(table_name, system_charset_info);
 
4522
    protocol->store(table_name);
4529
4523
 
4530
4524
    if (!t)
4531
4525
    {