mirror of
https://github.com/sqlite/sqlite.git
synced 2025-12-04 20:02:48 +03:00
Do not burn memory remembering CHECK constraints in a read-only database.
FossilOrigin-Name: 34ddf02d3d21151b8099c0c25706530a03d93887
This commit is contained in:
@@ -1306,7 +1306,10 @@ void sqlite3AddCheckConstraint(
|
||||
){
|
||||
#ifndef SQLITE_OMIT_CHECK
|
||||
Table *pTab = pParse->pNewTable;
|
||||
if( pTab && !IN_DECLARE_VTAB ){
|
||||
sqlite3 *db = pParse->db;
|
||||
if( pTab && !IN_DECLARE_VTAB
|
||||
&& !sqlite3BtreeIsReadonly(db->aDb[db->init.iDb].pBt)
|
||||
){
|
||||
pTab->pCheck = sqlite3ExprListAppend(pParse, pTab->pCheck, pCheckExpr);
|
||||
if( pParse->constraintName.n ){
|
||||
sqlite3ExprListSetName(pParse, pTab->pCheck, &pParse->constraintName, 1);
|
||||
|
||||
Reference in New Issue
Block a user