return rc;
}
+/*
+** The xSavepoint method.
+**
+** This module does not need to do anything to support savepoints. However,
+** it uses this hook to close any open blob handle. This is done because a
+** DROP TABLE command - which fortunately always opens a savepoint - cannot
+** succeed if there are any open blob handles. i.e. if the blob handle were
+** not closed here, the following would fail:
+**
+** BEGIN;
+** INSERT INTO rtree...
+** DROP TABLE <tablename>; -- Would fail with SQLITE_LOCKED
+** COMMIT;
+*/
+static int rtreeSavepoint(sqlite3_vtab *pVtab, int iSavepoint){
+ Rtree *pRtree = (Rtree *)pVtab;
+ int iwt = pRtree->inWrTrans;
+ pRtree->inWrTrans = 0;
+ nodeBlobReset(pRtree);
+ pRtree->inWrTrans = iwt;
+ return SQLITE_OK;
+}
/*
** This function populates the pRtree->nRowEst variable with an estimate
}
static sqlite3_module rtreeModule = {
- 0, /* iVersion */
+ 2, /* iVersion */
rtreeCreate, /* xCreate - create a table */
rtreeConnect, /* xConnect - connect to an existing table */
rtreeBestIndex, /* xBestIndex - Determine search strategy */
rtreeEndTransaction, /* xRollback - rollback transaction */
0, /* xFindFunction - function overloading */
rtreeRename, /* xRename - rename the table */
- 0, /* xSavepoint */
+ rtreeSavepoint, /* xSavepoint */
0, /* xRelease */
0, /* xRollbackTo */
};
# inserted. Also that if a non-numeric is inserted into one
# of the min/max dimension columns, it is converted to the
# required type before being inserted.
+# rtree-15.*: Check that DROP TABLE works within a transaction that
+# writes to an r-tree table.
#
ifcapable !rtree {
3 42 49
}
+#-------------------------------------------------------------------------
+#
+do_execsql_test 15.0 {
+ CREATE VIRTUAL TABLE rt USING rtree(id, x1,x2, y1,y2);
+ CREATE TEMP TABLE t13(a, b, c);
+}
+do_execsql_test 15.1 {
+ BEGIN;
+ INSERT INTO rt VALUES(1,2,3,4,5);
+}
+breakpoint
+do_execsql_test 15.2 {
+ DROP TABLE t13;
+ COMMIT;
+}
+
finish_test
-C Fix\sthe\squoting\smechanism\sfor\s".dump"\sso\sthat\sit\sis\snot\sapplied\sfor\sthe\n".mode\squote"\soutput.
-D 2017-04-08T13:42:55.616
+C Have\sthe\srtree\smodule\sclose\sany\sopen\sblob-handle\swithin\sthe\sxSavepoint\smethod.\nThis\sprevents\ssuch\san\sopen\sblob\shandle\sfrom\sinterfering\swith\sDROP\sTABLE\noperations.
+D 2017-04-08T13:52:41.332
F Makefile.in 1cc758ce3374a32425e4d130c2fe7b026b20de5b8843243de75f087c0a2661fb
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc a4c0613a18663bda56d8cf76079ab6590a7c3602e54befb4bbdef76bcaa38b6a
F ext/rbu/sqlite3rbu.h 6fb6294c34a9ca93b5894a33bca530c6f08decba
F ext/rbu/test_rbu.c 5aa22616afac6f71ebd3d9bc9bf1006cfabcca88
F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761
-F ext/rtree/rtree.c fb7c0e62ccbbbd6951ddb1f52feaa2c1a53b7ac1c6f2d5d5e2bbd31c33e57186
+F ext/rtree/rtree.c 37c603c6b8aed1a760661ceb5a025bd36bac14cf56d59949bd8de14b2a17e9ed
F ext/rtree/rtree.h 834dbcb82dc85b2481cde6a07cdadfddc99e9b9e
-F ext/rtree/rtree1.test 42dadfc7b44a436cd74a1bebc0b9b689e4eaf7ec
+F ext/rtree/rtree1.test d5f0ba215b3bd1d05269ada86e74073b8445852aa0d33a63e10ec63a09c39473
F ext/rtree/rtree2.test acbb3a4ce0f4fbc2c304d2b4b784cfa161856bba
F ext/rtree/rtree3.test 2cafe8265d1ff28f206fce88d114f208349df482
F ext/rtree/rtree4.test c8fe384f60ebd49540a5fecc990041bf452eb6e0
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P a921ada89050ce1d162fd1b0056939573635e2cec7ac0c2a99ae924b3ae593f7
-R 82737b36216e366238632e12de53d03d
-U drh
-Z 97234581d28b10577d1d04c415271f72
+P 78c1e90305d48917d9423d8e50a7dfd15ec27aa93cb421610062229c7ede13a6
+R 0c38afb8d28742bfd99c862428490c09
+U dan
+Z 475b2e97335280e83d36c7e778a71dcc
-78c1e90305d48917d9423d8e50a7dfd15ec27aa93cb421610062229c7ede13a6
\ No newline at end of file
+fa4416adc2a9a3a80db1d5befc0b95c3d0fc41affe38f7f2f45cdfae3f1b49eb
\ No newline at end of file