/ Check-in [b0629132]
Login

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

Overview
Comment:Comment improvements. No changes to code.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | tkt9b78184b-alt
Files: files | file ages | folders
SHA3-256: b0629132bc346f7a9025c0edf52114fc81385cd7a41ff1fa5d353179df276b92
User & Date: drh 2019-07-08 12:44:47
Wiki:tkt9b78184b-alt
Context
2019-07-08
12:44
Comment improvements. No changes to code. Leaf check-in: b0629132 user: drh tags: tkt9b78184b-alt
2019-07-02
20:10
Have ALTER TABLE detect and error out for the case where renaming a column changes a the interpretation of a double-quoted identifier in the database schema from an SQL literal to a column reference. check-in: 5dbb0734 user: dan tags: tkt9b78184b-alt
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/alter.c.

  1267   1267     renameTokenFree(db, pParse->pRename);
  1268   1268     sqlite3ParserReset(pParse);
  1269   1269   }
  1270   1270   
  1271   1271   /*
  1272   1272   ** SQL function:
  1273   1273   **
  1274         -**     sqlite_rename_column(zSql, iCol, bQuote, zNew, zTable, zOld)
         1274  +**     sqlite_rename_column(...)
         1275  +**
         1276  +** The function requires exactly 10 arguments:
  1275   1277   **
  1276   1278   **   0. zSql:     SQL statement to rewrite
  1277   1279   **   1. type:     Type of object ("table", "view" etc.)
  1278   1280   **   2. object:   Name of object
  1279   1281   **   3. Database: Database name (e.g. "main")
  1280   1282   **   4. Table:    Table name
  1281   1283   **   5. iCol:     Index of column to rename
................................................................................
  1288   1290   **
  1289   1291   ** Do a column rename operation on the CREATE statement given in zSql.
  1290   1292   ** The iCol-th column (left-most is 0) of table zTable is renamed from zCol
  1291   1293   ** into zNew.  The name should be quoted if bQuote is true.
  1292   1294   **
  1293   1295   ** This function is used internally by the ALTER TABLE RENAME COLUMN command.
  1294   1296   ** It is only accessible to SQL created using sqlite3NestedParse().  It is
  1295         -** not reachable from ordinary SQL passed into sqlite3_prepare().
         1297  +** not reachable from ordinary SQL passed into sqlite3_prepare().  Except,
         1298  +** this function is reachable for testing purposes if the
         1299  +** SQLITE_TESTCTRL_INTERNAL_FUNCTIONS test-control is engaged.
  1296   1300   */
  1297   1301   static void renameColumnFunc(
  1298   1302     sqlite3_context *context,
  1299   1303     int NotUsed,
  1300   1304     sqlite3_value **argv
  1301   1305   ){
  1302   1306     sqlite3 *db = sqlite3_context_db_handle(context);

Changes to src/resolve.c.

   814    814                      NC_IdxExpr|NC_PartIdx);
   815    815           }
   816    816           if( (pDef->funcFlags & SQLITE_FUNC_INTERNAL)!=0
   817    817            && pParse->nested==0
   818    818            && sqlite3Config.bInternalFunctions==0
   819    819           ){
   820    820             /* Internal-use-only functions are disallowed unless the
   821         -          ** SQL is being compiled using sqlite3NestedParse() */
          821  +          ** SQL is being compiled using sqlite3NestedParse().  The
          822  +          ** SQLITE_TESTCTRL_INTERNAL_FUNCTIONS test-control will override
          823  +          ** this restriction for testing purposes. */
   822    824             no_such_func = 1;
   823    825             pDef = 0;
   824    826           }
   825    827         }
   826    828   
   827    829         if( 0==IN_RENAME_OBJECT ){
   828    830   #ifndef SQLITE_OMIT_WINDOWFUNC