summaryrefslogtreecommitdiff
path: root/Base/home/anon
diff options
context:
space:
mode:
authorJan de Visser <jan@de-visser.net>2021-11-02 16:29:56 -0400
committerAndreas Kling <kling@serenityos.org>2021-11-10 14:47:49 +0100
commitf3a9d61891204779a6e051213a3cb5bb3e1293f7 (patch)
tree4ed8267b0711652710fe2b25eadb64c37af79618 /Base/home/anon
parent4512e891595580e36ad9093358f7baa0ea93b409 (diff)
downloadserenity-f3a9d61891204779a6e051213a3cb5bb3e1293f7.zip
LibSQL: Add SQL files to assist in troubleshooting
These files contain the same SQL statements as the similarly named tests in Tests/LibSQL/TestSqlStatementExecution.cpp test suite. They can be fed to the sql utility to assist in troubleshooting failing tests.
Diffstat (limited to 'Base/home/anon')
-rw-r--r--Base/home/anon/Documents/sql/insert_values.sql14
-rw-r--r--Base/home/anon/Documents/sql/select_cross_join.sql26
-rw-r--r--Base/home/anon/Documents/sql/select_from_table.sql14
-rw-r--r--Base/home/anon/Documents/sql/select_inner_join.sql27
-rw-r--r--Base/home/anon/Documents/sql/select_with_column_names.sql14
-rw-r--r--Base/home/anon/Documents/sql/select_with_where.sql15
6 files changed, 110 insertions, 0 deletions
diff --git a/Base/home/anon/Documents/sql/insert_values.sql b/Base/home/anon/Documents/sql/insert_values.sql
new file mode 100644
index 0000000000..a9125c1cfb
--- /dev/null
+++ b/Base/home/anon/Documents/sql/insert_values.sql
@@ -0,0 +1,14 @@
+CREATE SCHEMA TestSchema;
+CREATE TABLE TestSchema.TestTable
+(
+ TextColumn text,
+ IntColumn integer
+);
+INSERT INTO TestSchema.TestTable (TextColumn, IntColumn)
+VALUES ('Test_1', 42),
+ ('Test_3', 44),
+ ('Test_2', 43),
+ ('Test_4', 45),
+ ('Test_5', 46);
+SELECT *
+FROM TestSchema.TestTable;
diff --git a/Base/home/anon/Documents/sql/select_cross_join.sql b/Base/home/anon/Documents/sql/select_cross_join.sql
new file mode 100644
index 0000000000..a45090a385
--- /dev/null
+++ b/Base/home/anon/Documents/sql/select_cross_join.sql
@@ -0,0 +1,26 @@
+CREATE SCHEMA TestSchema;
+CREATE TABLE TestSchema.TestTable1
+(
+ TextColumn1 text,
+ IntColumn integer
+);
+CREATE TABLE TestSchema.TestTable2
+(
+ TextColumn2 text,
+ IntColumn integer
+);
+INSERT INTO TestSchema.TestTable1 (TextColumn1, IntColumn)
+VALUES ('Test_1', 42),
+ ('Test_3', 44),
+ ('Test_2', 43),
+ ('Test_4', 45),
+ ('Test_5', 46);
+INSERT INTO TestSchema.TestTable2 (TextColumn2, IntColumn)
+VALUES ('Test_10', 40),
+ ('Test_11', 41),
+ ('Test_12', 42),
+ ('Test_13', 47),
+ ('Test_14', 48);
+SELECT *
+FROM TestSchema.TestTable1,
+ TestSchema.TestTable2;
diff --git a/Base/home/anon/Documents/sql/select_from_table.sql b/Base/home/anon/Documents/sql/select_from_table.sql
new file mode 100644
index 0000000000..a9125c1cfb
--- /dev/null
+++ b/Base/home/anon/Documents/sql/select_from_table.sql
@@ -0,0 +1,14 @@
+CREATE SCHEMA TestSchema;
+CREATE TABLE TestSchema.TestTable
+(
+ TextColumn text,
+ IntColumn integer
+);
+INSERT INTO TestSchema.TestTable (TextColumn, IntColumn)
+VALUES ('Test_1', 42),
+ ('Test_3', 44),
+ ('Test_2', 43),
+ ('Test_4', 45),
+ ('Test_5', 46);
+SELECT *
+FROM TestSchema.TestTable;
diff --git a/Base/home/anon/Documents/sql/select_inner_join.sql b/Base/home/anon/Documents/sql/select_inner_join.sql
new file mode 100644
index 0000000000..0c5a5d1404
--- /dev/null
+++ b/Base/home/anon/Documents/sql/select_inner_join.sql
@@ -0,0 +1,27 @@
+CREATE SCHEMA TestSchema;
+CREATE TABLE TestSchema.TestTable1
+(
+ TextColumn1 text,
+ IntColumn integer
+);
+CREATE TABLE TestSchema.TestTable2
+(
+ TextColumn2 text,
+ IntColumn integer
+);
+INSERT INTO TestSchema.TestTable1 (TextColumn1, IntColumn)
+VALUES ('Test_1', 42),
+ ('Test_3', 44),
+ ('Test_2', 43),
+ ('Test_4', 45),
+ ('Test_5', 46);
+INSERT INTO TestSchema.TestTable2 (TextColumn2, IntColumn)
+VALUES ('Test_10', 40),
+ ('Test_11', 41),
+ ('Test_12', 42),
+ ('Test_13', 47),
+ ('Test_14', 48);
+SELECT TestTable1.IntColumn, TextColumn1, TextColumn2
+FROM TestSchema.TestTable1,
+ TestSchema.TestTable2
+WHERE TestTable1.IntColumn = TestTable2.IntColumn;
diff --git a/Base/home/anon/Documents/sql/select_with_column_names.sql b/Base/home/anon/Documents/sql/select_with_column_names.sql
new file mode 100644
index 0000000000..891fc8e611
--- /dev/null
+++ b/Base/home/anon/Documents/sql/select_with_column_names.sql
@@ -0,0 +1,14 @@
+CREATE SCHEMA TestSchema;
+CREATE TABLE TestSchema.TestTable
+(
+ TextColumn text,
+ IntColumn integer
+);
+INSERT INTO TestSchema.TestTable (TextColumn, IntColumn)
+VALUES ('Test_1', 42),
+ ('Test_3', 44),
+ ('Test_2', 43),
+ ('Test_4', 45),
+ ('Test_5', 46);
+SELECT TextColumn
+FROM TestSchema.TestTable;
diff --git a/Base/home/anon/Documents/sql/select_with_where.sql b/Base/home/anon/Documents/sql/select_with_where.sql
new file mode 100644
index 0000000000..0dfec5be3b
--- /dev/null
+++ b/Base/home/anon/Documents/sql/select_with_where.sql
@@ -0,0 +1,15 @@
+CREATE SCHEMA TestSchema;
+CREATE TABLE TestSchema.TestTable
+(
+ TextColumn text,
+ IntColumn integer
+);
+INSERT INTO TestSchema.TestTable (TextColumn, IntColumn)
+VALUES ('Test_1', 42),
+ ('Test_3', 44),
+ ('Test_2', 43),
+ ('Test_4', 45),
+ ('Test_5', 46);
+SELECT TextColumn, IntColumn
+FROM TestSchema.TestTable
+WHERE IntColumn > 44;