From 76289024543fbfb6df3d07f61f15eabc623dd246 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Sat, 23 Jul 2016 18:42:06 +0200 Subject: restructure code rename module to pyinflux split in client and parser package. the parser depends also on funcparserlib contains 3 examples of strange influxdb behavior --- anotherBug.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 anotherBug.py (limited to 'anotherBug.py') diff --git a/anotherBug.py b/anotherBug.py new file mode 100755 index 0000000..ce52cf4 --- /dev/null +++ b/anotherBug.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 +""" +another bug? +in 2016/07/23 18:37:37 InfluxDB starting, version 0.13.0, branch 0.13, commit e57fb88a051ee40fd9277094345fbd47bb4783ce +the escaping of the 'key' or 'name' is strange +""" +from pyinflux.client import Influx, Line + +influxdb = Influx('localhost') + +print(influxdb.execute('DROP DATABASE test').as_text()) +print(influxdb.execute('CREATE DATABASE test').as_text()) + + +def write(line): + print(repr(line)) + print(str(line)) + return influxdb.write_db('test', [line]) + + +print(write(Line('asd\\', {'tag1': ''}, {'field1': ''}))) +print(write(Line('asd\\\\', {'tag1': ''}, {'field1': ''}))) + + +def query(q): + print(q) + try: + return influxdb.query_db('test', q).as_json() + except Exception as e: + return str(e) + +# at least some of these query must return something... +print(query('SELECT * FROM asd')) +print(query('SELECT * FROM asd\\')) +print(query('SELECT * FROM asd\\\\')) +print(query('SELECT * FROM "asd"')) +print(query('SELECT * FROM "asd\\\\"')) -- cgit v1.2.1