OLD | NEW |
1 # 2015-12-30 | 1 # 2015-12-30 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #*********************************************************************** | 10 #*********************************************************************** |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 do_execsql_test json103-210 { | 54 do_execsql_test json103-210 { |
55 SELECT json_group_object(c,a) FROM t1 | 55 SELECT json_group_object(c,a) FROM t1 |
56 WHERE rowid BETWEEN 31 AND 39 AND rowid%2==1; | 56 WHERE rowid BETWEEN 31 AND 39 AND rowid%2==1; |
57 } {{{"n31":32.5,"n33":33,"n35":35,"n37":null,"n39":"orange"}}} | 57 } {{{"n31":32.5,"n33":33,"n35":35,"n37":null,"n39":"orange"}}} |
58 do_execsql_test json103-220 { | 58 do_execsql_test json103-220 { |
59 SELECT b, json_group_object(c,a) FROM t1 | 59 SELECT b, json_group_object(c,a) FROM t1 |
60 WHERE rowid<7 GROUP BY b ORDER BY b; | 60 WHERE rowid<7 GROUP BY b ORDER BY b; |
61 } {0 {{"n3":3,"n6":6}} 1 {{"n1":1,"n4":4}} 2 {{"n2":2,"n5":5}}} | 61 } {0 {{"n3":3,"n6":6}} 1 {{"n1":1,"n4":4}} 2 {{"n2":2,"n5":5}}} |
62 | 62 |
63 | 63 # ticket https://www.sqlite.org/src/info/f45ac567eaa9f93c 2016-01-30 |
| 64 # Invalid JSON generated by json_group_array() |
| 65 # |
| 66 # The underlying problem is a failure to reset Mem.eSubtype |
| 67 # |
| 68 do_execsql_test json103-300 { |
| 69 DROP TABLE IF EXISTS t1; |
| 70 CREATE TABLE t1(x); |
| 71 INSERT INTO t1 VALUES(1),('abc'); |
| 72 SELECT |
| 73 json_group_array(x), |
| 74 json_group_array(json_object('x',x)) |
| 75 FROM t1; |
| 76 } {{[1,"abc"]} {[{"x":1},{"x":"abc"}]}} |
64 | 77 |
65 finish_test | 78 finish_test |
OLD | NEW |