~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/handler.cc

  • Committer: Grant Limberg
  • Date: 2008-08-12 21:13:01 UTC
  • mto: (322.1.1 codestyle)
  • mto: This revision was merged to the branch mainline in revision 324.
  • Revision ID: grant@glsoftware.net-20080812211301-ym3wsowelkgp16s2
renamed all instances of MYSQL_ to DRIZZLE_

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
                           (const uchar *)STRING_WITH_LEN("DEFAULT"), 0))
118
118
    return ha_default_plugin(thd);
119
119
 
120
 
  if ((plugin= my_plugin_lock_by_name(thd, name, MYSQL_STORAGE_ENGINE_PLUGIN)))
 
120
  if ((plugin= my_plugin_lock_by_name(thd, name, DRIZZLE_STORAGE_ENGINE_PLUGIN)))
121
121
  {
122
122
    handlerton *hton= plugin_data(plugin, handlerton *);
123
123
    if (!(hton->flags & HTON_NOT_USER_SELECTABLE))
475
475
 
476
476
void ha_drop_database(char* path)
477
477
{
478
 
  plugin_foreach(NULL, dropdb_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN, path);
 
478
  plugin_foreach(NULL, dropdb_handlerton, DRIZZLE_STORAGE_ENGINE_PLUGIN, path);
479
479
}
480
480
 
481
481
 
500
500
*/
501
501
void ha_close_connection(THD* thd)
502
502
{
503
 
  plugin_foreach(thd, closecon_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN, 0);
 
503
  plugin_foreach(thd, closecon_handlerton, DRIZZLE_STORAGE_ENGINE_PLUGIN, 0);
504
504
}
505
505
 
506
506
/* ========================================================================
1234
1234
  xaop.result= 1;
1235
1235
 
1236
1236
  plugin_foreach(NULL, commit ? xacommit_handlerton : xarollback_handlerton,
1237
 
                 MYSQL_STORAGE_ENGINE_PLUGIN, &xaop);
 
1237
                 DRIZZLE_STORAGE_ENGINE_PLUGIN, &xaop);
1238
1238
 
1239
1239
  return xaop.result;
1240
1240
}
1355
1355
  }
1356
1356
 
1357
1357
  plugin_foreach(NULL, xarecover_handlerton, 
1358
 
                 MYSQL_STORAGE_ENGINE_PLUGIN, &info);
 
1358
                 DRIZZLE_STORAGE_ENGINE_PLUGIN, &info);
1359
1359
 
1360
1360
  my_free((uchar*)info.list, MYF(0));
1361
1361
  if (info.found_foreign_xids)
1457
1457
 
1458
1458
int ha_release_temporary_latches(THD *thd)
1459
1459
{
1460
 
  plugin_foreach(thd, release_temporary_latches, MYSQL_STORAGE_ENGINE_PLUGIN, 
 
1460
  plugin_foreach(thd, release_temporary_latches, DRIZZLE_STORAGE_ENGINE_PLUGIN, 
1461
1461
                 NULL);
1462
1462
 
1463
1463
  return 0;
1590
1590
{
1591
1591
  bool warn= true;
1592
1592
 
1593
 
  plugin_foreach(thd, snapshot_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN, &warn);
 
1593
  plugin_foreach(thd, snapshot_handlerton, DRIZZLE_STORAGE_ENGINE_PLUGIN, &warn);
1594
1594
 
1595
1595
  /*
1596
1596
    Same idea as when one wants to CREATE TABLE in one engine which does not
1621
1621
  if (db_type == NULL)
1622
1622
  {
1623
1623
    if (plugin_foreach(NULL, flush_handlerton,
1624
 
                          MYSQL_STORAGE_ENGINE_PLUGIN, 0))
 
1624
                          DRIZZLE_STORAGE_ENGINE_PLUGIN, 0))
1625
1625
      return true;
1626
1626
  }
1627
1627
  else
2567
2567
    update frm version for temporary tables as this code doesn't support
2568
2568
    temporary tables.
2569
2569
  */
2570
 
  if (table->s->mysql_version == MYSQL_VERSION_ID)
 
2570
  if (table->s->mysql_version == DRIZZLE_VERSION_ID)
2571
2571
    return(0);
2572
2572
 
2573
2573
  strxmov(path, table->s->normalized_path.str, reg_ext, NullS);
2580
2580
    TABLE *entry;
2581
2581
    HASH_SEARCH_STATE state;
2582
2582
 
2583
 
    int4store(version, MYSQL_VERSION_ID);
 
2583
    int4store(version, DRIZZLE_VERSION_ID);
2584
2584
 
2585
2585
    if (pwrite(file, (uchar*)version, 4, 51L) == 0)
2586
2586
    {
2591
2591
    for (entry=(TABLE*) hash_first(&open_cache,(uchar*) key,key_length, &state);
2592
2592
         entry;
2593
2593
         entry= (TABLE*) hash_next(&open_cache,(uchar*) key,key_length, &state))
2594
 
      entry->s->mysql_version= MYSQL_VERSION_ID;
 
2594
      entry->s->mysql_version= DRIZZLE_VERSION_ID;
2595
2595
  }
2596
2596
err:
2597
2597
  if (file >= 0)
2695
2695
{
2696
2696
  int error;
2697
2697
 
2698
 
  if ((table->s->mysql_version >= MYSQL_VERSION_ID) &&
 
2698
  if ((table->s->mysql_version >= DRIZZLE_VERSION_ID) &&
2699
2699
      (check_opt->sql_flags & TT_FOR_UPGRADE))
2700
2700
    return 0;
2701
2701
 
2702
 
  if (table->s->mysql_version < MYSQL_VERSION_ID)
 
2702
  if (table->s->mysql_version < DRIZZLE_VERSION_ID)
2703
2703
  {
2704
2704
    if ((error= check_old_types()))
2705
2705
      return error;
3317
3317
    return(error);
3318
3318
 
3319
3319
  if (plugin_foreach(thd, discover_handlerton,
3320
 
                 MYSQL_STORAGE_ENGINE_PLUGIN, &args))
 
3320
                 DRIZZLE_STORAGE_ENGINE_PLUGIN, &args))
3321
3321
    error= 0;
3322
3322
 
3323
3323
  if (!error)
3378
3378
{
3379
3379
  st_table_exists_in_engine_args args= {db, name, HA_ERR_NO_SUCH_TABLE};
3380
3380
  plugin_foreach(thd, table_exists_in_engine_handlerton,
3381
 
                 MYSQL_STORAGE_ENGINE_PLUGIN, &args);
 
3381
                 DRIZZLE_STORAGE_ENGINE_PLUGIN, &args);
3382
3382
  return(args.err);
3383
3383
}
3384
3384
 
4446
4446
    known_extensions_id= mysys_usage_id;
4447
4447
 
4448
4448
    plugin_foreach(NULL, exts_handlerton,
4449
 
                   MYSQL_STORAGE_ENGINE_PLUGIN, &found_exts);
 
4449
                   DRIZZLE_STORAGE_ENGINE_PLUGIN, &found_exts);
