+siridb-server (2.0.52-0~cb1) unstable; urgency=medium
+
+ * New upstream release
+ - Fixed potential bug with empty log log lines in series.
+
+ -- Jeroen van der Heijden <jeroen@cesbit.com> Mon, 23 Sep 2024 16:57:00 +0200
+
siridb-server (2.0.50-0~cb1) unstable; urgency=medium
* New upstream release
RE_KEYWORDS = re.compile('[a-z_]+')
# Regular expressions
- r_float = Regex('[-+]?[0-9]*\.?[0-9]+')
+ r_float = Regex(r'[-+]?[0-9]*\.?[0-9]+')
r_integer = Regex('[-+]?[0-9]+')
r_uinteger = Regex('[0-9]+')
r_time_str = Regex('[0-9]+[smhdw]')
r_doubleq_str = Regex('(?:"(?:[^"]*)")+')
r_grave_str = Regex('(?:`(?:[^`]*)`)+')
r_uuid_str = Regex(
- '[0-9a-f]{8}\-[0-9a-f]{4}\-[0-9a-f]{4}\-[0-9a-f]{4}\-[0-9a-f]{12}')
+ r'[0-9a-f]{8}\-[0-9a-f]{4}\-[0-9a-f]{4}\-[0-9a-f]{4}\-[0-9a-f]{12}')
# we only allow an optional 'i' for case-insensitive regex
r_regex = Regex('(/[^/\\\\]*(?:\\\\.[^/\\\\]*)*/i?)')
r_comment = Regex('#.*')
#define SIRIDB_VERSION_MAJOR 2
#define SIRIDB_VERSION_MINOR 0
-#define SIRIDB_VERSION_PATCH 51
+#define SIRIDB_VERSION_PATCH 52
/*
* Use SIRIDB_VERSION_PRE_RELEASE for alpha release versions.
-FROM ubuntu:18.04 as builder
+FROM ubuntu:18.04 AS builder
RUN apt-get update && \
apt-get install -y \
libcleri-dev \
'r_comment': {
'r_comment': '#',
},
-}
\ No newline at end of file
+}
q[i] = val
yield q
break
-
+
# debug code
-
# else:
# print('no value found for:')
# print(ename)
# print('unknown regex element')
# print(ename)
-
def _on_Token(self, q, i):
q[i] = q[i]._token
yield q
from test_compression import TestCompression
from test_create_database import TestCreateDatabase
from test_expiration import TestExpiration
-from test_grammar import TestGrammar
+# from test_grammar import TestGrammar
from test_group import TestGroup
from test_http_api import TestHTTPAPI
from test_insert import TestInsert
run_test(TestCompression())
run_test(TestCreateDatabase())
run_test(TestExpiration())
- run_test(TestGrammar())
+ # run_test(TestGrammar())
run_test(TestGroup())
run_test(TestHTTPAPI())
run_test(TestInsert())
async def select(self, client, series, n):
series = {s.name: s for s in series}
- chars=string.ascii_letters + string.digits
+ chars = string.ascii_letters + string.digits
for _ in range(n):
regex = ''.join(random.choice(chars) for _ in range(3))
- res = await client.query(f'select max() prefix "max-", min() prefix "min-", mean() prefix "mean-" from /.*{regex}.*/i')
- if res:
- print(res)
- # for s, p in res.items():
- # self.assertEqual(sorted(series[s].points), p)
+ res = await client.query(
+ f'select max() prefix "max-", min() prefix "min-", '
+ f'mean() prefix "mean-" from /.*{regex}.*/i')
+ for s, p in res.items():
+ self.assertEqual(sorted(series[s].points), p)
await asyncio.sleep(0.2)
async def insert(self, client, series, n):
DATA = {
+ 'empty': [
+ [1471254710, ''],
+ [1471254712, ''],
+ [1471254714, ''],
+ [1471254715, ''],
+ [1471254716, ''],
+ [1471254718, ''],
+ [1471254720, '']
+ ],
'log': [
[1471254710, 'log line one'],
[1471254712, 'log line two'],
await self.test_data()
async def test_data(self):
+ self.assertEqual(
+ await self.client0.query('select * from "empty"'),
+ {'empty': DATA['empty']})
+
self.assertEqual(
await self.client0.query('select * from "log"'),
{'log': DATA['log']})
with self.assertRaisesRegex(
QueryError,
- 'Query error at position 29. Expecting \*, all, '
- 'single_quote_str, double_quote_str or \('):
+ r'Query error at position 29. Expecting \*, all, '
+ r'single_quote_str, double_quote_str or \('):
await self.client0.query(
'list series /.*/ - {}{}'.format('(' * 10, ')' * 10))
{
/* literal */
size_t len = (is_ascii) ? 0 : POINTS_dec_len(&pt);
-
do
{
*buf = *pt;
memcpy(&point->ts, pt, sizeof(uint64_t));
pt += sizeof(uint64_t);
- buf = malloc(src_sz);
- if (buf == NULL)
- {
- return -1;
- }
-
for (mask = 0; tshift-- > tcount; ++pt)
{
mask |= ((uint64_t) *pt) << (tshift * 8);
n -= i;
+ buf = malloc(src_sz + n);
+ if (buf == NULL)
+ {
+ return -1;
+ }
+
if (POINTS_unpack_string(
points->data + points->len, n, i, bits + offset, buf))
{