~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/create_table.cc

Merged up with latest plugin-slot-reorg.

Show diffs side-by-side

added added

removed removed

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