vert-x3 / vertx-mysql-postgresql-client

This client is deprecated - use instead
https://github.com/eclipse-vertx/vertx-sql-client
Apache License 2.0
117 stars 59 forks source link

Error when string value contain more than one slash / #51

Closed digorec closed 8 years ago

digorec commented 8 years ago

connection.queryWithParams("INSERT some SET s = ?", new JsonArray().add("http://some.com/test/"), v -> { connection.close(); });

digorec commented 8 years ago
io.vertx vertx-mysql-postgresql-client 3.2.1
leosilvadev commented 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();
            });
          });
        });
      });
    });
  }
digorec commented 8 years ago

postgres. No message, just dont insert record

leosilvadev commented 8 years ago

Sorry, the not was missing at my message... I couldn't reproduce this error using VARCHAR. Can you send the stacktrace and more code?

digorec commented 8 years ago

I'm sorry. Probably my fault. Length of the field type varсhar was less than the length of the string that I inserted.