~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/sql_insert.cc

  • Committer: Jay Pipes
  • Date: 2008-07-21 17:52:33 UTC
  • mto: (201.2.1 drizzle)
  • mto: This revision was merged to the branch mainline in revision 204.
  • Revision ID: jay@mysql.com-20080721175233-mtyz298j8xl3v63y
cleanup of FAQ file

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
  Drizzle has a different form of DELAYED then MySQL. DELAYED is just
23
23
  a hint to the the sorage engine (which can then do whatever it likes.
24
24
*/
25
 
#include <drizzled/server_includes.h>
26
 
#include <drizzled/sql_select.h>
27
 
#include <drizzled/sql_show.h>
 
25
 
 
26
#include "mysql_priv.h"
 
27
#include "sql_select.h"
 
28
#include "sql_show.h"
 
29
#include "slave.h"
28
30
#include "rpl_mi.h"
29
 
#include <drizzled/drizzled_error_messages.h>
30
31
 
31
32
/* Define to force use of my_malloc() if the allocated memory block is big */
32
33
 
34
35
#define my_safe_alloca(size, min_length) my_alloca(size)
35
36
#define my_safe_afree(ptr, size, min_length) my_afree(ptr)
36
37
#else
37
 
#define my_safe_alloca(size, min_length) ((size <= min_length) ? my_alloca(size) : malloc(size))
38
 
#define my_safe_afree(ptr, size, min_length) if (size > min_length) free(ptr)
 
38
#define my_safe_alloca(size, min_length) ((size <= min_length) ? my_alloca(size) : my_malloc(size,MYF(0)))
 
39
#define my_safe_afree(ptr, size, min_length) if (size > min_length) my_free(ptr,MYF(0))
39
40
#endif
40
41
 
41
42
 
61
62
    -1          Error
62
63
*/
63
64
 
64
 
static int check_insert_fields(THD *thd, TableList *table_list,
 
65
static int check_insert_fields(THD *thd, TABLE_LIST *table_list,
65
66
                               List<Item> &fields, List<Item> &values,
66
67
                               bool check_unique,
67
 
                               table_map *map __attribute__((unused)))
 
68
                               table_map *map __attribute__((__unused__)))
68
69
{
69
 
  Table *table= table_list->table;
 
70
  TABLE *table= table_list->table;
70
71
 
71
72
  if (fields.elements == 0 && values.elements != 0)
72
73
  {
132
133
                       table->timestamp_field->field_index);
133
134
      }
134
135
    }
135
 
    /* Mark all virtual columns for write*/
136
 
    if (table->vfield)
137
 
      table->mark_virtual_columns();
138
136
  }
139
137
 
140
138
  return 0;
160
158
    -1          Error
161
159
*/
162
160
 
163
 
static int check_update_fields(THD *thd, TableList *insert_table_list,
 
161
static int check_update_fields(THD *thd, TABLE_LIST *insert_table_list,
164
162
                               List<Item> &update_fields,
165
 
                               table_map *map __attribute__((unused)))
 
163
                               table_map *map __attribute__((__unused__)))
