Skip to content

Commit 63c5d2e

Browse files
committed
Update SQLite to 3.44.0
1 parent 3d06a71 commit 63c5d2e

File tree

11 files changed

+191
-10
lines changed

11 files changed

+191
-10
lines changed

ps1/Update-Deps.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Downloads non-NuGet deps
22

3-
$sqliteCodeUrl = 'https://sqlite.org/2023/sqlite-amalgamation-3430100.zip'
4-
$sqliteCodeHash = '7E634BBD4B2870A83DC7C1E3CC02E4D30B8555CD7DB7B332F24E0C447FD0DD16'
5-
$sqliteDocUrl = 'https://sqlite.org/2023/sqlite-doc-3430100.zip'
6-
$sqliteDocHash = 'DE4E2B6489F3EF4F7068C77D9DF11A7C099851CD2431C457C88EE194EB56D41D'
7-
$sqliteSrcUrl = 'https://sqlite.org/2023/sqlite-src-3430100.zip'
8-
$sqliteSrcHash = '22E9C2EF49FE6F8A2DBC93C4D3DCE09C6D6A4F563DE52B0A8171AD49A8C72917'
3+
$sqliteCodeUrl = 'https://sqlite.org/2023/sqlite-amalgamation-3440000.zip'
4+
$sqliteCodeHash = '93299C8D2C8397622FE00BD807204B1F58815F45BDA8097BF93B3BF759A3EBAD'
5+
$sqliteDocUrl = 'https://sqlite.org/2023/sqlite-doc-3440000.zip'
6+
$sqliteDocHash = '3E3A2DA6FA6F74A1C02292ABE153677C6160AEBFFEE4E9A710FB51437DBEE541'
7+
$sqliteSrcUrl = 'https://sqlite.org/2023/sqlite-src-3440000.zip'
8+
$sqliteSrcHash = 'AB9AAE38A11B931F35D8D1C6D62826D215579892E6FFBF89F20BDCE106A9C8C5'
99

1010
$wapiUrl = 'https://github.com/contre/Windows-API-Code-Pack-1.1/archive/a8377ef8bb6fa95ff8800dd4c79089537087d539.zip'
1111
$wapiHash = '38E59E6AE3BF0FD0CCB05C026F7332D3B56AF81D8C69A62882D04CABAD5EF4AE'

src/SqlNotebook/SqlNotebook.csproj

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1284,6 +1284,9 @@
12841284
<None Update="doc\sqlite\c3ref\get_auxdata.html">
12851285
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
12861286
</None>
1287+
<None Update="doc\sqlite\c3ref\get_clientdata.html">
1288+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
1289+
</None>
12871290
<None Update="doc\sqlite\c3ref\hard_heap_limit64.html">
12881291
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
12891292
</None>
@@ -2514,6 +2517,12 @@
25142517
<None Update="doc\sqlite\releaselog\3_43_1.html">
25152518
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
25162519
</None>
2520+
<None Update="doc\sqlite\releaselog\3_43_2.html">
2521+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2522+
</None>
2523+
<None Update="doc\sqlite\releaselog\3_44_0.html">
2524+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2525+
</None>
25172526
<None Update="doc\sqlite\releaselog\3_4_0.html">
25182527
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
25192528
</None>
@@ -2838,7 +2847,7 @@
28382847
<None Update="doc\sqlite\session\constlist.html">
28392848
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
28402849
</None>
2841-
<None Update="doc\sqlite\session\c_changesetapply_ignorenoop.html">
2850+
<None Update="doc\sqlite\session\c_changesetapply_fknoaction.html">
28422851
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
28432852
</None>
28442853
<None Update="doc\sqlite\session\c_changesetstart_invert.html">
@@ -2886,6 +2895,9 @@
28862895
<None Update="doc\sqlite\session\sqlite3changegroup_output.html">
28872896
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
28882897
</None>
2898+
<None Update="doc\sqlite\session\sqlite3changegroup_schema.html">
2899+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2900+
</None>
28892901
<None Update="doc\sqlite\session\sqlite3changeset_apply.html">
28902902
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
28912903
</None>
@@ -2922,6 +2934,9 @@
29222934
<None Update="doc\sqlite\session\sqlite3changeset_start.html">
29232935
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
29242936
</None>
2937+
<None Update="doc\sqlite\session\sqlite3changeset_upgrade.html">
2938+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2939+
</None>
29252940
<None Update="doc\sqlite\session\sqlite3rebaser_configure.html">
29262941
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
29272942
</None>
@@ -3072,6 +3087,9 @@
30723087
<None Update="doc\sqlite\syntax\frame-spec.html">
30733088
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
30743089
</None>
3090+
<None Update="doc\sqlite\syntax\function-arguments.html">
3091+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
3092+
</None>
30753093
<None Update="doc\sqlite\syntax\indexed-column.html">
30763094
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
30773095
</None>

src/SqlNotebookDb/db.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#define SQLITE_ENABLE_STMTVTAB 1
4141
#define SQLITE_ENABLE_STAT4 1
4242
#define SQLITE_SOUNDEX 1
43+
#define SQLITE_USE_SEH 1
4344

