Commit Graph

69 Commits

Author SHA1 Message Date
drh
d6b3a02d21 Interpret negative arguments to sqlite3_sleep() as zero.
FossilOrigin-Name: 2b542326aa8e7e1f6ed9d999b95ae5340278e0821277a17de3cc803b4af793ae
2023-05-02 16:34:15 +00:00
drh
ed07d0ea76 If the SELECT that implements a subquery or a VIEW or a CREATE TABLE AS is
a compound with different result datatypes on two or more arms of the compound,
then the overall column type becomes BLOB (ANY).

FossilOrigin-Name: 6ebb178c6b688ebd632e91a5ec4c748567833037c679ab3d72fb770deb230fe1
2022-12-14 14:41:35 +00:00
drh
7d44b22d45 Fix test cases so that they all still work even with -DSQLITE_DQS=0.
FossilOrigin-Name: 4883776669ee2f2310ea82b0d6df4d008eebaa7cb252102539cf21a635402ebb
2022-01-16 19:11:13 +00:00
drh
105c4b5ced Fix an incorrect comment on testcase misc1-27.0. No changes to code.
FossilOrigin-Name: 49829ae3229b7c7c7adeaa970a84aebd5157bc93b38fd6d80d86cc03f5fdde6f
2021-07-05 00:07:39 +00:00
drh
94f4f873b2 Do not set the Cursor.seekOp test variable in the OP_NotExists opcode.
This is a change to test logic only and does not affect deliverable builds.

FossilOrigin-Name: 98f343077887c4d3fc2ca3bbc7f20c80ec37b0e521d70af9c986ab80bb2c7903
2018-12-20 22:08:32 +00:00
drh
6ab91a7a7a Add the SQLITE_DEFAULT_DEFENSIVE compile-time option. Fix up test cases
so that they work with DEFENSIVE enabled.

FossilOrigin-Name: 3212733cb6d1a59516d67a86df7c7b1d2456a1b2e5d7080c26b0e87b2609c65d
2018-11-07 02:17:01 +00:00
drh
ee052a1c94 Add test cases for the undocumented behavior of duplicate columns on an
INSERT or UPDATE.

FossilOrigin-Name: f4349c0c26611de8a7d5beb99431a575cf531cdeb0ca2413efabcf0a61e6f424
2017-12-29 12:50:43 +00:00
drh
97258194a2 Do not make the assumption (as check-in [4da49a95c0f07] incorrectly did) that
the ExprList returned by sqlite3ExprListDup() would never be passed into
sqlite3ExprListAppend().  Include a new test case that shows this sometimes
does happen.

FossilOrigin-Name: 29227d00a9999f0f28a0b55ef70183799a667c3b9d81d2e5ac0ab1840bef98b1
2017-09-17 19:45:28 +00:00
dan
4da30f8888 Add the "atomic-batch-write" permutation to permutations.test. This
permutation fails if not run on a file-system that supports
atomic-batch-writes.

FossilOrigin-Name: 9f1b83fae9c973eee80eefefe7bd3a1eb7bba8af4cd919d7a2ce911900dd9087
2017-07-22 16:58:47 +00:00
drh
b2bddbbc2d Avoid a potential buffer overrun if an SQL statement being parsed ends
with an illegal "!" token.  (This problem was detected by fuzzcheck
running under valgrind. The problem was introduced by check-in [9570b6b43df3].)

FossilOrigin-Name: 2a8d97e7c8976df0312e1294e8c1da8b15686654
2016-02-18 14:49:28 +00:00
drh
202923107d Do not allow table-valued function syntax on ordinary tables and views as those
objects are not table-valued functions.
Fix for ticket [73eba7ba5c7c0fc].

FossilOrigin-Name: ff5716b89f99d9c4568a39f1f52524528a631623
2015-11-21 13:24:46 +00:00
drh
96ceaf8680 Code simplification in sqlite3ColumnsFromExprList(). Update the %z format
code so that it works with buffers obtained from sqlite3DbMalloc().  Add a
testcase for the slow column name uniquifier.

FossilOrigin-Name: 9272426057b6cb2d913519ff4c97aa6e211f7d51
2015-11-14 22:04:22 +00:00
dan
584390e8dd Fix a one-byte buffer overread that may follow a syntax error while preparing an SQL statement.
FossilOrigin-Name: 075003930da98419f671b7833a5850693529fb62
2015-05-26 18:58:57 +00:00
drh
f058b9c472 Add a test case to verify that CREATE TABLE AS does not store INT values
in TEXT columns.  Ticket [f2ad7de056ab1dc92].

