~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/handler/ha_innodb.cc

  • Committer: Brian Aker
  • Date: 2009-11-20 19:07:14 UTC
  • mfrom: (1223.1.5 push)
  • Revision ID: brian@gaz-20091120190714-dhr3lgqxrt7dq1fc
Collected Merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
383
383
  UNIV_INTERN int doCreateTable(Session *session, 
384
384
                                const char *table_name,
385
385
                                Table& form,
386
 
                                HA_CREATE_INFO& create_info,
387
386
                                drizzled::message::Table&);
388
387
  UNIV_INTERN int doRenameTable(Session* session,
389
388
                                const char* from, 
5371
5370
        Session*        session,        /*!< in: connection thread. */
5372
5371
        Table&          form,           /*!< in: information on table
5373
5372
                                        columns and indexes */
5374
 
        HA_CREATE_INFO& create_info,
5375
5373
        drizzled::message::Table& create_proto)
5376
5374
{
5377
5375
        ibool   kbs_specified   = FALSE;
5429
5427
        }
5430
5428
 
5431
5429
        /* Now check for ROW_FORMAT specifier. */
5432
 
        if (create_info.used_fields & HA_CREATE_USED_ROW_FORMAT) {
 
5430
        if (create_proto.options().has_row_type()) {
5433
5431
                switch (form.s->row_type) {
5434
5432
                        const char* row_format_name;
5435
5433
                case ROW_TYPE_COMPRESSED:
5531
5529
        const char*     table_name,     /*!< in: table name */
5532
5530
        Table&          form,           /*!< in: information on table
5533
5531
                                        columns and indexes */
5534
 
        HA_CREATE_INFO& create_info,    /*!< in: more information of the
5535
 
                                        created table, contains also the
5536
 
                                        create statement string */
5537
5532
        drizzled::message::Table& create_proto)
5538
5533
{
5539
5534
        int             error;
5549
5544
        /* Cache the value of innodb_file_format, in case it is
5550
5545
        modified by another thread while the table is being created. */
5551
5546
        const ulint     file_format = srv_file_format;
 
5547
        bool lex_identified_temp_table= (create_proto.type() == drizzled::message::Table::TEMPORARY);
5552
5548
 
5553
5549
        assert(session != NULL);
5554
5550
 
5564
5560
        table. Currently InnoDB does not support symbolic link on Windows. */
5565
5561
 
5566
5562
        if (srv_file_per_table
5567
 
            && (!create_info.options & HA_LEX_CREATE_TMP_TABLE)) {
 
5563
            && (! lex_identified_temp_table)) {
5568
5564
 
5569
5565
                if ((table_name[1] == ':')
5570
5566
                    || (table_name[0] == '\\' && table_name[1] == '\\')) {
5610
5606
        iflags = 0;
5611
5607
 
5612
5608
        /* Validate create options if innodb_strict_mode is set. */
5613
 
        if (!create_options_are_valid(session, form, create_info, create_proto)) {
 
5609
        if (! create_options_are_valid(session, form, create_proto)) {
5614
5610
                error = ER_ILLEGAL_HA_CREATE_OPTION;
5615
5611
                goto cleanup;
5616
5612
        }
5659
5655
                }
5660
5656
        }
5661
5657
 
5662
 
        if (create_info.used_fields & HA_CREATE_USED_ROW_FORMAT) {
 
5658
        if (create_proto.options().has_row_type()) {
5663
5659
                if (iflags) {
5664
5660
                        /* KEY_BLOCK_SIZE was specified. */
5665
5661
                        if (form.s->row_type != ROW_TYPE_COMPRESSED) {
5734
5730
                case ROW_TYPE_NOT_USED:
5735
5731
                case ROW_TYPE_FIXED:
5736
5732
                default:
5737
 
                        push_warning(session,
5738
 
                                     DRIZZLE_ERROR::WARN_LEVEL_WARN,
5739
 
                                     ER_ILLEGAL_HA_CREATE_OPTION,
5740
 
                                     "InnoDB: assuming ROW_FORMAT=COMPACT.");
 
5733
                        error = ER_ILLEGAL_HA_CREATE_OPTION;
 
5734
                        goto cleanup;
5741
5735
                case ROW_TYPE_DEFAULT:
5742
5736
                case ROW_TYPE_COMPACT:
5743
5737
                        iflags = DICT_TF_COMPACT;
5750
5744
        }
5751
5745
 
5752
5746
        error = create_table_def(trx, &form, norm_name,
5753
 
                create_info.options & HA_LEX_CREATE_TMP_TABLE ? name2 : NULL,
 
5747
                lex_identified_temp_table ? name2 : NULL,
5754
5748
                iflags);
5755
5749
 
5756
5750
        if (error) {
5805
5799
        if (*trx->mysql_query_str) {
5806
5800
                error = row_table_add_foreign_constraints(trx,
5807
5801
                        *trx->mysql_query_str, norm_name,
5808
 
                        create_info.options & HA_LEX_CREATE_TMP_TABLE);
 
5802
                        lex_identified_temp_table);
5809
5803
 
5810
5804
                error = convert_error_code_to_mysql(error, iflags, NULL);
5811
5805
 
5843
5837
        /* We need to copy the AUTOINC value from the old table if
5844
5838
        this is an ALTER TABLE. */
5845
5839
 
5846
 
        if (((create_info.used_fields & HA_CREATE_USED_AUTO)
 
5840
        if ((create_proto.options().has_auto_increment_value()
5847
5841
            || session_sql_command(session) == SQLCOM_ALTER_TABLE)
5848
 
            && create_info.auto_increment_value != 0) {
 
5842
            && create_proto.options().auto_increment_value() != 0) {
5849
5843
 
5850
5844
                /* Query was ALTER TABLE...AUTO_INCREMENT = x; or
5851
5845
                CREATE TABLE ...AUTO_INCREMENT = x; Find out a table
5854
5848
                auto increment field if the value is greater than the
5855
5849
                maximum value in the column. */
5856
5850
 
5857
 
                auto_inc_value = create_info.auto_increment_value;
 
5851
                auto_inc_value = create_proto.options().auto_increment_value();
5858
5852
 
5859
5853
                dict_table_autoinc_lock(innobase_table);
5860
5854
                dict_table_autoinc_initialize(innobase_table, auto_inc_value);