~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • Committer: Brian Aker
  • Date: 2009-11-19 02:33:17 UTC
  • mto: (1222.1.2 staging)
  • mto: This revision was merged to the branch mainline in revision 1224.
  • Revision ID: brian@gaz-20091119023317-lylyqkwhrewid34p
Remove a few more options, from options in HA_CREATE_INFO.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1611
1611
                                message::Table *table_proto,
1612
1612
                                AlterInfo *alter_info,
1613
1613
                                bool internal_tmp_table,
1614
 
                                uint32_t select_field_count)
 
1614
                                uint32_t select_field_count, 
 
1615
                                bool is_if_not_exists)
1615
1616
{
1616
1617
  char          path[FN_REFLEN];
1617
1618
  uint32_t          path_length;
1675
1676
  if (lex_identified_temp_table &&
1676
1677
      session->find_temporary_table(db, table_name))
1677
1678
  {
1678
 
    if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
 
1679
    if (is_if_not_exists)
1679
1680
    {
1680
1681
      create_info->table_existed= 1;            // Mark that table existed
1681
1682
      push_warning_printf(session, DRIZZLE_ERROR::WARN_LEVEL_NOTE,
1693
1694
  {
1694
1695
    if (plugin::StorageEngine::getTableDefinition(*session, path, db, table_name, internal_tmp_table)==EEXIST)
1695
1696
    {
1696
 
      if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
 
1697
      if (is_if_not_exists)
1697
1698
      {
1698
1699
        error= false;
1699
1700
        push_warning_printf(session, DRIZZLE_ERROR::WARN_LEVEL_NOTE,
1732
1733
  */
1733
1734
  if (! lex_identified_temp_table)
1734
1735
  {
1735
 
    bool create_if_not_exists =
1736
 
      create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS;
1737
 
 
1738
1736
    char table_path[FN_REFLEN];
1739
1737
    uint32_t          table_path_length;
1740
1738
 
1748
1746
        /* Normal case, no table exists. we can go and create it */
1749
1747
        break;
1750
1748
      case EEXIST:
1751
 
        if (create_if_not_exists)
 
1749
        if (is_if_not_exists)
1752
1750
        {
1753
1751
          error= false;
1754
1752
          push_warning_printf(session, DRIZZLE_ERROR::WARN_LEVEL_NOTE,
1815
1813
                        message::Table *table_proto,
1816
1814
                        AlterInfo *alter_info,
1817
1815
                        bool internal_tmp_table,
1818
 
                        uint32_t select_field_count)
 
1816
                        uint32_t select_field_count,
 
1817
                        bool is_if_not_exists)
1819
1818
{
1820
1819
  Table *name_lock= NULL;
1821
1820
  bool result;
1831
1830
    }
1832
1831
    if (name_lock == NULL)
1833
1832
    {
1834
 
      if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
 
1833
      if (is_if_not_exists)
1835
1834
      {
1836
1835
        push_warning_printf(session, DRIZZLE_ERROR::WARN_LEVEL_NOTE,
1837
1836
                            ER_TABLE_EXISTS_ERROR, ER(ER_TABLE_EXISTS_ERROR),
1852
1851
                                     table_proto,
1853
1852
                                     alter_info,
1854
1853
                                     internal_tmp_table,
1855
 
                                     select_field_count);
 
1854
                                     select_field_count,
 
1855
                                     is_if_not_exists);
1856
1856
 
1857
1857
unlock:
1858
1858
  if (name_lock)
2397
2397
 
2398
2398
bool mysql_create_like_table(Session* session, TableList* table, TableList* src_table,
2399
2399
                             drizzled::message::Table& create_table_proto,
2400
 
                             HA_CREATE_INFO *create_info)
 
2400
                             HA_CREATE_INFO *create_info,
 
2401
                             bool is_if_not_exists)
2401
2402
{
2402
2403
  Table *name_lock= 0;
2403
2404
  char src_path[FN_REFLEN], dst_path[FN_REFLEN];
2605
2606
        }
2606
2607
        pthread_mutex_unlock(&LOCK_open);
2607
2608
 
2608
 
        int result= store_create_info(table, &query, create_info);
 
2609
        int result= store_create_info(table, &query, create_info, is_if_not_exists);
2609
2610
 
2610
2611
        assert(result == 0); // store_create_info() always return 0
2611
2612
        write_bin_log(session, query.ptr(), query.length());
2619
2620
  goto err;
2620
2621
 
2621
2622
table_exists:
2622
 
  if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
 
2623
  if (is_if_not_exists)
2623
2624
  {
2624
2625
    char warn_buff[DRIZZLE_ERRMSG_SIZE];
2625
2626
    snprintf(warn_buff, sizeof(warn_buff),