FossilOrigin-Name: 0e45e8f1574ef19a43dbd118440ddbc5cec80ce7
2015-05-20 17:25:44 +00:00
drh
5f1d2fa4d2 Fix another assert() that is not true if the database schema is corrupt.
FossilOrigin-Name: bc97cec6338b16a4e9b1a9457d01bb7fe462934d
2015-04-19 21:59:19 +00:00
drh
33c59ecafb Fix a faulty assert in the schema parsing logic.
FossilOrigin-Name: b1ed949584a2526c04952b98c3aa283427f45e10
2015-04-19 20:39:17 +00:00
drh
d0c7305313 Fix a potential NULL pointer deference on a corrupt database schema.
FossilOrigin-Name: dc61b292d8eaf422ca8a2b18f1caccef1a5389fd
2015-04-19 19:21:19 +00:00
drh
0ec68f845c When doing the (dubious) conversion of double-quoted identifier into string
literal for MySQL compatibility, be sure to also clear the iTable value from
the Expr entry to avoid an assert.

FossilOrigin-Name: d7211b68107ea669de39e0aa81a1be40901e1487
2015-04-15 04:51:28 +00:00
drh
74893a4cdb Fix a potential NULL pointer dereference following a syntax error.
FossilOrigin-Name: 8d27e3e16a9be79fe227e833f4770ebe09a9d90b
2015-03-22 10:23:17 +00:00
drh
a58d4a9612 Fix a (almost always harmless) read past the end of a memory allocation
that comes about because the Expr.pTab field is checked on an
EXPR_REDUCEDSIZE Expr object before checking the Expr.op field to
know that the Expr.pTab field is meaningless.

FossilOrigin-Name: e098de691002a78270540430b0df1e120582b53f
2015-01-27 13:17:05 +00:00
drh
c007f61bb0 Repurpose the SQLITE_TESTCTRL_FAULT_INSTALL test-control to register a
callback to be invoked by sqlite3FaultSim().  That test-control has been
unused since 2008-06-20 and was never used in any official release.

FossilOrigin-Name: 0d43a7ad9abe821e33e0bf83a997aa4461b1e3f2
2014-05-16 14:17:01 +00:00
drh
c740752470 Fix CREATE TABLE ... AS so that it works with column names that are empty
strings.

FossilOrigin-Name: 632045f21c553e10f59a14c772d50d7824ca0c2c
2014-01-10 20:38:12 +00:00
drh
f9c8ce3ced Standardize the error messages generated by constraint failures to a format
of "$TYPE constraint failed: $DETAIL".  This involves many changes to the
expected output of test cases.

FossilOrigin-Name: 54b221929744b1bcdbcc2030fef2e510618afd41
2013-11-05 13:33:55 +00:00
drh
00012df46d Add the conflict2.test script. Fix issues discovered by this script.
FossilOrigin-Name: 294ed33756b06375e56c41f1088d42ee48adbdc8
2013-11-05 01:59:07 +00:00
mistachkin
c548465435 Add compile-time define to indicate if the VFS supports the concept of a current directory (as WinCE and WinRT do not). Avoid using the GetTempPath and GetFullPathName APIs on WinRT. Some tests still need adjustments.
FossilOrigin-Name: 86c049a171acc3f4a43771f3e7176a90210d7799
2012-03-05 22:52:33 +00:00
mistachkin
fda06befd5 Add retry logic for AV defense to winOpen. Also, refactor test suite to allow the key Tcl file operations (e.g. copy and delete) to be retried.
FossilOrigin-Name: 9007586fdabed8dbcc78581ea9821cfd1f9a4c8c
2011-08-02 00:57:34 +00:00
drh
ba726f4939 Do create, open, or initialize the rollback journal until something actually
needs to be written into the journal.  That way, expensive filesystem
operations are avoided if the transaction ends up being a no-op.

FossilOrigin-Name: b78e58ae1570ab4d66a69db445a752c6456038a0
2010-03-19 15:48:13 +00:00
drh
0152123730 Fix a bug in the misc1 test script. (CVS 4526)
FossilOrigin-Name: fa16996d99cdce9f652508e3a70b7e5747810823
2007-11-05 14:58:23 +00:00
drh
f9cb7f58a7 Move the sqlite3_sleep() and sqlite3_clear_bindings() interfaces into the
main library and make this official. (CVS 3316)

FossilOrigin-Name: eb3442c44ef1dbf8895195bb08fbeeea315b44c1
2006-06-27 20:06:44 +00:00
danielk1977
3bdca9c9a5 Test suite fixes for builds that define OMIT symbols. (CVS 2962)
FossilOrigin-Name: 3a54a33dcb7e765ee3773397407e8929a8cfe1a9
2006-01-17 09:35:01 +00:00
drh
8df447f0e6 Omit the SQLITE_AFF_INTEGER type affinity. All numeric values are now
of type real, though an integer representation is still sometimes used
internally for efficiency. (CVS 2753)

FossilOrigin-Name: e0d6f61c7de2c03b8fd17ef37cf1a0add36ee618
2005-11-01 15:48:24 +00:00
drh
3d1d95e625 The SUM() aggregate function returns an integer result if all inputs are
integers.  Any single non-integer input causes the result to be a floating
point value. (CVS 2669)

