A different way to clear the subtype on VDBE registers when the value of the register is overwritten with new content. To fix [[f45ac567eaa9f93].

FossilOrigin-Name: 2e9fb1295cd31fc29c97444c3dec82fef68e939f
This commit is contained in:
dan
2016-01-30 15:46:03 +00:00
parent af30fdf6ed
commit 5b6c8e4e1d
7 changed files with 45 additions and 21 deletions
+14 -1
View File
@@ -60,6 +60,19 @@ do_execsql_test json103-220 {
WHERE rowid<7 GROUP BY b ORDER BY b;
} {0 {{"n3":3,"n6":6}} 1 {{"n1":1,"n4":4}} 2 {{"n2":2,"n5":5}}}
# ticket https://www.sqlite.org/src/info/f45ac567eaa9f93c 2016-01-30
# Invalid JSON generated by json_group_array()
#
# The underlying problem is a failure to reset Mem.eSubtype
#
do_execsql_test json103-300 {
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(x);
INSERT INTO t1 VALUES(1),('abc');
SELECT
json_group_array(x),
json_group_array(json_object('x',x))
FROM t1;
} {{[1,"abc"]} {[{"x":1},{"x":"abc"}]}}
finish_test