diff options
author | Thomas Johnson <tbjohnson123@gmail.com> | 2017-10-24 01:48:45 -0700 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-10-24 10:48:45 +0200 |
commit | 61a50d9c8c46d80fe947a5f86fb30ee8ca922976 (patch) | |
tree | 2751b61e8a7e27de36aa4a7a32d6ab0721af2cda /tests/untestable/tpostgres.nim | |
parent | ce04288d6492c36f5021198d9d7fe8a6932959e4 (diff) | |
download | Nim-61a50d9c8c46d80fe947a5f86fb30ee8ca922976.tar.gz |
Fixes #6571 (#6578)
Diffstat (limited to 'tests/untestable/tpostgres.nim')
-rw-r--r-- | tests/untestable/tpostgres.nim | 19 |
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() |