summary refs log tree commit diff stats
path: root/tests/untestable/tpostgres.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-11-02 10:46:30 +0100
committerAndreas Rumpf <rumpf_a@web.de>2017-11-02 10:46:30 +0100
commit1eaeccc15d15d15d2f62ea1648f7dd64722dbd37 (patch)
treeb922cdabc780fa3a8837a6804d2df31793d9e2ca /tests/untestable/tpostgres.nim
parente9243a16167b24899d4fcf051f3252b3a5804811 (diff)
parentbd19b5f4d36bb40b4af93d7e15fdfa582e9fe3b7 (diff)
downloadNim-1eaeccc15d15d15d2f62ea1648f7dd64722dbd37.tar.gz
Merge branch 'devel' into araq
Diffstat (limited to 'tests/untestable/tpostgres.nim')
-rw-r--r--tests/untestable/tpostgres.nim19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/untestable/tpostgres.nim b/tests/untestable/tpostgres.nim
index 486d0d703..d3397e53a 100644
--- a/tests/untestable/tpostgres.nim
+++ b/tests/untestable/tpostgres.nim
@@ -304,7 +304,24 @@ doAssert parseInt(dbCols[40].typ.name) > 0
 doAssert dbCols[41].name == "range_col"
 doAssert dbCols[41].typ.kind == DbTypeKind.dbComposite
 doAssert dbCols[41].typ.name == "int4range"
-    
+
+# issue 6571
+db.exec(sql"DROP TABLE IF EXISTS DICTIONARY")
+db.exec(sql("""CREATE TABLE DICTIONARY(
+               id             SERIAL PRIMARY KEY,
+               entry      VARCHAR(1000) NOT NULL,
+               definition VARCHAR(4000) NOT NULL
+            );"""))
+var entry = "あっそ"
+var definition = "(int) (See ああそうそう) oh, really (uninterested)/oh yeah?/hmmmmm"
+discard db.getRow(
+  SqlQuery("INSERT INTO DICTIONARY(entry, definition) VALUES(\'$1\', \'$2\') RETURNING id" % [entry, definition]))
+doAssert db.getValue(sql"SELECT definition FROM DICTIONARY WHERE entry = ?", entry) == definition
+entry = "Format string entry"
+definition = "Format string definition"
+db.exec(sql"INSERT INTO DICTIONARY(entry, definition) VALUES (?, ?)", entry, definition)
+doAssert db.getValue(sql"SELECT definition FROM DICTIONARY WHERE entry = ?", entry) == definition
+
 echo("All tests succeeded!")
 
 db.close()