Do not allow ALTER TABLE RENAME COLUMN on a virtual table.

FossilOrigin-Name: f6d6b472713c21deace3fd52c0b0b6901d758af043c238f004fabe52b01f730c
This commit is contained in:
drh 2018-08-14 20:38:18 +00:00
parent 1595abcda6
commit af4023de22
3 changed files with 14 additions and 7 deletions

View File

@ -1,5 +1,5 @@
C Improved\serror\smessages\swhen\san\sALTER\sTABLE\sRENAME\sCOLUMN\sfails\sdue\sto\sa\nduplicate\scolumn\sname.
D 2018-08-14T19:27:51.931
C Do\snot\sallow\sALTER\sTABLE\sRENAME\sCOLUMN\son\sa\svirtual\stable.
D 2018-08-14T20:38:18.441
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F Makefile.in 0a3a6c81e6fcb969ff9106e882f0a08547014ba463cb6beca4c4efaecc924ee6
@ -432,7 +432,7 @@ F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca
F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
F sqlite3.1 fc7ad8990fc8409983309bb80de8c811a7506786
F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a
F src/alter.c ec59506ca095be71dbb7f1ad3566a41b38cf6d567c68deb107d8797a940466e9
F src/alter.c b3f6b775437e34bec4d420fdcccf5ca0452d289ae73fd0d20008eac26032d66a
F src/analyze.c 3dc6b98cf007b005af89df165c966baaa48e8124f38c87b4d2b276fe7f0b9eb9
F src/attach.c 4bd5b92633671d3e8ce431153ebb1893b50335818423b5373f3f27969f79769a
F src/auth.c 32a5bbe3b755169ab6c66311c5225a3cd4f75a46c041f7fb117e0cbb68055114
@ -1756,7 +1756,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P dff0314b7e7ef2d04375ff21fbf89039bf5f64a9cdca53d7bc7120faacd92c06
R a01a89fd0532fa15dae2ccaec02fafc7
P 37d11b8e8224a8b241ff57b9c4b9499db39dde4ddcb56ff8b03a3d08091a4c11
R a97b8ef67d1e5217c49bfc573da7ed6f
U drh
Z 07d75aaec1aeccbdd428dca9c3119420
Z 60f84be9f63ca1dd6e50246fd9de4eb5

View File

@ -1 +1 @@
37d11b8e8224a8b241ff57b9c4b9499db39dde4ddcb56ff8b03a3d08091a4c11
f6d6b472713c21deace3fd52c0b0b6901d758af043c238f004fabe52b01f730c

View File

@ -817,6 +817,13 @@ void sqlite3AlterRenameColumn(
/* Cannot alter a system table */
if( SQLITE_OK!=isSystemTable(pParse, pTab->zName) ) goto exit_rename_column;
/* Cannot rename columns of a virtual table */
if( IsVirtual(pTab) ){
sqlite3ErrorMsg(pParse, "cannot rename columns in a virtual table (%s)",
pTab->zName);
goto exit_rename_column;
}
/* Which schema holds the table to be altered */
iSchema = sqlite3SchemaToIndex(db, pTab->pSchema);
assert( iSchema>=0 );