166
164
{
167
 
  Table *table= insert_table_list->table;
 
165
  TABLE *table= insert_table_list->table;
168
166
  bool timestamp_mark= false;
169
167
 
170
168
  if (table->timestamp_field)
205
203
*/
206
204
 
207
205
static
208
 
void upgrade_lock_type(THD *thd __attribute__((unused)),
 
206
void upgrade_lock_type(THD *thd __attribute__((__unused__)),
209
207
                       thr_lock_type *lock_type,
210
208
                       enum_duplicates duplic,
211
 
                       bool is_multi_insert __attribute__((unused)))
 
209
                       bool is_multi_insert __attribute__((__unused__)))
212
210
{
213
211
  if (duplic == DUP_UPDATE ||
214
212
      (duplic == DUP_REPLACE && *lock_type == TL_WRITE_CONCURRENT_INSERT))
227
225
  end of dispatch_command().
228
226
*/
229
227
 
230
 
bool mysql_insert(THD *thd,TableList *table_list,
 
228
bool mysql_insert(THD *thd,TABLE_LIST *table_list,
231
229
                  List<Item> &fields,
232
230
                  List<List_item> &values_list,
233
231
                  List<Item> &update_fields,
239
237
  bool transactional_table, joins_freed= false;
240
238
  bool changed;
241
239
  bool was_insert_delayed= (table_list->lock_type ==  TL_WRITE_DELAYED);
242
 
  uint32_t value_count;
 
240
  uint value_count;
243
241
  ulong counter = 1;
244
242
  uint64_t id;
245
243
  COPY_INFO info;
246
 
  Table *table= 0;
 
244
  TABLE *table= 0;
247
245
  List_iterator_fast<List_item> its(values_list);
248
246
  List_item *values;
249
247
  Name_resolution_context *context;
279
277
  }
280
278
  lock_type= table_list->lock_type;
281
279
 
282
 
  thd->set_proc_info("init");
 
280
  thd_proc_info(thd, "init");
283
281
  thd->used_tables=0;
284
282
  values= its++;
285
283
  value_count= values->elements;
333
331
  /*
334
332
    Fill in the given fields and dump it to the table file
335
333
  */
336
 
  memset(&info, 0, sizeof(info));
 
334
  bzero((char*) &info,sizeof(info));
337
335
  info.ignore= ignore;
338
336
  info.handle_duplicates=duplic;
339
337
  info.update_fields= &update_fields;
351
349
  thd->cuted_fields = 0L;
352
350
  table->next_number_field=table->found_next_number_field;
353
351
 
 
352
#ifdef HAVE_REPLICATION
354
353
  if (thd->slave_thread &&
355
354
      (info.handle_duplicates == DUP_UPDATE) &&
356
355
      (table->next_number_field != NULL) &&
357
356
      rpl_master_has_bug(&active_mi->rli, 24432))
358
357
    goto abort;
 
358
#endif
359
359
 
360
360
  error=0;
361
 
  thd->set_proc_info("update");
 
361
  thd_proc_info(thd, "update");
362
362
  if (duplic == DUP_REPLACE)
363
363
    table->file->extra(HA_EXTRA_WRITE_CAN_REPLACE);
364
364
  if (duplic == DUP_UPDATE)
436
436
  {
437
437
    /*
438
438
      Do not do this release if this is a delayed insert, it would steal
439
 
      auto_inc values from the delayed_insert thread as they share Table.
 
439
      auto_inc values from the delayed_insert thread as they share TABLE.
440
440
    */
441
441
    table->file->ha_release_auto_increment();
442
442
    if (table->file->ha_end_bulk_insert() && !error)
504
504
                thd->transaction.stmt.modified_non_trans_table);
505
505
 
506
506
  }
507
 
  thd->set_proc_info("end");
 
507
  thd_proc_info(thd, "end");
508
508
  /*
509
509
    We'll report to the client this id:
510
510
    - if the table contains an autoincrement column and we successfully
552
552
    ::my_ok(thd, (ulong) thd->row_count_func, id, buff);
553
553
  }
554
554
  thd->abort_on_warning= 0;
555
 
  DRIZZLE_INSERT_END();
 
555
  MYSQL_INSERT_END();
556
556
  return(false);
557
557
 
558
558
abort:
561
561
  if (!joins_freed)
562
562
    free_underlaid_joins(thd, &thd->lex->select_lex);
563
563
  thd->abort_on_warning= 0;
564
 
  DRIZZLE_INSERT_END();
 
564
  MYSQL_INSERT_END();
565
565
  return(true);
566
566
}
567
567
 
582
582
     true  ERROR
583
583
*/
584
584
 
585
 
static bool mysql_prepare_insert_check_table(THD *thd, TableList *table_list,
586
 
                                             List<Item> &fields __attribute__((unused)),
 
585
static bool mysql_prepare_insert_check_table(THD *thd, TABLE_LIST *table_list,
 
586
                                             List<Item> &fields __attribute__((__unused__)),
587
587
                                             bool select_insert)
588
588
{
589
589
  
637
637
    true  error
638
638
*/
639
639
 
640
 
bool mysql_prepare_insert(THD *thd, TableList *table_list,
641
 
                          Table *table, List<Item> &fields, List_item *values,
 
640
bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list,
 
641
                          TABLE *table, List<Item> &fields, List_item *values,
642
642
                          List<Item> &update_fields, List<Item> &update_values,
643
643
                          enum_duplicates duplic,
644
 
                          COND **where __attribute__((unused)),
 
644
                          COND **where __attribute__((__unused__)),
645
645
                          bool select_insert,
646
646
                          bool check_fields, bool abort_on_warning)
647
647
{
737
737
 
738
738
  if (!select_insert)
739
739
  {
740
 
    TableList *duplicate;
 
740
    TABLE_LIST *duplicate;
741
741
    if ((duplicate= unique_table(thd, table_list, table_list->next_global, 1)))
742
742
    {
743
743
      update_non_unique_table_error(table_list, "INSERT", duplicate);
744
744
      return(true);
745
745
    }
 
746
    select_lex->first_execution= 0;
746
747
  }
747
748
  if (duplic == DUP_UPDATE || duplic == DUP_REPLACE)
748
749
    table->prepare_for_position();
752
753
 
753
754
        /* Check if there is more uniq keys after field */
754
755
 
755
 
static int last_uniq_key(Table *table,uint32_t keynr)
 
756
static int last_uniq_key(TABLE *table,uint keynr)
756
757
{
757
758
  while (++keynr < table->s->keys)
758
759
    if (table->key_info[keynr].flags & HA_NOSAME)
788
789
*/
789
790
 
790
791
 
791
 
int write_record(THD *thd, Table *table,COPY_INFO *info)
 
792
int write_record(THD *thd, TABLE *table,COPY_INFO *info)
792
793
{
793
794
  int error;
794
795
  char *key=0;
806
807
  {
807
808
    while ((error=table->file->ha_write_row(table->record[0])))
808
809
    {
809
 
      uint32_t key_nr;
 
810
      uint key_nr;
810
811
      /*
811
812
        If we do more than one iteration of this loop, from the second one the
812
813
        row will have an explicit value in the autoinc field, which was set at
872
873
            goto err;
873
874
          }
874
875
        }
875
 
        key_copy((unsigned char*) key,table->record[0],table->key_info+key_nr,0);
 
876
        key_copy((uchar*) key,table->record[0],table->key_info+key_nr,0);
876
877
        if ((error=(table->file->index_read_idx_map(table->record[1],key_nr,
877
 
                                                    (unsigned char*) key, HA_WHOLE_KEY,
 
878
                                                    (uchar*) key, HA_WHOLE_KEY,
878
879
                                                    HA_READ_KEY_EXACT))))
879
880
          goto err;
880
881
      }
902
903
        info->touched++;
903
904
        if ((table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ &&
904
905
             !bitmap_is_subset(table->write_set, table->read_set)) ||
905
 
            table->compare_record())
 
906
            compare_record(table))
906
907
        {
907
908
          if ((error=table->file->ha_update_row(table->record[1],
908
909
                                                table->record[0])) &&
1034
1035
  Check that all fields with arn't null_fields are used
1035
1036
******************************************************************************/
1036
1037
 
1037
 
int check_that_all_fields_are_given_values(THD *thd, Table *entry,
1038
 
                                           TableList *table_list)
 
1038
int check_that_all_fields_are_given_values(THD *thd, TABLE *entry,
 
1039
                                           TABLE_LIST *table_list)
1039
1040
{
1040
1041
  int err= 0;
1041
1042
  MY_BITMAP *write_set= entry->write_set;
1044
1045
  {
1045
1046
    if (!bitmap_is_set(write_set, (*field)->field_index) &&
1046
1047
        ((*field)->flags & NO_DEFAULT_VALUE_FLAG) &&
1047
 
        ((*field)->real_type() != DRIZZLE_TYPE_ENUM))
 
1048
        ((*field)->real_type() != MYSQL_TYPE_ENUM))
1048
1049
    {
1049
1050
      bool view= false;
1050
1051
      if (table_list)
1053
1054
        view= test(0);
1054
1055
      }
1055
1056
      {
1056
 
        push_warning_printf(thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
 
1057
        push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
1057
1058
                            ER_NO_DEFAULT_FOR_FIELD,
1058
1059
                            ER(ER_NO_DEFAULT_FOR_FIELD),
1059
1060
                            (*field)->field_name);
1085
1086
{
1086
1087
  LEX *lex= thd->lex;
1087
1088
  SELECT_LEX *select_lex= &lex->select_lex;
 
1089
  TABLE_LIST *first_select_leaf_table;
1088
1090
  
1089
1091
 
1090
1092
  /*
1119
1121
  assert(select_lex->leaf_tables != 0);
1120
1122
  lex->leaf_tables_insert= select_lex->leaf_tables;
1121
1123
  /* skip all leaf tables belonged to view where we are insert */
1122
 
  select_lex->leaf_tables= select_lex->leaf_tables->next_leaf;
 
1124
  for (first_select_leaf_table= select_lex->leaf_tables->next_leaf;
 
1125
       first_select_leaf_table &&
 
1126
       first_select_leaf_table->belong_to_view &&
 
1127
       first_select_leaf_table->belong_to_view ==
 
1128
       lex->leaf_tables_insert->belong_to_view;
 
1129
       first_select_leaf_table= first_select_leaf_table->next_leaf)
 
1130
  {}
 
1131
  select_lex->leaf_tables= first_select_leaf_table;
1123
1132
  return(false);
1124
1133
}
1125
1134
 
1126
1135
 
1127
 
select_insert::select_insert(TableList *table_list_par, Table *table_par,
 
1136
select_insert::select_insert(TABLE_LIST *table_list_par, TABLE *table_par,
1128
1137
                             List<Item> *fields_par,
1129
1138
                             List<Item> *update_fields,
1130
1139
                             List<Item> *update_values,
1134
1143
   autoinc_value_of_last_inserted_row(0),
1135
1144
   insert_into_view(table_list_par && 0 != 0)
1136
1145
{
1137
 
  memset(&info, 0, sizeof(info));
 
1146
  bzero((char*) &info,sizeof(info));
1138
1147
  info.handle_duplicates= duplic;
1139
1148
  info.ignore= ignore_check_option_errors;
1140
1149
  info.update_fields= update_fields;
1218
1227
      while ((item= li++))
1219
1228
      {
1220
1229
        item->transform(&Item::update_value_transformer,
1221
 
                        (unsigned char*)lex->current_select);
 
1230
                        (uchar*)lex->current_select);
1222
1231
      }
1223
1232
    }
1224
1233
 
1261
1270
  restore_record(table,s->default_values);              // Get empty record
1262
1271
  table->next_number_field=table->found_next_number_field;
1263
1272
 
 
1273
#ifdef HAVE_REPLICATION
1264
1274
  if (thd->slave_thread &&
1265
1275
      (info.handle_duplicates == DUP_UPDATE) &&
1266
1276
      (table->next_number_field != NULL) &&
1267
1277
      rpl_master_has_bug(&active_mi->rli, 24432))
1268
1278
    return(1);
 
1279
#endif
1269
1280
 
1270
1281
  thd->cuted_fields=0;
1271
1282
  if (info.ignore || info.handle_duplicates != DUP_ERROR)
1389
1400
    fill_record(thd, table->field, values, 1);
1390
1401
}
1391
1402
 
1392
 
void select_insert::send_error(uint32_t errcode,const char *err)
 
1403
void select_insert::send_error(uint errcode,const char *err)
1393
1404
{
1394
1405
  
1395
1406
 
1517
1528
***************************************************************************/
1518
1529
 
1519
1530
/*
1520
 
  Create table from lists of fields and items (or just return Table
 
1531
  Create table from lists of fields and items (or just return TABLE
1521
1532
  object for pre-opened existing table).
1522
1533
 
1523
1534
  SYNOPSIS
1525
1536
      thd          in     Thread object
1526
1537
      create_info  in     Create information (like MAX_ROWS, ENGINE or
1527
1538
                          temporary table flag)
1528
 
      create_table in     Pointer to TableList object providing database
 
1539
      create_table in     Pointer to TABLE_LIST object providing database
1529
1540
                          and name for table to be created or to be open
1530
1541
      alter_info   in/out Initial list of columns and indexes for the table
1531
1542
                          to be created
1532
1543
      items        in     List of items which should be used to produce rest
1533
1544
                          of fields for the table (corresponding fields will
1534
1545
                          be added to the end of alter_info->create_list)
1535
 
      lock         out    Pointer to the DRIZZLE_LOCK object for table created
 
1546
      lock         out    Pointer to the MYSQL_LOCK object for table created
1536
1547
                          (or open temporary table) will be returned in this
1537
1548
                          parameter. Since this table is not included in
1538
1549
                          THD::lock caller is responsible for explicitly
1543
1554
    This function behaves differently for base and temporary tables:
1544
1555
    - For base table we assume that either table exists and was pre-opened
1545
1556
      and locked at open_and_lock_tables() stage (and in this case we just
1546
 
      emit error or warning and return pre-opened Table object) or special
 
1557
      emit error or warning and return pre-opened TABLE object) or special
1547
1558
      placeholder was put in table cache that guarantees that this table
1548
1559
      won't be created or opened until the placeholder will be removed
1549
1560
      (so there is an exclusive lock on this table).
1554
1565
    SELECT it should be changed before it can be used in other contexts.
1555
1566
 
1556
1567
  RETURN VALUES
1557
 
    non-zero  Pointer to Table object for table created or opened
 
1568
    non-zero  Pointer to TABLE object for table created or opened
1558
1569
    0         Error
1559
1570
*/
1560
1571
 
1561
 
static Table *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
1562
 
                                      TableList *create_table,
 
1572
static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
 
1573
                                      TABLE_LIST *create_table,
1563
1574
                                      Alter_info *alter_info,
1564
1575
                                      List<Item> *items,
1565
 
                                      DRIZZLE_LOCK **lock,
 
1576
                                      MYSQL_LOCK **lock,
1566
1577
                                      TABLEOP_HOOKS *hooks)
1567
1578
{
1568
 
  Table tmp_table;              // Used during 'Create_field()'
 
1579
  TABLE tmp_table;              // Used during 'Create_field()'
1569
1580
  TABLE_SHARE share;
1570
 
  Table *table= 0;
1571
 
  uint32_t select_field_count= items->elements;
 
1581
  TABLE *table= 0;
 
1582
  uint select_field_count= items->elements;
1572
1583
  /* Add selected items to field list */
1573
1584
  List_iterator_fast<Item> it(*items);
1574
1585
  Item *item;
1582
1593
    if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
1583
1594
    {
1584
1595
      create_info->table_existed= 1;            // Mark that table existed
1585
 
      push_warning_printf(thd, DRIZZLE_ERROR::WARN_LEVEL_NOTE,
 
1596
      push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
1586
1597
                          ER_TABLE_EXISTS_ERROR, ER(ER_TABLE_EXISTS_ERROR),
1587
1598
                          create_table->table_name);
1588
1599
      return(create_table->table);
1602
1613
  tmp_table.s->db_low_byte_first= 
1603
1614
        test(create_info->db_type == myisam_hton ||
1604
1615
             create_info->db_type == heap_hton);
1605
 
  tmp_table.null_row= false;
1606
 
  tmp_table.maybe_null= false;
 
1616
  tmp_table.null_row=tmp_table.maybe_null=0;
1607
1617
 
1608
1618
  while ((item=it++))
1609
1619
  {
1641
1651
    binlog when a HEAP table is opened for the first time since startup, must
1642
1652
    not be written: 1) it would be wrong (imagine we're in CREATE SELECT: we
1643
1653
    don't want to delete from it) 2) it would be written before the CREATE
1644
 
    Table, which is a wrong order. So we keep binary logging disabled when we
 
1654
    TABLE, which is a wrong order. So we keep binary logging disabled when we
1645
1655
    open_table().
1646
1656
  */
1647
1657
  {
1649
1659
    if (!mysql_create_table_no_lock(thd, create_table->db,
1650
1660
                                    create_table->table_name,
1651
1661
                                    create_info, alter_info, 0,
1652
 
                                    select_field_count, true))
 
1662
                                    select_field_count))
1653
1663
    {
1654
1664
      if (create_info->table_existed &&
1655
1665
          !(create_info->options & HA_LEX_CREATE_TMP_TABLE))
1665
1675
 
1666
1676
      if (!(create_info->options & HA_LEX_CREATE_TMP_TABLE))
1667
1677
      {
1668
 
        pthread_mutex_lock(&LOCK_open);
 
1678
        VOID(pthread_mutex_lock(&LOCK_open));
1669
1679
        if (reopen_name_locked_table(thd, create_table, false))
1670
1680
        {
1671
1681
          quick_rm_table(create_info->db_type, create_table->db,
1674
1684
        }
1675
1685
        else
1676
1686
          table= create_table->table;
1677
 
        pthread_mutex_unlock(&LOCK_open);
 
1687
        VOID(pthread_mutex_unlock(&LOCK_open));
1678
1688
      }
1679
1689
      else
1680
1690
      {
1681
 
        if (!(table= open_table(thd, create_table, (bool*) 0,
1682
 
                                DRIZZLE_OPEN_TEMPORARY_ONLY)) &&
 
1691
        if (!(table= open_table(thd, create_table, thd->mem_root, (bool*) 0,
 
1692
                                MYSQL_OPEN_TEMPORARY_ONLY)) &&
1683
1693
            !create_info->table_existed)
1684
1694
        {
1685
1695
          /*
1699
1709
  table->reginfo.lock_type=TL_WRITE;
1700
1710
  hooks->prelock(&table, 1);                    // Call prelock hooks
1701
1711
  if (! ((*lock)= mysql_lock_tables(thd, &table, 1,
1702
 
                                    DRIZZLE_LOCK_IGNORE_FLUSH, &not_used)) ||
 
1712
                                    MYSQL_LOCK_IGNORE_FLUSH, &not_used)) ||
1703
1713
        hooks->postlock(&table, 1))
1704
1714
  {
1705
1715
    if (*lock)
1719
1729
int
1720
1730
select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
1721
1731
{
1722
 
  DRIZZLE_LOCK *extra_lock= NULL;
 
1732
  MYSQL_LOCK *extra_lock= NULL;
1723
1733
  
1724
1734
 
1725
1735
  TABLEOP_HOOKS *hook_ptr= NULL;
1743
1753
   */
1744
1754
  class MY_HOOKS : public TABLEOP_HOOKS {
1745
1755
  public:
1746
 
    MY_HOOKS(select_create *x, TableList *create_table,
1747
 
             TableList *select_tables)
 
1756
    MY_HOOKS(select_create *x, TABLE_LIST *create_table,
 
1757
             TABLE_LIST *select_tables)
1748
1758
      : ptr(x), all_tables(*create_table)
1749
1759
      {
1750
1760
        all_tables.next_global= select_tables;
1751
1761
      }
1752
1762
 
1753
1763
  private:
1754
 
    virtual int do_postlock(Table **tables, uint32_t count)
 
1764
    virtual int do_postlock(TABLE **tables, uint count)
1755
1765
    {
1756
1766
      THD *thd= const_cast<THD*>(ptr->get_thd());
1757
1767
      if (int error= decide_logging_format(thd, &all_tables))
1758
1768
        return error;
1759
1769
 
1760
 
      Table const *const table = *tables;
 
1770
      TABLE const *const table = *tables;
1761
1771
      if (thd->current_stmt_binlog_row_based  &&
1762
1772
          !table->s->tmp_table &&
1763
1773
          !ptr->get_create_info()->table_existed)
1768
1778
    }
1769
1779
 
1770
1780
    select_create *ptr;
1771
 
    TableList all_tables;
 
1781
    TABLE_LIST all_tables;
1772
1782
  };
1773
1783
 
1774
1784
  MY_HOOKS hooks(this, create_table, select_tables);
1839
1849
}
1840
1850
 
1841
1851
void
1842
 
select_create::binlog_show_create_table(Table **tables, uint32_t count)
 
1852
select_create::binlog_show_create_table(TABLE **tables, uint count)
1843
1853
{
1844
1854
  /*
1845
1855
    Note 1: In RBR mode, we generate a CREATE TABLE statement for the
1864
1874
  char buf[2048];
1865
1875
  String query(buf, sizeof(buf), system_charset_info);
1866
1876
  int result;
1867
 
  TableList tmp_table_list;
 
1877
  TABLE_LIST tmp_table_list;
1868
1878
 
1869
1879
  memset(&tmp_table_list, 0, sizeof(tmp_table_list));
1870
1880
  tmp_table_list.table = *tables;
1885
1895
}
1886
1896
 
1887
1897
 
1888
 
void select_create::send_error(uint32_t errcode,const char *err)
 
1898
void select_create::send_error(uint errcode,const char *err)
1889
1899
{
1890
1900
  
1891
1901