FossilOrigin-Name: 21adf4bd99e732650a1e8e9a1cc954126983a654
2005-09-08 10:37:01 +00:00
drh
f14fd03899 Additional tests for better coverage. (CVS 2602)
FossilOrigin-Name: 4281a838f2f531af24b008d2834e8318798472c5
2005-08-19 03:03:51 +00:00
drh
557cc60f4d Add the "!" flag to the "%g" mprintf conversion parameter to force a
decimal point.  This prevents floating point values from appearing as
integers.  Use this flag when converting floating point to text.
Ticket #1362. (CVS 2586)

FossilOrigin-Name: 4b98dace6b90abf4a6fe1cd51e6392fd213358c4
2005-08-13 12:59:14 +00:00
drh
0aa74edd72 Allow an unlimited number of terms in the WHERE clause. The old limit was 100. (CVS 2550)
FossilOrigin-Name: ca69f36832d57775e73ac5cdbe0a32d7b759432b
2005-07-16 13:33:20 +00:00
danielk1977
53c0f7480b Add the SQLITE_OMIT_TEMPDB compile time macro. (CVS 2427)
FossilOrigin-Name: c41d55443c2dd532147962b87f542fb7d37075fd
2005-03-29 03:10:59 +00:00
danielk1977
e61b9f4f3c Modify test scripts to work when SQLITE_OMIT_SUBQUERY (but no other OMIT macros) is defined. (CVS 2252)
FossilOrigin-Name: d4e19efcef68d834c55c7d496cdb3696d63a31a2
2005-01-21 04:25:47 +00:00
danielk1977
3e8c37e7f8 Modify test scripts to work when SQLITE_OMIT_SUBQUERY (along with other OMIT macros) is defined. (CVS 2251)
FossilOrigin-Name: bb0254ab14417f0ab40f10f37cb63a60507f070a
2005-01-21 03:12:14 +00:00
drh
798da52ce7 All tests pass even if OMIT_TRIGGER is defined. (CVS 2053)
FossilOrigin-Name: c33b3a613751057e8a46fdcd428b8448329d414d
2004-11-04 04:42:28 +00:00
drh
92febd92ad Tcl interface transfers values directly between SQLite and Tcl_Objs, without
at translation to strings. (CVS 1898)

FossilOrigin-Name: e97c331362545ce21117776c7b61d3488668f2bf
2004-08-20 18:34:20 +00:00
drh
5f6a87b3dd When comparing two expressions do not apply affinity to either operand.
Ticket #805. (CVS 1810)

FossilOrigin-Name: 88a4e400f916d7af088b39a9653d6452b3666577
2004-07-19 00:39:45 +00:00
drh
ef4ac8f9df Change the name of the TCL command from "sqlite" to "sqlite3" so that both
SQLite version 2 and SQLite version 3 can be used by Tcl at the same time. (CVS 1626)

FossilOrigin-Name: d705d051bed2b92b6c3bbcc75fe5b056633b9c31
2004-06-19 00:16:31 +00:00
danielk1977
0de0bb3360 Misc fixes for test cases failing due to the new locking model. (CVS 1561)
FossilOrigin-Name: 71e98d0d089576433c4b06dcba1c57063bd366f5
2004-06-10 05:59:24 +00:00
danielk1977
0202b29ef7 Some progress on user-defined collation sequences. (CVS 1544)
FossilOrigin-Name: c634e71f1909819fb55c728bc410e5cc390428e3
2004-06-09 09:55:16 +00:00
danielk1977
1d850a72c2 Replace OP_Begin, OP_Commit and OP_Rollback with OP_AutoCommit. (CVS 1500)
FossilOrigin-Name: b8ed812c92f2dbb4431d45aeb41646ceb53e0cbc
2004-05-31 08:26:49 +00:00
drh
fec19aad44 Correctly handle 64-bit integers in SQL statements. (CVS 1408)
FossilOrigin-Name: 34f03ba6a9d6e2144d0c6cbbbeb37b4c69705f1f
2004-05-19 20:41:03 +00:00
drh
37ed48ed2f Provide a more informative error message when a uniqueness constraint
fails.  Ticket #419. (CVS 1068)

FossilOrigin-Name: 086aa1c9922b7bf399b3ee8b73ba7353d126b119
2003-08-05 13:13:38 +00:00
drh
4312db55d9 Additional testing of the ATTACH command with bug fixes for the new problems
that the tests found. (CVS 998)

FossilOrigin-Name: 3e8889d7ce5e99fc855526fc1bb62ddbe282bfc5
2003-06-03 01:47:11 +00:00
drh
e0194f2bbd Fix a memory leak associated with PRIMARY KEY in a CREATE TABLE statement
that fails.  Ticket #249. (CVS 1730)

FossilOrigin-Name: 66158843dfa073ffb8779a5170e091cebc018855
2003-02-26 13:52:51 +00:00
drh
17e9e29d1e When a CREATE TABLE ... AS SELECT statement fails, make sure the table name
is removed from the internal hash tables.  Ticket #238. (CVS 858)

FossilOrigin-Name: 65264780c553e8a00ec7a40cf76b89a11b245faf
2003-02-01 13:53:28 +00:00