summaryrefslogtreecommitdiff
path: root/anotherBug.py
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2016-07-23 18:42:06 +0200
committerYves Fischer <yvesf-git@xapek.org>2016-07-23 18:42:40 +0200
commit76289024543fbfb6df3d07f61f15eabc623dd246 (patch)
tree5f7e7a86e42f26e8afe3b4437f77e9e4100280ee /anotherBug.py
parentf019accc6f20ef97e95b9b6a3f776aefb5ebd62b (diff)
downloadpyinflux-76289024543fbfb6df3d07f61f15eabc623dd246.tar.gz
pyinflux-76289024543fbfb6df3d07f61f15eabc623dd246.zip
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
Diffstat (limited to 'anotherBug.py')
-rwxr-xr-xanotherBug.py37
1 files changed, 37 insertions, 0 deletions
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\\\\"'))