4450
4450
 
4451
4451
    ext= (const char **) my_once_alloc(sizeof(char *)*
4452
4452
                                       (found_exts.elements+1),
4556
4556
{
4557
4557
  if (thd->get_binlog_table_maps() == 0)
4558
4558
  {
4559
 
    MYSQL_LOCK *locks[3];
 
4559
    DRIZZLE_LOCK *locks[3];
4560
4560
    locks[0]= thd->extra_lock;
4561
4561
    locks[1]= thd->lock;
4562
4562
    locks[2]= thd->locked_tables;
4563
4563
    for (uint i= 0 ; i < sizeof(locks)/sizeof(*locks) ; ++i )
4564
4564
    {
4565
 
      MYSQL_LOCK const *const lock= locks[i];
 
4565
      DRIZZLE_LOCK const *const lock= locks[i];
4566
4566
      if (lock == NULL)
4567
4567
        continue;
4568
4568
 
4632
4632
    We cache the table flags if the locking succeeded. Otherwise, we
4633
4633
    keep them as they were when they were fetched in ha_open().
4634
4634
  */
4635
 
  MYSQL_EXTERNAL_LOCK(lock_type);
 
4635
  DRIZZLE_EXTERNAL_LOCK(lock_type);
4636
4636
 
4637
4637
  int error= external_lock(thd, lock_type);
4638
4638
  if (error == 0)
4666
4666
{
4667
4667
  int error;
4668
4668
  Log_func *log_func= Write_rows_log_event::binlog_row_logging_function;
4669
 
  MYSQL_INSERT_ROW_START();
 
4669
  DRIZZLE_INSERT_ROW_START();
4670
4670
 
4671
4671
  mark_trx_read_write();
4672
4672
 
4674
4674
    return(error);
4675
4675
  if (unlikely(error= binlog_log_row(table, 0, buf, log_func)))
4676
4676
    return(error); /* purecov: inspected */
4677
 
  MYSQL_INSERT_ROW_END();
 
4677
  DRIZZLE_INSERT_ROW_END();
4678
4678
  return(0);
4679
4679
}
4680
4680