/ Check-in [3f30f00a]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Simplify the test that determines if the name of a new table collides with a prior index name.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3f30f00a384d23582f3fe5e68add7fb7d7834926
User & Date: drh 2010-09-28 20:26:44
Context
2010-09-29
01:54
Updates to sqlite3_finalize() documentation. check-in: 8c5994cf user: drh tags: trunk
2010-09-28
20:26
Simplify the test that determines if the name of a new table collides with a prior index name. check-in: 3f30f00a user: drh tags: trunk
19:16
Fix some problems that can occur if a trigger has the same name as another database object. check-in: 655991ec user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/build.c.

783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
    pTable = sqlite3FindTable(db, zName, zDb);
    if( pTable ){
      if( !noErr ){
        sqlite3ErrorMsg(pParse, "table %T already exists", pName);
      }
      goto begin_table_error;
    }
    if( sqlite3FindIndex(db, zName, zDb)!=0 && (iDb==0 || !db->init.busy) ){
      sqlite3ErrorMsg(pParse, "there is already an index named %s", zName);
      goto begin_table_error;
    }
  }

  pTable = sqlite3DbMallocZero(db, sizeof(Table));
  if( pTable==0 ){







|







783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
    pTable = sqlite3FindTable(db, zName, zDb);
    if( pTable ){
      if( !noErr ){
        sqlite3ErrorMsg(pParse, "table %T already exists", pName);
      }
      goto begin_table_error;
    }
    if( sqlite3FindIndex(db, zName, zDb)!=0 ){
      sqlite3ErrorMsg(pParse, "there is already an index named %s", zName);
      goto begin_table_error;
    }
  }

  pTable = sqlite3DbMallocZero(db, sizeof(Table));
  if( pTable==0 ){