~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Brian Aker
  • Date: 2008-08-11 23:20:41 UTC
  • Revision ID: brian@tangent.org-20080811232041-h9ydp3um89b1pbvm
Clean up UNION in CREATE TABLE statement

Show diffs side-by-side

added added

removed removed

Lines of Context:
1467
1467
      select_lex->options|= SELECT_NO_UNLOCK;
1468
1468
      unit->set_limit(select_lex);
1469
1469
 
1470
 
      /*
1471
 
        Disable non-empty MERGE tables with CREATE...SELECT. Too
1472
 
        complicated. See Bug #26379. Empty MERGE tables are read-only
1473
 
        and don't allow CREATE...SELECT anyway.
1474
 
      */
1475
 
      if (create_info.used_fields & HA_CREATE_USED_UNION)
1476
 
      {
1477
 
        my_error(ER_WRONG_OBJECT, MYF(0), create_table->db,
1478
 
                 create_table->table_name, "BASE TABLE");
1479
 
        res= 1;
1480
 
        goto end_with_restore_list;
1481
 
      }
1482
 
 
1483
1470
      if (!(create_info.options & HA_LEX_CREATE_TMP_TABLE))
1484
1471
      {
1485
1472
        lex->link_first_table_back(create_table, link_to_local);
1503
1490
            goto end_with_restore_list;
1504
1491
          }
1505
1492
        }
1506
 
        /* If we create merge table, we have to test tables in merge, too */
1507
 
        if (create_info.used_fields & HA_CREATE_USED_UNION)
1508
 
        {
1509
 
          TABLE_LIST *tab;
1510
 
          for (tab= (TABLE_LIST*) create_info.merge_list.first;
1511
 
               tab;
1512
 
               tab= tab->next_local)
1513
 
          {
1514
 
            TABLE_LIST *duplicate;
1515
 
            if ((duplicate= unique_table(thd, tab, select_tables, 0)))
1516
 
            {
1517
 
              update_non_unique_table_error(tab, "CREATE", duplicate);
1518
 
              res= 1;
1519
 
              goto end_with_restore_list;
1520
 
            }
1521
 
          }
1522
 
        }
1523
1493
 
1524
1494
        /*
1525
1495
          select_create is currently not re-execution friendly and