~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Brian Aker
  • Date: 2010-03-27 21:51:11 UTC
  • Revision ID: brian@gaz-20100327215111-d93rvblau715pxfi
doCreateTable() was still taking a pointer instead of a session reference.

Show diffs side-by-side

added added

removed removed

Lines of Context:
421
421
        return(ha_innobase_exts);
422
422
  }
423
423
 
424
 
  UNIV_INTERN int doCreateTable(Session *session,
425
 
                                Table& form,
 
424
  UNIV_INTERN int doCreateTable(Session &session,
 
425
                                Table &form,
426
426
                                drizzled::TableIdentifier &identifier,
427
427
                                message::Table&);
428
428
  UNIV_INTERN int doRenameTable(Session&, TableIdentifier &from, TableIdentifier &to);
429
 
  UNIV_INTERN int doDropTable(Session& session, TableIdentifier &identifier);
 
429
  UNIV_INTERN int doDropTable(Session &session, TableIdentifier &identifier);
430
430
 
431
431
  UNIV_INTERN virtual bool get_error_message(int error, String *buf);
432
432
 
5515
5515
int
5516
5516
InnobaseEngine::doCreateTable(
5517
5517
/*================*/
5518
 
        Session*        session,        /*!< in: Session */
 
5518
        Session         &session,       /*!< in: Session */
5519
5519
        Table&          form,           /*!< in: information on table columns and indexes */
5520
5520
        drizzled::TableIdentifier &identifier,
5521
5521
        message::Table& create_proto)
5537
5537
 
5538
5538
        const char *table_name= identifier.getPath().c_str();
5539
5539
 
5540
 
        assert(session != NULL);
5541
 
 
5542
5540
#ifdef __WIN__
5543
5541
        /* Names passed in from server are in two formats:
5544
5542
        1. <database_name>/<table_name>: for normal table creation
5571
5569
        /* Get the transaction associated with the current session, or create one
5572
5570
        if not yet created */
5573
5571
 
5574
 
        parent_trx = check_trx_exists(session);
 
5572
        parent_trx = check_trx_exists(&session);
5575
5573
 
5576
5574
        /* In case MySQL calls this in the middle of a SELECT query, release
5577
5575
        possible adaptive hash latch to avoid deadlocks of threads */
5578
5576
 
5579
5577
        trx_search_latch_release_if_reserved(parent_trx);
5580
5578
 
5581
 
        trx = innobase_trx_allocate(session);
 
5579
        trx = innobase_trx_allocate(&session);
5582
5580
 
5583
5581
        srv_lower_case_table_names = TRUE;
5584
5582
 
5597
5595
        iflags = 0;
5598
5596
 
5599
5597
        /* Validate create options if innodb_strict_mode is set. */
5600
 
        if (! create_options_are_valid(session, form, create_proto)) {
 
5598
        if (! create_options_are_valid(&session, form, create_proto)) {
5601
5599
                error = ER_ILLEGAL_HA_CREATE_OPTION;
5602
5600
                goto cleanup;
5603
5601
        }
5621
5619
                }
5622
5620
 
5623
5621
                if (!srv_file_per_table) {
5624
 
                        push_warning(session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
 
5622
                        push_warning(&session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
5625
5623
                                     ER_ILLEGAL_HA_CREATE_OPTION,
5626
5624
                                     "InnoDB: KEY_BLOCK_SIZE"
5627
5625
                                     " requires innodb_file_per_table.");
5629
5627
                }
5630
5628
 
5631
5629
                if (file_format < DICT_TF_FORMAT_ZIP) {
5632
 
                        push_warning(session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
 
5630
                        push_warning(&session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
5633
5631
                                     ER_ILLEGAL_HA_CREATE_OPTION,
5634
5632
                                     "InnoDB: KEY_BLOCK_SIZE"
5635
5633
                                     " requires innodb_file_format >"
5638
5636
                }
5639
5637
 
5640
5638
                if (!iflags) {
5641
 
                        push_warning_printf(session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
 
5639
                        push_warning_printf(&session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
5642
5640
                                            ER_ILLEGAL_HA_CREATE_OPTION,
5643
5641
                                            "InnoDB: ignoring"
5644
5642
                                            " KEY_BLOCK_SIZE=%lu.",
5657
5655
                                such combinations can be obtained
5658
5656
                                with ALTER TABLE anyway. */
5659
5657
                                push_warning_printf(
5660
 
                                        session,
 
5658
                                        &session,
5661
5659
                                        DRIZZLE_ERROR::WARN_LEVEL_WARN,
5662
5660
                                        ER_ILLEGAL_HA_CREATE_OPTION,
5663
5661
                                        "InnoDB: ignoring KEY_BLOCK_SIZE=%lu"
5695
5693
 
5696
5694
                        if (!srv_file_per_table) {
5697
5695
                                push_warning_printf(
5698
 
                                        session,
 
5696
                                        &session,
5699
5697
                                        DRIZZLE_ERROR::WARN_LEVEL_WARN,
5700
5698
                                        ER_ILLEGAL_HA_CREATE_OPTION,
5701
5699
                                        "InnoDB: ROW_FORMAT=%s"
5703
5701
                                        row_format_name);
5704
5702
                        } else if (file_format < DICT_TF_FORMAT_ZIP) {
5705
5703
                                push_warning_printf(
5706
 
                                        session,
 
5704
                                        &session,
5707
5705
                                        DRIZZLE_ERROR::WARN_LEVEL_WARN,
5708
5706
                                        ER_ILLEGAL_HA_CREATE_OPTION,
5709
5707
                                        "InnoDB: ROW_FORMAT=%s"
5829
5827
        this is an ALTER TABLE. */
5830
5828
 
5831
5829
        if ((create_proto.options().has_auto_increment_value()
5832
 
            || session_sql_command(session) == SQLCOM_ALTER_TABLE)
 
5830
            || session_sql_command(&session) == SQLCOM_ALTER_TABLE)
5833
5831
            && create_proto.options().auto_increment_value() != 0) {
5834
5832
 
5835
5833
                /* Query was ALTER TABLE...AUTO_INCREMENT = x; or