~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_lex.cc

  • Committer: Jay Pipes
  • Date: 2009-09-15 21:01:42 UTC
  • mto: (1126.2.5 merge)
  • mto: This revision was merged to the branch mainline in revision 1128.
  • Revision ID: jpipes@serialcoder-20090915210142-x8mwiqn1q0vzjspp
Moves Alter_info out into its own header and source file, cleans up some related include mess in sql_lex.h, and renames Alter_info to AlterInfo.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1265
1265
  }
1266
1266
}
1267
1267
 
1268
 
/**
1269
 
  Construct a copy of this object to be used for mysql_alter_table
1270
 
  and mysql_create_table.
1271
 
 
1272
 
  Historically, these two functions modify their Alter_info
1273
 
  arguments. This behaviour breaks re-execution of prepared
1274
 
  statements and stored procedures and is compensated by always
1275
 
  supplying a copy of Alter_info to these functions.
1276
 
 
1277
 
  @return You need to use check the error in Session for out
1278
 
  of memory condition after calling this function.
1279
 
*/
1280
 
Alter_info::Alter_info(const Alter_info &rhs, MEM_ROOT *mem_root)
1281
 
  :drop_list(rhs.drop_list, mem_root),
1282
 
  alter_list(rhs.alter_list, mem_root),
1283
 
  key_list(rhs.key_list, mem_root),
1284
 
  create_list(rhs.create_list, mem_root),
1285
 
  flags(rhs.flags),
1286
 
  keys_onoff(rhs.keys_onoff),
1287
 
  tablespace_op(rhs.tablespace_op),
1288
 
  no_parts(rhs.no_parts),
1289
 
  build_method(rhs.build_method),
1290
 
  datetime_field(rhs.datetime_field),
1291
 
  error_if_not_empty(rhs.error_if_not_empty)
1292
 
{
1293
 
  /*
1294
 
    Make deep copies of used objects.
1295
 
    This is not a fully deep copy - clone() implementations
1296
 
    of Alter_drop, Alter_column, Key, foreign_key, Key_part_spec
1297
 
    do not copy string constants. At the same length the only
1298
 
    reason we make a copy currently is that ALTER/CREATE TABLE
1299
 
    code changes input Alter_info definitions, but string
1300
 
    constants never change.
1301
 
  */
1302
 
  list_copy_and_replace_each_value(drop_list, mem_root);
1303
 
  list_copy_and_replace_each_value(alter_list, mem_root);
1304
 
  list_copy_and_replace_each_value(key_list, mem_root);
1305
 
  list_copy_and_replace_each_value(create_list, mem_root);
1306
 
}
1307
 
 
1308
1268
void trim_whitespace(const CHARSET_INFO * const cs, LEX_STRING *str)
1309
1269
{
1310
1270
  /*