~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/create_table.cc

  • Committer: Brian Aker
  • Date: 2009-09-24 06:23:51 UTC
  • mfrom: (1128.2.12 merge)
  • Revision ID: brian@gaz-20090924062351-nuf8tv8ftg7oc9ad
Merge of Lex -> Statement refactoring

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
  bool link_to_local= false;
39
39
 
40
40
  /* If CREATE TABLE of non-temporary table, do implicit commit */
41
 
  if (! (session->lex->create_info.options & HA_LEX_CREATE_TMP_TABLE))
 
41
  if (! (create_info.options & HA_LEX_CREATE_TMP_TABLE))
42
42
  {
43
43
    if (! session->endActiveTransaction())
44
44
    {
48
48
  /* Skip first table, which is the table we are creating */
49
49
  TableList *create_table= session->lex->unlink_first_table(&link_to_local);
50
50
  TableList *select_tables= session->lex->query_tables;
51
 
  /*
52
 
     Code below (especially in mysql_create_table() and select_create
53
 
     methods) may modify HA_CREATE_INFO structure in LEX, so we have to
54
 
     use a copy of this structure to make execution prepared statement-
55
 
     safe. A shallow copy is enough as this code won't modify any memory
56
 
     referenced from this structure.
57
 
   */
58
 
  HA_CREATE_INFO create_info(session->lex->create_info);
59
 
  /*
60
 
     We need to copy alter_info for the same reasons of re-execution
61
 
     safety, only in case of AlterInfo we have to do (almost) a deep
62
 
     copy.
63
 
   */
64
 
  AlterInfo alter_info(session->lex->alter_info, session->mem_root);
65
 
 
66
 
  if (session->is_fatal_error)
67
 
  {
68
 
    /* If out of memory when creating a copy of alter_info. */
69
 
    /* put tables back for PS rexecuting */
70
 
    session->lex->link_first_table_back(create_table, link_to_local);
71
 
    return true;
72
 
  }
73
51
 
74
52
  if (create_table_precheck(session, select_tables, create_table))
75
53
  {
143
121
       */
144
122
      if ((result= new select_create(create_table,
145
123
                                     &create_info,
146
 
                                     session->lex->create_table_proto,
 
124
                                     &create_table_proto,
147
125
                                     &alter_info,
148
126
                                     select_lex->item_list,
149
127
                                     session->lex->duplicates,
182
160
                              create_table->db,
183
161
                              create_table->table_name, 
184
162
                              &create_info,
185
 
                              session->lex->create_table_proto,
 
163
                              &create_table_proto,
186
164
                              &alter_info, 
187
165
                              0, 
188
166
                              0);