Closed digorec closed 8 years ago
Mysql or Postgres? Which is the column type? What it the error message? I could NOT reproduce it here:
@Test
public void testStringWithSlashField(TestContext context) {
Async async = context.async();
client.getConnection(arConn -> {
ensureSuccess(context, arConn);
conn = arConn.result();
conn.execute("DROP TABLE IF EXISTS test_table", arDrop -> {
ensureSuccess(context, arDrop);
conn.execute("CREATE TABLE test_table (id INT, link VARCHAR(255))", arCreate -> {
ensureSuccess(context, arCreate);
String link = "http://anylink.com";
conn.updateWithParams("INSERT INTO test_table (id, link) VALUES (? , ?)", new JsonArray().add(1).add(link), arInsert -> {
ensureSuccess(context, arInsert);
conn.query("SELECT link FROM test_table ORDER BY id", arQuery -> {
ensureSuccess(context, arQuery);
ResultSet res = arQuery.result();
context.assertEquals(link, res.getRows().get(0).getString("link"));
async.complete();
});
});
});
});
});
}
postgres. No message, just dont insert record
Sorry, the not was missing at my message... I couldn't reproduce this error using VARCHAR. Can you send the stacktrace and more code?
I'm sorry. Probably my fault. Length of the field type varсhar was less than the length of the string that I inserted.
connection.queryWithParams("INSERT some SET s = ?", new JsonArray().add("http://some.com/test/"), v -> { connection.close(); });