4445
// Options To Omit Features
4546
#define SQLITE_OMIT_DESERIALIZE 1

src/SqlNotebookScript/Interpreter/SqliteGrammar.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ static SqliteGrammar()
838838
// <bind-parameter> |
839839
// [ [ database-name "." ] table-name "." ] column-name |
840840
// window-function-invocation |
841-
// function-name "(" [ [DISTINCT] <expr> [ "," <expr> ]* | "*" ] ")" |
841+
// function-name "(" [ [DISTINCT] <expr> [ "," <expr> ]* [ ORDER BY <ordering-term> [ "," <ordering-term> ] ] | "*" ] ")" |
842842
// "(" <expr> ["," <expr>]* ")" |
843843
// CAST "(" <expr> AS <type-name> ")" |
844844
// [ [NOT] EXISTS ] ( <select-stmt> ) |
@@ -850,7 +850,7 @@ static SqliteGrammar()
850850
Or(
851851
// window-function-invocation -- must be above simple/aggregate function invocation
852852
Prod($"{p}.window-function-invocation", 1, SubProd("window-function-invocation")),
853-
// expr ::= function-name "(" [ [DISTINCT] <expr> [ "," <expr> ]* | "*" ] ")"
853+
// expr ::= function-name "(" [ [DISTINCT] <expr> [ "," <expr> ]* [ ORDER BY <ordering-term> [ "," <ordering-term> ] ] | "*" ] ")"
854854
// (this is aggregate-function-invocation in the SQLite docs now)
855855
Prod(
856856
$"{p}.function-call",
@@ -864,7 +864,12 @@ static SqliteGrammar()
864864
$"{p}.args",
865865
2,
866866
Opt(Tok(TokenType.Distinct)),
867-
Lst($"{p}.arg", TokenType.Comma, 1, SubProd("expr"))
867+
Lst($"{p}.arg", TokenType.Comma, 1, SubProd("expr")),
868+
Opt(
869+
Tok(TokenType.Order),
870+
Tok(TokenType.By),
871+
Lst($"{p}.ordering-term", TokenType.Comma, 1, SubProd("ordering-term"))
872+
)
868873
)
869874
)
870875
),

