Re: ODBC Boolean handling
От | Hiroshi Inoue |
---|---|
Тема | Re: ODBC Boolean handling |
Дата | |
Msg-id | 3B6A641E.A1A63341@tpf.co.jp обсуждение исходный текст |
Ответ на | Re: ODBC Boolean handling (Bruce Momjian <pgman@candle.pha.pa.us>) |
Ответы |
Re: ODBC Boolean handling
|
Список | pgsql-patches |
I wrote: > > Bruce Momjian wrote: > > > > Here is the submitted patch so everyone can see it. > > > > I agree to the first change but am suspicious about the > second change. > > > > > 2) I had issues with some utilities that, when casting from string to > > > > boolean, and having > > > > the global 'bools as char' set, require that -1 = True, and 0 = false. > > > > > > Though Aidan is right, is -1 guaranteed to be true in > any application conversely ? It seems also different > from the ODBC spec. I don't have the solution now. > Please never apply the second part. I would propose another idea instead soon(hopefully). regards, Hiroshi Inoue -- 425,452 ---- break; case PG_TYPE_BOOL: ! if (cbValueMax > len) <<<<<<< len isn't set at this point. >>>>>>> { ! /* Aidan Mountford (aidan@oz.to) 1/08/2001: ! ! When returning a CHAR datatype, return -1 ! instead of +1. ! ! That way if someone casts it back to a boolean ! again - it will work. ! */ ! if ( *(char *) value = '1') <<<<<<<< '=' must be '=='. >>>>>>>>
В списке pgsql-patches по дате отправления: