aboutsummaryrefslogtreecommitdiff
path: root/test/zeroblob.test
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2019-01-25 20:09:04 +0000
committerdrh <drh@noemail.net>2019-01-25 20:09:04 +0000
commit0814acd98177fab44df29ebd24595a93c63eb68d (patch)
treeaaef21dbf6d0aecc864b0efbb8314874cf8063c1 /test/zeroblob.test
parentb2e61bc66b88cc82cc67830a77ee512e6b4b18fa (diff)
downloadsqlite-0814acd98177fab44df29ebd24595a93c63eb68d.tar.gz
sqlite-0814acd98177fab44df29ebd24595a93c63eb68d.zip
Do not accidently truncate zeroblob values when doing an arithmetic
operation. Fix for ticket [bb4bdb9f7f654b0bb9f34cfba]. FossilOrigin-Name: 13f6942eb0da2d92a0830f18640ce64208bd0cd6ff6d0c97e4a4c57ac3d65ba6
Diffstat (limited to 'test/zeroblob.test')
-rw-r--r--test/zeroblob.test11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/zeroblob.test b/test/zeroblob.test
index 0514644a2..9daa7d8d9 100644
--- a/test/zeroblob.test
+++ b/test/zeroblob.test
@@ -316,5 +316,16 @@ do_test 12.5 {
sqlite3_finalize $stmt
+# 2019-01-25 https://sqlite.org/src/tktview/bb4bdb9f7f654b0bb9f34cfbac
+# Zeroblob truncated by an index on expression
+#
+do_execsql_test 13.100 {
+ DROP TABLE IF EXISTS t1;
+ CREATE TABLE t1(a,b,c);
+ CREATE INDEX t1bbc ON t1(b, b+c);
+ INSERT INTO t1(a,b,c) VALUES(1,zeroblob(8),3);
+ SELECT a, quote(b), length(b), c FROM t1;
+} {1 X'0000000000000000' 8 3}
+
test_restore_config_pagecache
finish_test