src/Tests/ScriptTest.g.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public sealed partial class ScriptTest {
99
[TestMethod] public void Test_ALTER_TABLE_DROP_COLUMN_2_sql() => TestScript(@"ALTER TABLE DROP COLUMN 2.sql");
1010
[TestMethod] public void Test_ALTER_TABLE_RENAME_COLUMN_1_sql() => TestScript(@"ALTER TABLE RENAME COLUMN 1.sql");
1111
[TestMethod] public void Test_ALTER_TABLE_RENAME_COLUMN_2_sql() => TestScript(@"ALTER TABLE RENAME COLUMN 2.sql");
12+
[TestMethod] public void Test_CONCAT_and_CONCAT_WS_sql() => TestScript(@"CONCAT and CONCAT_WS.sql");
1213
[TestMethod] public void Test_CREATE_TABLE_duplicate_options_sql() => TestScript(@"CREATE TABLE duplicate options.sql");
1314
[TestMethod] public void Test_CREATE_TABLE_STRICT_sql() => TestScript(@"CREATE TABLE STRICT.sql");
1415
[TestMethod] public void Test_CREATE_TABLE_WITHOUT_ROWID_sql() => TestScript(@"CREATE TABLE WITHOUT ROWID.sql");
@@ -95,6 +96,8 @@ public sealed partial class ScriptTest {
9596
[TestMethod] public void Test_IMPORT_XLS_sql() => TestScript(@"IMPORT XLS.sql");
9697
[TestMethod] public void Test_IN_table_valued_function_sql() => TestScript(@"IN table-valued function.sql");
9798
[TestMethod] public void Test_INSERT_RETURNING_sql() => TestScript(@"INSERT RETURNING.sql");
99+
[TestMethod] public void Test_JSON_GROUP_ARRAY_with_ORDER_BY_sql() => TestScript(@"JSON_GROUP_ARRAY with ORDER BY.sql");
100+
[TestMethod] public void Test_JSON_GROUP_ARRAY_sql() => TestScript(@"JSON_GROUP_ARRAY.sql");
98101
[TestMethod] public void Test_LIST_FILES_sql() => TestScript(@"LIST_FILES.sql");
99102
[TestMethod] public void Test_NEWID_sql() => TestScript(@"NEWID.sql");
100103
[TestMethod] public void Test_NOW_sql() => TestScript(@"NOW.sql");
@@ -108,6 +111,9 @@ public sealed partial class ScriptTest {
108111
[TestMethod] public void Test_RETURN_sql() => TestScript(@"RETURN.sql");
109112
[TestMethod] public void Test_RIGHT_JOIN_sql() => TestScript(@"RIGHT JOIN.sql");
110113
[TestMethod] public void Test_RIGHT_OUTER_JOIN_sql() => TestScript(@"RIGHT OUTER JOIN.sql");
114+
[TestMethod] public void Test_STRFTIME_new_conversion_letters_in_v3_44_0_sql() => TestScript(@"STRFTIME new conversion letters in v3.44.0.sql");
115+
[TestMethod] public void Test_STRING_AGG_with_ORDER_BY_sql() => TestScript(@"STRING_AGG with ORDER BY.sql");
116+
[TestMethod] public void Test_STRING_AGG_sql() => TestScript(@"STRING_AGG.sql");
111117
[TestMethod] public void Test_THROW_from_sub_script_sql() => TestScript(@"THROW from sub-script.sql");
112118
[TestMethod] public void Test_THROW_rethrow_sql() => TestScript(@"THROW rethrow.sql");
113119
[TestMethod] public void Test_THROW_sql() => TestScript(@"THROW.sql");
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
CREATE TABLE test_data (
2+
id INTEGER PRIMARY KEY,
3+
first_name TEXT,
4+
last_name TEXT,
5+
city TEXT
6+
);
7+
8+
INSERT INTO test_data (first_name, last_name, city)
9+
VALUES ('John', 'Doe', 'New York'),
10+
('Jane', 'Doe', 'Los Angeles'),
11+
('Jim', 'Beam', 'Chicago');
12+
13+
SELECT concat(first_name, ' ', last_name) AS full_name
14+
FROM test_data;
15+
16+
SELECT concat_ws(', ', first_name, last_name, city) AS full_information
17+
FROM test_data;
18+
19+
SELECT concat('', first_name) AS result
20+
FROM test_data;
21+
22+
SELECT concat_ws('', first_name, last_name) AS result
23+
FROM test_data;
24+
25+
SELECT concat(NULL, first_name) AS result
26+
FROM test_data;
27+
28+
SELECT concat_ws(', ', NULL, first_name, last_name) AS result
29+
FROM test_data;
30+
31+
--output--
32+
full_name
33+
John Doe
34+
Jane Doe
35+
Jim Beam
36+
-
37+
full_information
38+
John, Doe, New York
39+
Jane, Doe, Los Angeles
40+
Jim, Beam, Chicago
41+
-
42+
result
43+
John
44+
Jane
45+
Jim
46+
-
47+
result
48+
JohnDoe
49+
JaneDoe
50+
JimBeam
51+
-
52+
result
53+
John
54+
Jane
55+
Jim
56+
-
57+
result
58+
John, Doe
59+
Jane, Doe
60+
Jim, Beam
61+
-
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CREATE TABLE test (id INTEGER PRIMARY KEY, value TEXT);
2+
3+
INSERT INTO test (value) VALUES ('apple'), ('banana'), ('cherry');
4+
5+
SELECT json_group_array(value ORDER BY value DESC) AS json_array FROM test;
6+
--output--
7+
json_array
8+
["cherry","banana","apple"]
9+
-
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CREATE TABLE test (id INTEGER PRIMARY KEY, value TEXT);
2+
3+
INSERT INTO test (value) VALUES ('apple'), ('banana'), ('cherry');
4+
5+
SELECT json_group_array(value) AS json_array FROM test;
6+
--output--
7+
json_array
8+
["apple","banana","cherry"]
9+
-
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
CREATE TABLE test (id INTEGER PRIMARY KEY, timestamp DATETIME);
2+
3+
INSERT INTO test (timestamp) VALUES ('2023-11-05 15:45:30');
4+
5+
SELECT strftime('%e', timestamp) AS day_of_month FROM test;
6+
7+
SELECT strftime('%F', timestamp) AS date FROM test;
8+
9+
SELECT strftime('%I', timestamp) AS hour_12 FROM test;
10+
11+
SELECT strftime('%k', timestamp) AS hour_24 FROM test;
12+
13+
SELECT strftime('%l', timestamp) AS hour_12_blank FROM test;
14+
15+
SELECT strftime('%p', timestamp) AS am_pm FROM test;
16+
17+
SELECT strftime('%P', timestamp) AS am_pm_lower FROM test;
18+
19+
SELECT strftime('%R', timestamp) AS time_24 FROM test;
20+
21+
SELECT strftime('%T', timestamp) AS time FROM test;
22+
23+
SELECT strftime('%u', timestamp) AS day_of_week FROM test;
24+
--output--
25+
day_of_month
26+
5
27+
-
28+
date
29+
2023-11-05
30+
-
31+
hour_12
32+
03
33+
-
34+
hour_24
35+
15
36+
-
37+
hour_12_blank
38+
3
39+
-
40+
am_pm
41+
PM
42+
-
43+
am_pm_lower
44+
pm
45+
-
46+
time_24
47+
15:45
48+
-
49+
time
50+
15:45:30
51+
-
52+
day_of_week
53+
7
54+
-
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CREATE TABLE test (id INTEGER PRIMARY KEY, value TEXT);
2+
3+
INSERT INTO test (value) VALUES ('apple'), ('banana'), ('cherry');
4+
5+
SELECT string_agg(value, ', ' ORDER BY value ASC) AS aggregated_string FROM test;
6+
--output--
7+
aggregated_string
8+
apple, banana, cherry
9+
-

0 commit comments

Comments
 (0)