Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix a problem with renaming a table that starts with "sqlite". Fix for ticket [f00d7b65]. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
a2ead8aa4517b63cda7bf84464326e9c |
User & Date: | dan 2019-04-19 16:34:22.819 |
Context
2019-04-19
| ||
17:26 | Improved optimization of the AND and OR operators. (check-in: 0fbd154eb4 user: drh tags: trunk) | |
16:34 | Fix a problem with renaming a table that starts with "sqlite". Fix for ticket [f00d7b65]. (check-in: a2ead8aa45 user: dan tags: trunk) | |
16:21 | Use macros to determine if an expression is always true or always false. (check-in: 6de980a09c user: drh tags: trunk) | |
Changes
Changes to src/alter.c.
︙ | |||
50 51 52 53 54 55 56 | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | - + - + | ** statement to ensure that the operation has not rendered any schema ** objects unusable. */ static void renameTestSchema(Parse *pParse, const char *zDb, int bTemp){ sqlite3NestedParse(pParse, "SELECT 1 " "FROM \"%w\".%s " |
︙ | |||
182 183 184 185 186 187 188 | 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | - + + - + | /* Rewrite all CREATE TABLE, INDEX, TRIGGER or VIEW statements in ** the schema to use the new table name. */ sqlite3NestedParse(pParse, "UPDATE \"%w\".%s SET " "sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) " "WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)" |
︙ | |||
567 568 569 570 571 572 573 | 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 | - + + | zNew = sqlite3NameFromToken(db, pNew); if( !zNew ) goto exit_rename_column; assert( pNew->n>0 ); bQuote = sqlite3Isquote(pNew->z[0]); sqlite3NestedParse(pParse, "UPDATE \"%w\".%s SET " "sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) " |
︙ |
Changes to test/altertab.test.
︙ | |||
554 555 556 557 558 559 560 561 562 | 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 | + + + + + + + + + + | ALTER TABLE y1 RENAME TO z1; } do_execsql_test 16.4 { SELECT * FROM z1_segments; } } #------------------------------------------------------------------------- reset_db do_execsql_test 17.0 { CREATE TABLE sqlite1234 (id integer); ALTER TABLE sqlite1234 RENAME TO User; SELECT name, sql FROM sqlite_master WHERE sql IS NOT NULL; } { User {CREATE TABLE "User" (id integer)} } finish_test |