Re: [JDBC] JDBC String to Bool spec

Поиск
Список
Период
Сортировка
От Jorge Solórzano
Тема Re: [JDBC] JDBC String to Bool spec
Дата
Msg-id CA+cVU8MyUSd6qc2AuB1Eo6QFAC_U1OF_N96Vr6cSmXN9YQSjiw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [JDBC] JDBC String to Bool spec  (Kevin Wooten <kdubb@me.com>)
Ответы Re: [JDBC] JDBC String to Bool spec  (rob stone <floriparob@gmail.com>)
Re: JDBC String to Bool spec  (rob stone <floriparob@gmail.com>)
Список pgsql-jdbc

On Mon, Jan 16, 2017 at 2:22 PM, Kevin Wooten <kdubb@me.com> wrote:
I agree it should support all the types the JDBC spec says it should; and it does.  I’m focused on the CHAR/VARCHAR  to Boolean conversion.

To add to your example

CREATE TABLE testboolstring (a varchar(30));

INSERT INTO testboolstring VALUES('this is not true’);
>> ResultSet.getBoolean(1) returns FALSE

INSERT INTO testboolstring VALUES(‘1.0’);
>> ResultSet.getBoolean(1) returns TRUE

INSERT INTO testboolstring VALUES(2.2’);
>> ResultSet.getBoolean(1) returns FALSE


Since we now know the JDBC spec doesn’t support this (thanks to all of Mark Rotteveel’s sleuthing) & we know Postgres doesn’t support this.  It seems the “feature" should be removed or placed behind an option.  Postgres results in an error here and considering this is a driver tied to that database I look to that to clarify ambiguity. These examples should all result in an error.



​Yes, I agree, a "feature"​ that allows bad code should be considered a "bug".


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Kevin Wooten
Дата:
Сообщение: Re: [JDBC] JDBC String to Bool spec
Следующее
От: rob stone
Дата:
Сообщение: Re: JDBC String to Bool spec