fixed merging
authorAnja Bruls <anja@transceptor.technology>
Wed, 5 Dec 2018 15:26:04 +0000 (16:26 +0100)
committerAnja Bruls <anja@transceptor.technology>
Wed, 5 Dec 2018 15:26:04 +0000 (16:26 +0100)
115 files changed:
dbtest/.accounts.dat [new file with mode: 0644]
dbtest/dbpath0/.accounts.dat [new file with mode: 0644]
dbtest/dbpath0/anja/.dropped [new file with mode: 0644]
dbtest/dbpath0/anja/.max_series_id [new file with mode: 0644]
dbtest/dbpath0/anja/buffer.dat [new file with mode: 0644]
dbtest/dbpath0/anja/database.conf [new file with mode: 0644]
dbtest/dbpath0/anja/database.dat [new file with mode: 0644]
dbtest/dbpath0/anja/groups.dat [new file with mode: 0644]
dbtest/dbpath0/anja/series.dat [new file with mode: 0644]
dbtest/dbpath0/anja/servers.dat [new file with mode: 0644]
dbtest/dbpath0/anja/users.dat [new file with mode: 0644]
dbtest/dbpath0/benchmark/.dropped [new file with mode: 0644]
dbtest/dbpath0/benchmark/.max_series_id [new file with mode: 0644]
dbtest/dbpath0/benchmark/buffer.dat [new file with mode: 0644]
dbtest/dbpath0/benchmark/database.conf [new file with mode: 0644]
dbtest/dbpath0/benchmark/database.dat [new file with mode: 0644]
dbtest/dbpath0/benchmark/groups.dat [new file with mode: 0644]
dbtest/dbpath0/benchmark/series.dat [new file with mode: 0644]
dbtest/dbpath0/benchmark/servers.dat [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000000.idx [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000000.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000001.idx [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000001.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000002.idx [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000002.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000003.idx [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000003.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000004.idx [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000004.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000005.idx [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000005.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000006.idx [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000006.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000007.idx [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000007.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000008.idx [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000008.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000009.idx [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000009.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000010.idx [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000010.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000011.idx [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000011.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000012.idx [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000012.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000013.idx [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000013.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000014.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000015.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000016.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000017.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000018.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000019.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000020.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000021.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000022.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000023.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000024.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000025.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000026.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000027.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000028.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000029.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000030.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/1451520000000000031.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/shards/__1451520000000000014.sdb [new file with mode: 0644]
dbtest/dbpath0/benchmark/users.dat [new file with mode: 0644]
dbtest/dbpath1/.accounts.dat [new file with mode: 0644]
dbtest/dbpath1/benchmark/.dropped [new file with mode: 0644]
dbtest/dbpath1/benchmark/buffer.dat [new file with mode: 0644]
dbtest/dbpath1/benchmark/database.conf [new file with mode: 0644]
dbtest/dbpath1/benchmark/database.dat [new file with mode: 0644]
dbtest/dbpath1/benchmark/groups.dat [new file with mode: 0644]
dbtest/dbpath1/benchmark/series.dat [new file with mode: 0644]
dbtest/dbpath1/benchmark/servers.dat [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000000.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000001.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000002.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000003.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000004.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000005.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000006.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000007.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000008.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000009.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000010.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000011.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000012.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000013.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000014.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000015.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000016.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000017.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000018.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000019.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000020.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000021.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000022.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000023.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000024.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000025.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000026.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000027.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000028.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000029.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000030.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/shards/1451520000000000031.sdb [new file with mode: 0644]
dbtest/dbpath1/benchmark/users.dat [new file with mode: 0644]
dbtest/siridb-http.conf [new file with mode: 0644]
dbtest/siridb0.conf [new file with mode: 0644]
dbtest/siridb1.conf [new file with mode: 0644]
itest/run_all.py
itest/test_select.py
itest/test_select_ns.py [new file with mode: 0644]
src/siri/db/points.c

diff --git a/dbtest/.accounts.dat b/dbtest/.accounts.dat
new file mode 100644 (file)
index 0000000..dcb4dd4
--- /dev/null
@@ -0,0 +1 @@
+ü\ 1ï\82sa¿EI5djmJS$1DhOYRlSPpQ7LKlNlnT.npvRhg8uQPlWkoQRNhKPXnNknMtrRuKUTR
\ No newline at end of file
diff --git a/dbtest/dbpath0/.accounts.dat b/dbtest/dbpath0/.accounts.dat
new file mode 100644 (file)
index 0000000..2eb141d
--- /dev/null
@@ -0,0 +1 @@
+ü\ 1ï\82sa¿4xt4e1rb$1HuVsdC7ZpFcCbsI1.Vmo7hBGsbsYFFbmV/7dcHKvQJlHzw1VQ8uoG
\ No newline at end of file
diff --git a/dbtest/dbpath0/anja/.dropped b/dbtest/dbpath0/anja/.dropped
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/dbtest/dbpath0/anja/.max_series_id b/dbtest/dbpath0/anja/.max_series_id
new file mode 100644 (file)
index 0000000..d540dfd
Binary files /dev/null and b/dbtest/dbpath0/anja/.max_series_id differ
diff --git a/dbtest/dbpath0/anja/buffer.dat b/dbtest/dbpath0/anja/buffer.dat
new file mode 100644 (file)
index 0000000..0ab1802
Binary files /dev/null and b/dbtest/dbpath0/anja/buffer.dat differ
diff --git a/dbtest/dbpath0/anja/database.conf b/dbtest/dbpath0/anja/database.conf
new file mode 100644 (file)
index 0000000..b56a91b
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# Welcome to the SiriDB configuration file
+#
+
+[buffer]
+# Alternative path to save the buffer file.
+# In case you later plan to change this location you manually need to move
+# the buffer file to the new location.
+# path = <buffer_path>
+
+# Buffer size in bytes. This size must be a multiple of 512 with a maximum
+# of 1048576 bytes. Be careful using large values since SiriDB will require
+# memory based on this value. A value between 1024 and 32768 is recommended.
+# size = 1024
+
+size = 1024
diff --git a/dbtest/dbpath0/anja/database.dat b/dbtest/dbpath0/anja/database.dat
new file mode 100644 (file)
index 0000000..27f24b4
Binary files /dev/null and b/dbtest/dbpath0/anja/database.dat differ
diff --git a/dbtest/dbpath0/anja/groups.dat b/dbtest/dbpath0/anja/groups.dat
new file mode 100644 (file)
index 0000000..3c82d7a
--- /dev/null
@@ -0,0 +1 @@
+ü\ 1
\ No newline at end of file
diff --git a/dbtest/dbpath0/anja/series.dat b/dbtest/dbpath0/anja/series.dat
new file mode 100644 (file)
index 0000000..22057fe
Binary files /dev/null and b/dbtest/dbpath0/anja/series.dat differ
diff --git a/dbtest/dbpath0/anja/servers.dat b/dbtest/dbpath0/anja/servers.dat
new file mode 100644 (file)
index 0000000..05c9a45
Binary files /dev/null and b/dbtest/dbpath0/anja/servers.dat differ
diff --git a/dbtest/dbpath0/anja/users.dat b/dbtest/dbpath0/anja/users.dat
new file mode 100644 (file)
index 0000000..4ce0f39
--- /dev/null
@@ -0,0 +1 @@
+ü\ 1ð\84iris¿/ITTEIBl$1Q7urI1k4h4PCfGgCI5ifj7Iyc8wqJVdAU5h/TSinJUe5ObdeH5V0Méÿ\ 3
\ No newline at end of file
diff --git a/dbtest/dbpath0/benchmark/.dropped b/dbtest/dbpath0/benchmark/.dropped
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/dbtest/dbpath0/benchmark/.max_series_id b/dbtest/dbpath0/benchmark/.max_series_id
new file mode 100644 (file)
index 0000000..01387f5
Binary files /dev/null and b/dbtest/dbpath0/benchmark/.max_series_id differ
diff --git a/dbtest/dbpath0/benchmark/buffer.dat b/dbtest/dbpath0/benchmark/buffer.dat
new file mode 100644 (file)
index 0000000..23db84e
Binary files /dev/null and b/dbtest/dbpath0/benchmark/buffer.dat differ
diff --git a/dbtest/dbpath0/benchmark/database.conf b/dbtest/dbpath0/benchmark/database.conf
new file mode 100644 (file)
index 0000000..b56a91b
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# Welcome to the SiriDB configuration file
+#
+
+[buffer]
+# Alternative path to save the buffer file.
+# In case you later plan to change this location you manually need to move
+# the buffer file to the new location.
+# path = <buffer_path>
+
+# Buffer size in bytes. This size must be a multiple of 512 with a maximum
+# of 1048576 bytes. Be careful using large values since SiriDB will require
+# memory based on this value. A value between 1024 and 32768 is recommended.
+# size = 1024
+
+size = 1024
diff --git a/dbtest/dbpath0/benchmark/database.dat b/dbtest/dbpath0/benchmark/database.dat
new file mode 100644 (file)
index 0000000..69d8581
Binary files /dev/null and b/dbtest/dbpath0/benchmark/database.dat differ
diff --git a/dbtest/dbpath0/benchmark/groups.dat b/dbtest/dbpath0/benchmark/groups.dat
new file mode 100644 (file)
index 0000000..3c82d7a
--- /dev/null
@@ -0,0 +1 @@
+ü\ 1
\ No newline at end of file
diff --git a/dbtest/dbpath0/benchmark/series.dat b/dbtest/dbpath0/benchmark/series.dat
new file mode 100644 (file)
index 0000000..6d1def4
Binary files /dev/null and b/dbtest/dbpath0/benchmark/series.dat differ
diff --git a/dbtest/dbpath0/benchmark/servers.dat b/dbtest/dbpath0/benchmark/servers.dat
new file mode 100644 (file)
index 0000000..e81f0aa
Binary files /dev/null and b/dbtest/dbpath0/benchmark/servers.dat differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000000.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000000.idx
new file mode 100644 (file)
index 0000000..3dc3071
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000000.idx differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000000.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000000.sdb
new file mode 100644 (file)
index 0000000..414401a
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000000.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000001.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000001.idx
new file mode 100644 (file)
index 0000000..0c2f75e
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000001.idx differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000001.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000001.sdb
new file mode 100644 (file)
index 0000000..9985471
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000001.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000002.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000002.idx
new file mode 100644 (file)
index 0000000..9ae6160
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000002.idx differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000002.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000002.sdb
new file mode 100644 (file)
index 0000000..b671694
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000002.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000003.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000003.idx
new file mode 100644 (file)
index 0000000..ef59043
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000003.idx differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000003.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000003.sdb
new file mode 100644 (file)
index 0000000..f6bce1c
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000003.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000004.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000004.idx
new file mode 100644 (file)
index 0000000..6884094
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000004.idx differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000004.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000004.sdb
new file mode 100644 (file)
index 0000000..843b7ea
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000004.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000005.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000005.idx
new file mode 100644 (file)
index 0000000..5f36889
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000005.idx differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000005.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000005.sdb
new file mode 100644 (file)
index 0000000..bb1cd00
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000005.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000006.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000006.idx
new file mode 100644 (file)
index 0000000..a4af065
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000006.idx differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000006.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000006.sdb
new file mode 100644 (file)
index 0000000..c41c590
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000006.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000007.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000007.idx
new file mode 100644 (file)
index 0000000..6f92932
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000007.idx differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000007.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000007.sdb
new file mode 100644 (file)
index 0000000..163f5d9
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000007.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000008.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000008.idx
new file mode 100644 (file)
index 0000000..4564c67
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000008.idx differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000008.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000008.sdb
new file mode 100644 (file)
index 0000000..f0920f9
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000008.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000009.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000009.idx
new file mode 100644 (file)
index 0000000..46c7334
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000009.idx differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000009.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000009.sdb
new file mode 100644 (file)
index 0000000..ff6a2df
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000009.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000010.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000010.idx
new file mode 100644 (file)
index 0000000..ded7b9c
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000010.idx differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000010.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000010.sdb
new file mode 100644 (file)
index 0000000..43dd682
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000010.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000011.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000011.idx
new file mode 100644 (file)
index 0000000..91d2364
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000011.idx differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000011.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000011.sdb
new file mode 100644 (file)
index 0000000..0f10199
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000011.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000012.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000012.idx
new file mode 100644 (file)
index 0000000..9b30115
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000012.idx differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000012.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000012.sdb
new file mode 100644 (file)
index 0000000..7869995
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000012.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000013.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000013.idx
new file mode 100644 (file)
index 0000000..cde04a7
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000013.idx differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000013.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000013.sdb
new file mode 100644 (file)
index 0000000..c9c1dcb
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000013.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000014.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000014.sdb
new file mode 100644 (file)
index 0000000..0ee2c0d
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000014.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000015.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000015.sdb
new file mode 100644 (file)
index 0000000..b7e1243
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000015.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000016.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000016.sdb
new file mode 100644 (file)
index 0000000..351ca75
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000016.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000017.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000017.sdb
new file mode 100644 (file)
index 0000000..09f22c5
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000017.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000018.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000018.sdb
new file mode 100644 (file)
index 0000000..7249717
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000018.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000019.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000019.sdb
new file mode 100644 (file)
index 0000000..49bc9d2
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000019.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000020.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000020.sdb
new file mode 100644 (file)
index 0000000..8123b4d
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000020.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000021.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000021.sdb
new file mode 100644 (file)
index 0000000..bc55f15
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000021.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000022.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000022.sdb
new file mode 100644 (file)
index 0000000..27dda82
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000022.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000023.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000023.sdb
new file mode 100644 (file)
index 0000000..f1563da
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000023.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000024.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000024.sdb
new file mode 100644 (file)
index 0000000..34a2869
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000024.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000025.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000025.sdb
new file mode 100644 (file)
index 0000000..6d8a6ff
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000025.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000026.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000026.sdb
new file mode 100644 (file)
index 0000000..bc543fd
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000026.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000027.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000027.sdb
new file mode 100644 (file)
index 0000000..b2275b7
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000027.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000028.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000028.sdb
new file mode 100644 (file)
index 0000000..f2b4a55
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000028.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000029.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000029.sdb
new file mode 100644 (file)
index 0000000..b65c217
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000029.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000030.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000030.sdb
new file mode 100644 (file)
index 0000000..430cc4b
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000030.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000031.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000031.sdb
new file mode 100644 (file)
index 0000000..0364bd0
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000031.sdb differ
diff --git a/dbtest/dbpath0/benchmark/shards/__1451520000000000014.sdb b/dbtest/dbpath0/benchmark/shards/__1451520000000000014.sdb
new file mode 100644 (file)
index 0000000..01dd929
Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/__1451520000000000014.sdb differ
diff --git a/dbtest/dbpath0/benchmark/users.dat b/dbtest/dbpath0/benchmark/users.dat
new file mode 100644 (file)
index 0000000..04d03e1
--- /dev/null
@@ -0,0 +1 @@
+ü\ 1ð\84iris¿gre84FaJ$1iMGwWNldUGnKIJjNj7bLkNHIW6PwOJiDOITEk4XLnIE9gLeBZIuFKéÿ\ 3
\ No newline at end of file
diff --git a/dbtest/dbpath1/.accounts.dat b/dbtest/dbpath1/.accounts.dat
new file mode 100644 (file)
index 0000000..3c4e443
--- /dev/null
@@ -0,0 +1 @@
+ü\ 1ï\82sa¿vZEWv13W$172ZCeYcCY4qc9yWq4Rn.V4DecWWXIU55S/c93sBDcPzyZZ8b6teaR
\ No newline at end of file
diff --git a/dbtest/dbpath1/benchmark/.dropped b/dbtest/dbpath1/benchmark/.dropped
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/dbtest/dbpath1/benchmark/buffer.dat b/dbtest/dbpath1/benchmark/buffer.dat
new file mode 100644 (file)
index 0000000..f28c469
Binary files /dev/null and b/dbtest/dbpath1/benchmark/buffer.dat differ
diff --git a/dbtest/dbpath1/benchmark/database.conf b/dbtest/dbpath1/benchmark/database.conf
new file mode 100644 (file)
index 0000000..b56a91b
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# Welcome to the SiriDB configuration file
+#
+
+[buffer]
+# Alternative path to save the buffer file.
+# In case you later plan to change this location you manually need to move
+# the buffer file to the new location.
+# path = <buffer_path>
+
+# Buffer size in bytes. This size must be a multiple of 512 with a maximum
+# of 1048576 bytes. Be careful using large values since SiriDB will require
+# memory based on this value. A value between 1024 and 32768 is recommended.
+# size = 1024
+
+size = 1024
diff --git a/dbtest/dbpath1/benchmark/database.dat b/dbtest/dbpath1/benchmark/database.dat
new file mode 100644 (file)
index 0000000..75b2fcc
Binary files /dev/null and b/dbtest/dbpath1/benchmark/database.dat differ
diff --git a/dbtest/dbpath1/benchmark/groups.dat b/dbtest/dbpath1/benchmark/groups.dat
new file mode 100644 (file)
index 0000000..3c82d7a
--- /dev/null
@@ -0,0 +1 @@
+ü\ 1
\ No newline at end of file
diff --git a/dbtest/dbpath1/benchmark/series.dat b/dbtest/dbpath1/benchmark/series.dat
new file mode 100644 (file)
index 0000000..b1e51fa
Binary files /dev/null and b/dbtest/dbpath1/benchmark/series.dat differ
diff --git a/dbtest/dbpath1/benchmark/servers.dat b/dbtest/dbpath1/benchmark/servers.dat
new file mode 100644 (file)
index 0000000..d6fb046
Binary files /dev/null and b/dbtest/dbpath1/benchmark/servers.dat differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000000.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000000.sdb
new file mode 100644 (file)
index 0000000..cc72f87
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000000.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000001.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000001.sdb
new file mode 100644 (file)
index 0000000..570d307
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000001.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000002.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000002.sdb
new file mode 100644 (file)
index 0000000..0bd7772
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000002.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000003.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000003.sdb
new file mode 100644 (file)
index 0000000..4c32ce6
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000003.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000004.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000004.sdb
new file mode 100644 (file)
index 0000000..9f82b6f
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000004.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000005.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000005.sdb
new file mode 100644 (file)
index 0000000..3147145
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000005.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000006.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000006.sdb
new file mode 100644 (file)
index 0000000..6e16076
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000006.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000007.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000007.sdb
new file mode 100644 (file)
index 0000000..28e0170
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000007.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000008.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000008.sdb
new file mode 100644 (file)
index 0000000..d77d432
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000008.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000009.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000009.sdb
new file mode 100644 (file)
index 0000000..b65dc65
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000009.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000010.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000010.sdb
new file mode 100644 (file)
index 0000000..5bf9df7
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000010.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000011.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000011.sdb
new file mode 100644 (file)
index 0000000..7e05338
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000011.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000012.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000012.sdb
new file mode 100644 (file)
index 0000000..e3ece24
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000012.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000013.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000013.sdb
new file mode 100644 (file)
index 0000000..994b42e
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000013.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000014.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000014.sdb
new file mode 100644 (file)
index 0000000..29ede03
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000014.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000015.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000015.sdb
new file mode 100644 (file)
index 0000000..fee28bf
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000015.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000016.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000016.sdb
new file mode 100644 (file)
index 0000000..98016cf
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000016.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000017.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000017.sdb
new file mode 100644 (file)
index 0000000..d91ee14
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000017.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000018.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000018.sdb
new file mode 100644 (file)
index 0000000..e0f8943
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000018.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000019.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000019.sdb
new file mode 100644 (file)
index 0000000..9a4a7e6
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000019.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000020.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000020.sdb
new file mode 100644 (file)
index 0000000..ee308d6
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000020.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000021.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000021.sdb
new file mode 100644 (file)
index 0000000..7d02fad
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000021.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000022.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000022.sdb
new file mode 100644 (file)
index 0000000..00fa673
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000022.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000023.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000023.sdb
new file mode 100644 (file)
index 0000000..998a2c8
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000023.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000024.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000024.sdb
new file mode 100644 (file)
index 0000000..d33904c
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000024.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000025.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000025.sdb
new file mode 100644 (file)
index 0000000..d79f537
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000025.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000026.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000026.sdb
new file mode 100644 (file)
index 0000000..41de6b4
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000026.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000027.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000027.sdb
new file mode 100644 (file)
index 0000000..068fc89
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000027.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000028.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000028.sdb
new file mode 100644 (file)
index 0000000..049b662
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000028.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000029.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000029.sdb
new file mode 100644 (file)
index 0000000..3485be0
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000029.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000030.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000030.sdb
new file mode 100644 (file)
index 0000000..ef50350
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000030.sdb differ
diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000031.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000031.sdb
new file mode 100644 (file)
index 0000000..bfc1658
Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000031.sdb differ
diff --git a/dbtest/dbpath1/benchmark/users.dat b/dbtest/dbpath1/benchmark/users.dat
new file mode 100644 (file)
index 0000000..7f06059
--- /dev/null
@@ -0,0 +1 @@
+ü\ 1ð\84iris¿ZkjWsLgK$1/L2Uzs0bnkc01bpT/0KOlPC5hTe1d.xb6COEOdQ2Uc1aRFE9HpxZLéÿ\ 3
\ No newline at end of file
diff --git a/dbtest/siridb-http.conf b/dbtest/siridb-http.conf
new file mode 100644 (file)
index 0000000..a03dfbb
--- /dev/null
@@ -0,0 +1,78 @@
+# SiriDB HTTP Configuration file
+[Database]
+# User with at least 'show' privileges.
+user = iris
+
+# A password is required. To protect the password this file should be placed in
+# a folder where unauthorized users have no access.
+password = siri
+
+# Database to connect to.
+dbname = benchmark
+
+# Multiple servers are allowed and should be comma separated. When a port
+# is not provided the default 9000 is used. IPv6 address are supported and
+# should be wrapped in square brackets [] in case an alternative port is
+# required. SiriDB HTTP will randomly select an available siridb server
+# for each request.
+#
+# Valid examples:
+#   siridb01.local,siridb02.local,siridb03.local,siridb04.local
+#   10.20.30.40
+#   [::1]:5050,[::1]:5051
+#   2001:0db8:85a3:0000:0000:8a2e:0370:7334
+servers = localhost:9001
+
+[Configuration]
+# Listening to TCP port.
+port = 5050
+
+# When disabled no authentication is required. When enabled session
+# authentication or basic authentication is required.
+require_authentication = True
+
+# When enabled /socket.io/ will be enabled and Socket-IO can be used as an
+# alternative to the standard http rest api.
+enable_socket_io = True
+
+# When enabled the crt_file and key_file must be configured and the server
+# will be hosted on https.
+enable_ssl = False
+
+# When enabled a website is hosted on the configured port. When disabled the
+# resource URIs like /query, /insert, /auth/.. etc. are still available.
+enable_web = True
+
+# When enabled the /query and /insert resource URIs can be used with basic
+# authentication.
+enable_basic_auth = False
+
+# When multi user is disabled, only the user/password combination provided in
+# this configuration file can be used.
+enable_multi_user = False
+
+# Cookie max age is used to set the cookie expiration time in seconds.
+cookie_max_age = 604800
+
+# The query api allows you to specify a timeout for each query, but the insert
+# api only accepts data. Therefore the insert timeout is set as a general
+# value and is applicable to each insert.
+insert_timeout = 60
+
+[SSL]
+# Self-signed certificates can be created with the following command:
+#
+#   openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
+#        -keyout certificate.key -out certificate.crt
+#
+crt_file = certificate.crt
+key_file = certificate.key
+
+#
+# Welcome and thank you for using SiriDB!
+#
+# A configuration file is required and shoud be provided with the
+#   --config <file> argument.
+# Above you find an example template which can be used.
+#
+
diff --git a/dbtest/siridb0.conf b/dbtest/siridb0.conf
new file mode 100644 (file)
index 0000000..ead07f2
--- /dev/null
@@ -0,0 +1,86 @@
+# Welcome to the SiriDB configuration file
+
+[siridb]
+#
+# SiriDB will use this address:port for it's back-end connections.
+# This must be an address that other servers can use to connect to.
+# For example IPv4, IPv6 or a fqdn are all possible. When using IPv6 be sure
+# to wrap the ip address with square brackets. For example [::1]:9010
+# The default value is %HOSTNAME:9010. The variable %HOSTNAME will be translate
+# to the systems host name.
+# 
+#
+server_name = %HOSTNAME:9011
+
+#
+# Listen for SiriDB-server connections only on localhost.
+# Use value 0.0.0.0 (or :: for IPv6) to bind to all interfaces.
+#
+bind_server_address = 0.0.0.0
+
+#
+# SiriDB will listen for client connections on this port number.
+#
+listen_client_port = 9001
+
+#
+# Listen for client connections only on localhost.
+# Use value 0.0.0.0 (or :: for IPv6) to bind to all interfaces.
+#
+bind_client_address = 0.0.0.0
+
+#
+# When ip_support is set to ALL, SiriDB will listen and connect to both IPv4
+# and IPv6 addresses.
+# Valid options are ALL, IPV4ONLY and IPV6ONLY.
+#
+ip_support = ALL
+
+#
+# SiriDB will load databases from, and create databases in this location.
+#
+default_db_path = ./dbpath0
+
+#
+# SiriDB will run an optimize task each X seconds. A value of 0 (zero) disables
+# optimizing.
+#
+optimize_interval = 3600
+
+#
+# SiriDB uses a heart-beat interval to keep connections with other servers
+# online.
+#
+heartbeat_interval = 30
+
+#
+# SiriDB can run fsync on the buffer file on an interval in milliseconds. 
+# This value is set to 0 by default which tells SiriDB to run fsync after 
+# each insert request. When having many insert requests per second, it can be 
+# useful to use an interval like 500 milliseconds.
+#
+#buffer_sync_interval = 500
+buffer_sync_interval = 500
+
+#
+# SiriDB will not open more shard files than max_open_files. Note that the
+# total number of open files can be sligtly higher since SiriDB also needs
+# a few other files to write to.
+#
+max_open_files = 32768
+
+#
+# Use shard compression for storing data points.
+# Set value 0 to disable shard compression.
+#
+enable_shard_compression = 1
+
+#
+# Enable named pipe support for client connections.
+#
+enable_pipe_support = 0
+
+#
+# SiriDB will bind the client named pipe in this location.
+#
+pipe_client_name = siridb_client.sock
diff --git a/dbtest/siridb1.conf b/dbtest/siridb1.conf
new file mode 100644 (file)
index 0000000..83bd178
--- /dev/null
@@ -0,0 +1,85 @@
+# Welcome to the SiriDB configuration file
+
+[siridb]
+#
+# SiriDB will use this address:port for it's back-end connections.
+# This must be an address that other servers can use to connect to.
+# For example IPv4, IPv6 or a fqdn are all possible. When using IPv6 be sure
+# to wrap the ip address with square brackets. For example [::1]:9010
+# The default value is %HOSTNAME:9010. The variable %HOSTNAME will be translate
+# to the systems host name.
+#
+server_name = %HOSTNAME:9011
+
+#
+# Listen for SiriDB-server connections only on localhost.
+# Use value 0.0.0.0 (or :: for IPv6) to bind to all interfaces.
+#
+bind_server_address = 0.0.0.0
+
+#
+# SiriDB will listen for client connections on this port number.
+#
+listen_client_port = 9001
+
+#
+# Listen for client connections only on localhost.
+# Use value 0.0.0.0 (or :: for IPv6) to bind to all interfaces.
+#
+bind_client_address = 0.0.0.0
+
+#
+# When ip_support is set to ALL, SiriDB will listen and connect to both IPv4
+# and IPv6 addresses.
+# Valid options are ALL, IPV4ONLY and IPV6ONLY.
+#
+ip_support = ALL
+
+#
+# SiriDB will load databases from, and create databases in this location.
+#
+default_db_path = ./dbpath1
+
+#
+# SiriDB will run an optimize task each X seconds. A value of 0 (zero) disables
+# optimizing.
+#
+optimize_interval = 3600
+
+#
+# SiriDB uses a heart-beat interval to keep connections with other servers
+# online.
+#
+heartbeat_interval = 30
+
+#
+# SiriDB can run fsync on the buffer file on an interval in milliseconds. 
+# This value is set to 0 by default which tells SiriDB to run fsync after 
+# each insert request. When having many insert requests per second, it can be 
+# useful to use an interval like 500 milliseconds.
+#
+#buffer_sync_interval = 500
+buffer_sync_interval = 500
+
+#
+# SiriDB will not open more shard files than max_open_files. Note that the
+# total number of open files can be sligtly higher since SiriDB also needs
+# a few other files to write to.
+#
+max_open_files = 32768
+
+#
+# Use shard compression for storing data points.
+# Set value 0 to disable shard compression.
+#
+enable_shard_compression = 1
+
+#
+# Enable named pipe support for client connections.
+#
+enable_pipe_support = 0
+
+#
+# SiriDB will bind the client named pipe in this location.
+#
+pipe_client_name = siridb_client.sock
index 344c1d9b297ac17c6484c2719fc5f19980229ebd..81a941be77b559c89dcd3db5267395dc2835d850 100644 (file)
@@ -8,6 +8,7 @@ from test_list import TestList
 from test_insert import TestInsert
 from test_pool import TestPool
 from test_select import TestSelect
+from test_select_ns import TestSelectNano
 from test_series import TestSeries
 from test_server import TestServer
 from test_user import TestUser
@@ -26,6 +27,7 @@ if __name__ == '__main__':
     run_test(TestInsert())
     run_test(TestPool())
     run_test(TestSelect())
+    run_test(TestSelectNano())
     run_test(TestSeries())
     run_test(TestServer())
     run_test(TestUser())
index d2070b88d04a10a380dfdaa1a07c1a0b88995782..5c4afa133900d6511d930ee86e537c7a7b4f2bfe 100644 (file)
@@ -21,16 +21,24 @@ from testing import TestBase
 from testing import UserAuthError
 from testing import parse_args
 
-
+LENPOINTS = 70
 DATA = {
-    'series float': [
+    'series-001 float': [
         [1471254705, 1.5],
         [1471254707, -3.5],
         [1471254710, -7.3]],
-    'series integer': [
+    'series-001 integer': [
         [1471254705, 5],
         [1471254708, -3],
         [1471254710, -7]],
+    'series-002 float': [
+        [1471254705, 3.5],
+        [1471254707, -2.5],
+        [1471254710, -8.3]],
+    'series-002 integer': [
+        [1471254705, 4],
+        [1471254708, -1],
+        [1471254710, -8]],
     'aggr': [
         [1447249033, 531], [1447249337, 534],
         [1447249633, 535], [1447249937, 531],
@@ -94,50 +102,63 @@ class TestSelect(TestBase):
 
         self.assertEqual(
             await self.client0.insert(DATA),
-            {'success_msg': 'Successfully inserted 64 point(s).'})
+            {'success_msg': 'Successfully inserted {} point(s).'.format(
+                LENPOINTS)})
 
         self.assertEqual(
             await self.client0.query(
-                'select difference() from "series integer"'),
-            {'series integer': [[1471254708, -8], [1471254710, -4]]})
+                'select difference() from "series-001 integer"'),
+            {'series-001 integer': [[1471254708, -8], [1471254710, -4]]})
 
         self.assertEqual(
             await self.client0.query(
-                'select difference() => difference() from "series integer"'),
-            {'series integer': [[1471254710, 4]]})
+                'select difference() => difference() '
+                'from "series-001 integer"'),
+            {'series-001 integer': [[1471254710, 4]]})
 
         self.assertEqual(
             await self.client0.query(
                 'select difference() => difference() => difference() '
-                'from "series integer"'),
-            {'series integer': []})
+                'from "series-001 integer"'),
+            {'series-001 integer': []})
 
         now = int(time.time())
         self.assertEqual(
             await self.client0.query(
-                'select difference({}) from "series integer"'.format(now)),
-            {'series integer': [[now, -12]]})
+                'select difference({}) from "series-001 integer"'.format(now)),
+            {'series-001 integer': [[now, -12]]})
 
         now = int(time.time())
         self.assertEqual(
             await self.client0.query(
-                'select difference({}) from "series integer"'.format(now)),
-            {'series integer': [[now, -12]]})
+                'select difference({}) from "series-001 integer"'.format(now)),
+            {'series-001 integer': [[now, -12]]})
 
         self.assertEqual(
             await self.client0.query(
-                'select * from /series.*/ '
+                'select * from /series-001.*/ '
                 'merge as "median_low" using median_low({})'
                 .format(now)),
             {'median_low': [[now, -3.5]]})
 
         self.assertEqual(
             await self.client0.query(
-                'select * from /series.*/ '
+                'select * from /series-001.*/ '
                 'merge as "median_high" using median_high({})'
                 .format(now)),
             {'median_high': [[now, -3.0]]})
 
+        self.assertEqual(
+            await self.client0.query(
+                'select * from /series.*/ '
+                'merge as "max" using max(1s)'),
+            {'max': [
+                [1471254705, 5.0],
+                [1471254707, -2.5],
+                [1471254708, -1.0],
+                [1471254710, -7.0]
+            ]})
+
         # Test all aggregation methods
 
         self.assertEqual(
@@ -248,8 +269,8 @@ class TestSelect(TestBase):
 
         self.assertEqual(
             await self.client0.query(
-                'select limit(2, max)  from "series float"'),
-            {'series float': [[1471254707, 1.5], [1471254713, -7.3]]})
+                'select limit(2, max)  from "series-001 float"'),
+            {'series-001 float': [[1471254707, 1.5], [1471254713, -7.3]]})
 
         self.assertAlmostEqual(
             await self.client0.query(
@@ -425,7 +446,7 @@ class TestSelect(TestBase):
             await self.client0.query(
                 'select min(2h) prefix "min-", max(1h) prefix "max-" '
                 'from /.*/ where type == integer and name != "filter" '
-                'and name != "one"'
+                'and name != "one" and name != "series-002 integer" '
                 'merge as "int_min_max" using median_low(1) => difference()'),
             {
                 'max-int_min_max': [
diff --git a/itest/test_select_ns.py b/itest/test_select_ns.py
new file mode 100644 (file)
index 0000000..9878212
--- /dev/null
@@ -0,0 +1,615 @@
+import asyncio
+import functools
+import random
+import time
+import math
+import re
+from testing import Client
+from testing import default_test_setup
+from testing import gen_data
+from testing import gen_points
+from testing import gen_series
+from testing import InsertError
+from testing import PoolError
+from testing import QueryError
+from testing import run_test
+from testing import Series
+from testing import Server
+from testing import ServerError
+from testing import SiriDB
+from testing import TestBase
+from testing import UserAuthError
+from testing import parse_args
+
+LENPOINTS = 70
+DATA = {
+    'series-001 float': [
+        [1471254705000000005, 1.5],
+        [1471254705000000007, -3.5],
+        [1471254705000000010, -7.3]],
+    'series-001 integer': [
+        [1471254705000000005, 5],
+        [1471254705000000008, -3],
+        [1471254705000000010, -7]],
+    'series-002 float': [
+        [1471254705000000005, 3.5],
+        [1471254705000000007, -2.5],
+        [1471254705000000010, -8.3]],
+    'series-002 integer': [
+        [1471254705000000005, 4],
+        [1471254705000000008, -1],
+        [1471254705000000010, -8]],
+    'aggr': [
+        [1447249049033000000, 531], [1447249049337000000, 534],
+        [1447249049633000000, 535], [1447249049937000000, 531],
+        [1447249050249000000, 532], [1447249050549000000, 537],
+        [1447249050868000000, 530], [1447249051168000000, 520],
+        [1447249051449000000, 54], [1447249051749000000, 54],
+        [1447249052049000000, 513], [1447249052349000000, 537],
+        [1447249052649000000, 528], [1447249052968000000, 531],
+        [1447249053244000000, 533], [1447249053549000000, 538],
+        [1447249053849000000, 534], [1447249054149000000, 532],
+        [1447249054449000000, 533], [1447249054748000000, 537]],
+
+    'huge': [
+        [1471254705000000005, 9223372036854775807],
+        [1471254705000000006, 9223372036854775806],
+        [1471254705000000007, 9223372036854775805],
+        [1471254705000000008, 9223372036854775804]],
+    'equal ts': [
+        [1471254705000000005, 0], [1471254705000000005, 1],
+        [1471254705000000005, 1], [1471254705000000007, 0],
+        [1471254705000000007, 1], [1471254705000000007, 0],
+    ],
+    'variance': [
+        [1471254705000000005, 2.75], [1471254705000000006, 1.75],
+        [1471254705000000007, 1.25], [1471254705000000008, 0.25],
+        [1471254705000000009, 0.5], [1471254705000000010, 1.25],
+        [1471254705000000011, 3.5]
+    ],
+    'pvariance': [
+        [1471254705000000005, 0.0], [1471254705000000006, 0.25],
+        [1471254705000000007, 0.25], [1471254705000000008, 1.25],
+        [1471254705000000009, 1.5], [1471254705000000010, 1.75],
+        [1471254705000000011, 2.75], [1471254705000000012, 3.25]
+    ],
+    'filter': [
+        [1471254705000000005, 5],
+        [1471254705000000010, -3],
+        [1471254705000000015, -7],
+        [1471254705000000020, 7]
+    ],
+    'one': [
+        [1471254705000000010, 1]
+    ],
+    'log': [
+        [1471254705000000010, 'log line one'],
+        [1471254705000000012, 'log line two'],
+        [1471254705000000014, 'another line (three)'],
+        [1471254705000000016, 'and yet one more'],
+    ],
+    'special': [
+        [1471254705000000005, 0.1],
+        [1471254705000000006, math.nan],
+        [1471254705000000007, math.inf],
+        [1471254705000000008, -math.inf],
+    ]
+}
+
+
+TIME_PRECISION = 'ns'
+
+
+class TestSelectNano(TestBase):
+    title = 'Test select and aggregate functions'
+
+    GEN_POINTS = functools.partial(
+        gen_points, n=1, time_precision=TIME_PRECISION)
+
+    @default_test_setup(1, time_precision=TIME_PRECISION)
+    async def run(self):
+        await self.client0.connect()
+
+        self.assertEqual(
+            await self.client0.insert(DATA),
+            {'success_msg': 'Successfully inserted {} point(s).'.format(
+                LENPOINTS)})
+
+        self.assertEqual(
+            await self.client0.query(
+                'select difference() from "series-001 integer"'),
+            {'series-001 integer': [
+                [1471254705000000008, -8],
+                [1471254705000000010, -4]
+            ]})
+
+        self.assertEqual(
+            await self.client0.query(
+                'select difference() => difference() '
+                'from "series-001 integer"'),
+            {'series-001 integer': [[1471254705000000010, 4]]})
+
+        self.assertEqual(
+            await self.client0.query(
+                'select difference() => difference() => difference() '
+                'from "series-001 integer"'),
+            {'series-001 integer': []})
+
+        now = int(time.time()*1000000000)
+        self.assertEqual(
+            await self.client0.query(
+                'select difference({}) from "series-001 integer"'.format(now)),
+            {'series-001 integer': [[now, -12]]})
+
+        now = int(time.time()*1000000000)
+        self.assertEqual(
+            await self.client0.query(
+                'select difference({}) from "series-001 integer"'.format(now)),
+            {'series-001 integer': [[now, -12]]})
+
+        self.assertEqual(
+            await self.client0.query(
+                'select * from /series-001.*/ '
+                'merge as "median_low" using median_low({})'
+                .format(now)),
+            {'median_low': [[now, -3.5]]})
+
+        self.assertEqual(
+            await self.client0.query(
+                'select * from /series-001.*/ '
+                'merge as "median_high" using median_high({})'
+                .format(now)),
+            {'median_high': [[now, -3.0]]})
+
+        self.assertEqual(
+            await self.client0.query(
+                'select max(1) from /series.*/ '
+                'merge as "max" using max(1)'),
+            {'max': [
+                [1471254705000000005, 5.0],
+                [1471254705000000007, -2.5],
+                [1471254705000000008, -1.0],
+                [1471254705000000010, -7.0]
+            ]})
+
+        # Test all aggregation methods
+
+        self.assertEqual(
+            await self.client0.query('select sum(1s) from "aggr"'),
+            {'aggr': [
+                [1447249050000000000, 2131],
+                [1447249051000000000, 1599],
+                [1447249052000000000, 628],
+                [1447249053000000000, 2109],
+                [1447249054000000000, 1605],
+                [1447249055000000000, 1602]
+            ]})
+
+        self.assertEqual(
+            await self.client0.query('select count(1s) from "aggr"'),
+            {'aggr': [
+                [1447249050000000000, 4],
+                [1447249051000000000, 3],
+                [1447249052000000000, 3],
+                [1447249053000000000, 4],
+                [1447249054000000000, 3],
+                [1447249055000000000, 3]
+            ]})
+
+        self.assertEqual(
+            await self.client0.query('select mean(1s) from "aggr"'),
+            {'aggr': [
+                [1447249050000000000, 532.75],
+                [1447249051000000000, 533.0],
+                [1447249052000000000, 209.3333333333333333334],
+                [1447249053000000000, 527.25],
+                [1447249054000000000, 535.0],
+                [1447249055000000000, 534.0]
+            ]})
+
+        self.assertEqual(
+            await self.client0.query('select median(1s) from "aggr"'),
+            {'aggr': [
+                [1447249050000000000, 532.5],
+                [1447249051000000000, 532.0],
+                [1447249052000000000, 54.0],
+                [1447249053000000000, 529.5],
+                [1447249054000000000, 534.0],
+                [1447249055000000000, 533.0]
+            ]})
+
+        self.assertEqual(
+            await self.client0.query('select median_low(1s) from "aggr"'),
+            {'aggr': [
+                [1447249050000000000, 531.0],
+                [1447249051000000000, 532.0],
+                [1447249052000000000, 54.0],
+                [1447249053000000000, 528.0],
+                [1447249054000000000, 534.0],
+                [1447249055000000000, 533.0]
+            ]})
+
+        self.assertEqual(
+            await self.client0.query('select median_high(1s) from "aggr"'),
+            {'aggr': [
+                [1447249050000000000, 534.0],
+                [1447249051000000000, 532.0],
+                [1447249052000000000, 54.0],
+                [1447249053000000000, 531.0],
+                [1447249054000000000, 534.0],
+                [1447249055000000000, 533.0]
+            ]})
+
+        self.assertEqual(
+            await self.client0.query('select min(1s) from "aggr"'),
+            {'aggr': [
+                [1447249050000000000, 531.0],
+                [1447249051000000000, 530.0],
+                [1447249052000000000, 54.0],
+                [1447249053000000000, 513.0],
+                [1447249054000000000, 533.0],
+                [1447249055000000000, 532.0]
+            ]})
+
+        self.assertEqual(
+            await self.client0.query('select max(1s) from "aggr"'),
+            {'aggr': [
+                [1447249050000000000, 535.0],
+                [1447249051000000000, 537.0],
+                [1447249052000000000, 520.0],
+                [1447249053000000000, 537.0],
+                [1447249054000000000, 538.0],
+                [1447249055000000000, 537.0]
+            ]})
+
+        self.assertAlmostEqual(
+            await self.client0.query('select variance(1s) from "aggr"'),
+            {'aggr': [
+                [1447249050000000000, 4.25],
+                [1447249051000000000, 13.0],
+                [1447249052000000000, 72385.3333333333333333333],
+                [1447249053000000000, 104.25],
+                [1447249054000000000, 7.0],
+                [1447249055000000000, 7.0]
+            ]})
+
+        self.assertAlmostEqual(
+            await self.client0.query('select pvariance(1s) from "aggr"'),
+            {'aggr': [
+                [1447249050000000000, 3.1875],
+                [1447249051000000000, 8.666666666666666667],
+                [1447249052000000000, 48256.8888888888888888887],
+                [1447249053000000000, 78.1875],
+                [1447249054000000000, 4.666666666666666667],
+                [1447249055000000000, 4.666666666666666667]
+            ]})
+
+        self.assertEqual(
+            await self.client0.query('select difference(1s) from "aggr"'),
+            {'aggr': [
+                [1447249050000000000, 0],
+                [1447249051000000000, -2],
+                [1447249052000000000, -466],
+                [1447249053000000000, 18],
+                [1447249054000000000, 1],
+                [1447249055000000000, 5]
+            ]})
+
+        self.assertAlmostEqual(
+            await self.client0.query('select derivative(1, 1s) from "aggr"'),
+            {'aggr': [
+                [1447249050000000000, 0.0],
+                [1447249051000000000, -0.000000002],
+                [1447249052000000000, -0.000000466],
+                [1447249053000000000, 0.000000018],
+                [1447249054000000000, 0.000000001],
+                [1447249055000000000, 0.000000005]
+            ]})
+
+        self.assertEqual(
+            await self.client0.query('select filter(>534) from "aggr"'),
+            {'aggr': [
+                [1447249049633000000, 535],
+                [1447249050549000000, 537],
+                [1447249052349000000, 537],
+                [1447249053549000000, 538],
+                [1447249054748000000, 537]
+            ]})
+
+        self.assertEqual(
+            await self.client0.query(
+                'select filter(/l.*/) from * where type == string'),
+            {'log': [p for p in DATA['log'] if re.match('l.*', p[1])]})
+
+        self.assertEqual(
+            await self.client0.query(
+                'select filter(==/l.*/) from * where type == string'),
+            {'log': [p for p in DATA['log'] if re.match('l.*', p[1])]})
+
+        self.assertEqual(
+            await self.client0.query(
+                'select filter(!=/l.*/) from * where type == string'),
+            {'log': [p for p in DATA['log'] if not re.match('l.*', p[1])]})
+
+        self.assertEqual(
+            await self.client0.query('select limit(300, mean) from "aggr"'),
+            {'aggr': DATA['aggr']})
+
+        self.assertEqual(
+            await self.client0.query('select limit(1, sum)  from "aggr"'),
+            {'aggr': [[1447249054748000000, 9674]]})
+
+        # The interval over which the mean is calculated is obtained
+        # by dividing the time period of the serie by the max_points
+        # and adding 1 ns to include the last point of the series.
+        self.assertEqual(
+            await self.client0.query('select limit(3, mean) from "aggr"'),
+            {'aggr': [
+                [1447249050938000000, 532.8571428571429],
+                [1447249052843000001, 367.6666666666667],
+                [1447249054748000002, 534.0]]})
+
+        self.assertEqual(
+            await self.client0.query(
+                'select limit(2, max)  from "series-001 float"'),
+            {'series-001 float': [
+                [1471254705000000007, 1.5],
+                [1471254705000000013, -7.3]
+            ]})
+
+        self.assertAlmostEqual(
+            await self.client0.query(
+                'select variance(1471254705000000012) from "variance"'),
+            {'variance': [[1471254705000000012, 1.3720238095238095]]})
+
+        self.assertAlmostEqual(
+            await self.client0.query(
+                'select pvariance(1471254705000000015) from "pvariance"'),
+            {'pvariance': [[1471254705000000015, 1.25]]})
+
+        self.assertEqual(
+            await self.client0.query('select * from "one"'),
+            {'one': [[1471254705000000010, 1]]})
+
+        self.assertEqual(
+            await self.client0.query('select * from "log"'),
+            {'log': DATA['log']})
+
+        self.assertEqual(
+            await self.client0.query(
+                'select filter(~"log") => filter(!~"one") from "log"'),
+            {'log': [DATA['log'][1]]})
+
+        self.assertEqual(
+            await self.client0.query(
+                'select filter(!=nan) from "special"'),
+            {'special': [p for p in DATA['special'] if not math.isnan(p[1])]})
+
+        self.assertAlmostEqual(
+            await self.client0.query(
+                'select filter(==nan) from "special"'),
+            {'special': [p for p in DATA['special'] if math.isnan(p[1])]})
+
+        self.assertAlmostEqual(
+            await self.client0.query(
+                'select filter(>=nan) from "special"'),
+            {'special': [p for p in DATA['special'] if math.isnan(p[1])]})
+
+        self.assertAlmostEqual(
+            await self.client0.query(
+                'select filter(<=nan) from "special"'),
+            {'special': [p for p in DATA['special'] if math.isnan(p[1])]})
+
+        self.assertEqual(
+            await self.client0.query(
+                'select filter(==inf) from "special"'),
+            {'special': [p for p in DATA['special'] if p[1] == math.inf]})
+
+        self.assertAlmostEqual(
+            await self.client0.query(
+                'select filter(<inf) from "special"'),
+            {'special': [p for p in DATA['special'] if p[1] < math.inf]})
+
+        self.assertAlmostEqual(
+            await self.client0.query(
+                'select filter(>inf) from "special"'),
+            {'special': []})
+
+        self.assertEqual(
+            await self.client0.query(
+                'select filter(==-inf) from "special"'),
+            {'special': [p for p in DATA['special'] if p[1] == -math.inf]})
+
+        self.assertAlmostEqual(
+            await self.client0.query(
+                'select filter(>-inf) from "special"'),
+            {'special': [p for p in DATA['special'] if p[1] > -math.inf]})
+
+        self.assertAlmostEqual(
+            await self.client0.query(
+                'select filter(<-inf) from "special"'),
+            {'special': []})
+
+        self.assertEqual(
+            await self.client0.query(
+                'select filter(~"one") prefix "1-", '
+                'filter(~"two") prefix "2-" from "log"'),
+            {
+                '1-log': [
+                    [1471254705000000010, 'log line one'],
+                    [1471254705000000016, 'and yet one more']],
+                '2-log': [[1471254705000000012, 'log line two']]
+            })
+
+        self.assertEqual(
+            await self.client0.query('select difference() from "one"'),
+            {'one': []})
+
+        with self.assertRaisesRegex(
+                QueryError,
+                'Regular expressions can only be used with.*'):
+            await self.client0.query('select filter(~//) from "log"')
+
+        with self.assertRaisesRegex(
+                QueryError,
+                'Cannot use a string filter on number type.'):
+            await self.client0.query('select filter(//) from "aggr"')
+
+        with self.assertRaisesRegex(
+                QueryError,
+                'Cannot use mean\(\) on string type\.'):
+            await self.client0.query('select mean(1w) from "log"')
+
+        with self.assertRaisesRegex(
+                QueryError,
+                'Group by time must be an integer value larger than zero\.'):
+            await self.client0.query('select mean(0) from "aggr"')
+
+        with self.assertRaisesRegex(
+                QueryError,
+                'Limit must be an integer value larger than zero\.'):
+            await self.client0.query('select limit(6 - 6, mean) from "aggr"')
+
+        with self.assertRaisesRegex(
+                QueryError,
+                'Cannot use a string filter on number type\.'):
+            await self.client0.query(
+                'select * from "aggr" '
+                'merge as "t" using filter("0")')
+
+        with self.assertRaisesRegex(
+                QueryError,
+                'Cannot use difference\(\) on string type\.'):
+            await self.client0.query('select difference() from "log"')
+
+        with self.assertRaisesRegex(
+                QueryError,
+                'Cannot use derivative\(\) on string type\.'):
+            await self.client0.query('select derivative(6, 3) from "log"')
+
+        with self.assertRaisesRegex(
+                QueryError,
+                'Cannot use derivative\(\) on string type\.'):
+            await self.client0.query('select derivative() from "log"')
+
+        with self.assertRaisesRegex(
+                QueryError,
+                'Overflow detected while using sum\(\)\.'):
+            await self.client0.query('select sum(now) from "huge"')
+
+        with self.assertRaisesRegex(
+                QueryError,
+                'Max depth reached in \'where\' expression!'):
+            await self.client0.query(
+                'select * from "aggr" where ((((((length > 1))))))')
+
+        with self.assertRaisesRegex(
+                QueryError,
+                'Cannot compile regular expression.*'):
+            await self.client0.query(
+                'select * from /(bla/')
+
+        with self.assertRaisesRegex(
+                QueryError,
+                'Memory allocation error or maximum recursion depth reached.'):
+            await self.client0.query(
+                'select * from "aggr" where length > {}'.format('(' * 500))
+
+        with self.assertRaisesRegex(
+                    QueryError,
+                    'Query too long.'):
+            await self.client0.query('select * from "{}"'.format('a' * 65535))
+
+        with self.assertRaisesRegex(
+                    QueryError,
+                    'Error while merging points. Make sure the destination '
+                    'series name is valid.'):
+            await self.client0.query(
+                'select * from "aggr", "huge" merge as ""')
+
+        self.assertEqual(
+            await self.client0.query(
+                'select min(2s) prefix "min-", max(1s) prefix "max-" '
+                'from /.*/ where type == integer and name != "filter" '
+                'and name != "one" and name != "series-002 integer" '
+                'merge as "int_min_max" using median_low(1) => difference()'),
+            {
+                'max-int_min_max': [
+                    [1447249051000000000, 2],
+                    [1447249052000000000, -17],
+                    [1447249053000000000, 17],
+                    [1447249054000000000, 1],
+                    [1447249055000000000, -1],
+                    [1471254706000000000, -532]
+                ],
+                'min-int_min_max': [
+                    [1447249052000000000, -477],
+                    [1447249054000000000, 459],
+                    [1447249056000000000, 19],
+                    [1471254706000000000, -532]
+                ]})
+
+        await self.client0.query('select derivative() from "equal ts"')
+
+        self.assertEqual(
+            await self.client0.query('select first() from *'),
+            {k: [v[0]] for k, v in DATA.items()})
+
+        self.assertEqual(
+            await self.client0.query('select last() from *'),
+            {k: [v[-1]] for k, v in DATA.items()})
+
+        self.assertEqual(
+            await self.client0.query('select count() from *'),
+            {k: [[v[-1][0], len(v)]] for k, v in DATA.items()})
+
+        self.assertEqual(
+            await self.client0.query('select mean() from "aggr"'),
+            {'aggr': [[
+                DATA['aggr'][-1][0],
+                sum([x[1] for x in DATA['aggr']]) / len(DATA['aggr'])]]})
+
+        self.assertAlmostEqual(
+            await self.client0.query('select stddev() from "aggr"'),
+            {'aggr': [[
+                DATA['aggr'][-1][0],
+                147.07108914792838]]})
+
+        self.assertAlmostEqual(
+            await self.client0.query('select stddev(1s) from "aggr"'),
+            {"aggr": [
+                [1447249050000000000, 2.0615528128088333333],
+                [1447249051000000000, 3.6055512754639999999],
+                [1447249052000000000, 269.0452254423666666667],
+                [1447249053000000000, 10.2102889283311111111],
+                [1447249054000000000, 2.6457513110645999999],
+                [1447249055000000000, 2.6457513110645999999]
+            ]})
+
+        # test prefix, suffex
+        result = await self.client0.query(
+                'select sum(1d) prefix "sum-" suffix "-sum", '
+                'min(1d) prefix "minimum-", '
+                'max(1d) suffix "-maximum" from "aggr"')
+
+        self.assertIn('sum-aggr-sum', result)
+        self.assertIn('minimum-aggr', result)
+        self.assertIn('aggr-maximum', result)
+
+        await self.client0.query('alter database set select_points_limit 10')
+        with self.assertRaisesRegex(
+                QueryError,
+                'Query has reached the maximum number of selected points.*'):
+            await self.client0.query(
+                'select * from /.*/')
+        await self.client0.query(
+            'alter database set select_points_limit 1000000')
+
+        self.client0.close()
+
+        # return False
+
+
+if __name__ == '__main__':
+    parse_args()
+    run_test(TestSelectNano())
index 682e6d323171bd40111a4d6ff3e7dc099ec90405..b81a27fe046107e7cd49aba4107372ba2bf67b12 100644 (file)
@@ -1482,7 +1482,6 @@ static void POINTS_merge_and_sort(vec_t * plist, siridb_points_t * points)
             }
         }
     }
-
     /* size should be exactly zero */
     assert (n == 0);
 
@@ -1503,7 +1502,11 @@ static void POINTS_merge_and_sort(vec_t * plist, siridb_points_t * points)
 
 static inline int POINTS_compare(const void * a, const void * b)
 {
-    return (((siridb_point_t *) a)->ts - ((siridb_point_t *) b)->ts);
+    return (((siridb_point_t *) a)->ts < ((siridb_point_t *) b)->ts)
+        ? -1
+        : (((siridb_point_t *) a)->ts > ((siridb_point_t *) b)->ts)
+        ? 1
+        : 0;
 }
 
 /*