-
-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Boolean data type [CORE726] #1101
Comments
Commented by: Alexander Tyutik (tut) Do not know what standart tells about boolean type, but seems (for me) true/false/null is not enough. Look at next few samples: DECLARE B1 BOOLEAN; 1) B1 = NULL; 2) B2 = FALSE OR NULL; What do you think should be in case of 2? I think there should be fourth state UNKNOWN and B1IS DISTINCT FROM B2 So maby real boolean should have 4 posible values? From other side look at microsoft's solution. Thay made BIT type instead of boolean. Client libraries use it as BOOLEAN type, but in database it used as simple flag. And in this case there are no problems with fourth state UNKNOWN. But maybe i'm wring. What do you think? |
Commented by: @dyemanov In the SQL specification, both NULL and UNKNOWN mean the same for the BOOLEAN datatype, so that (NULL IS NOT DISTINCT FROM UNKNOWN). As for the BIT datatype, I fail to see why it's radically better than [SMALL]INT in terms of the BOOLEAN emulation. |
Commented by: Alexander Tyutik (tut) About UNKNOWN i understood, thanks. About SMALLINT: bacause client liraries, such as .NET Privider, automatically converts BIT into boolean datatype and with SMALLLINT it is impossible. But if UNKNOWN=NULL for BOOL than BIT type is unnecessary. |
Commented by: Fidel Viegas (araujofh) It would be nice to be able to use 'true' and 'false'. Are there any plans to add support for this? |
Modified by: @pcisarWorkflow: jira [ 10750 ] => Firebird [ 15147 ] |
Commented by: Cosmin Apreutesei (cosmin_ap2) There's little value (i.e no expressivity nor functional gain) in merely adding the BOOLEAN built-in type and the TRUE and FALSE constants. Everybody has a boolean domain in their databases and x = 1 vs x = TRUE changes nothing really. Besides, I get more expressivity by using (a + b + c > 0) than I would get from (a = TRUE and b = TRUE and c = TRUE). Instead, here's what would really add power to the language: (***)Currently, since boolean operators can only be used in the WHERE clause, you cannot determine (and it doesn't matter) if the expression (A = 1 AND NULL = 1) evaluates to FALSE or to NULL (by SQL definition, it would have to be NULL, but since the outcome is the same in a WHERE clause, how can you tell?). New semantics would have to be specified for such cases. |
Commented by: maziar (maziar) this really needed specially when need port other database system link mysql to firebird for example how use boolean typ via ODBC when needed data typ boolean ? |
Commented by: Ivan (patuljak) this is maybe need but you can create table mytable( ID integer, |
Modified by: @asfernandesassignee: Adriano dos Santos Fernandes [ asfernandes ] |
Modified by: @asfernandesComponent: API / Client Library [ 10040 ] summary: True Boolean Datatype => Boolean data type |
Modified by: @asfernandesstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 3.0 Alpha 1 [ 10331 ] |
Commented by: @ibprovider Please add the support for blr_sql_bool into sdl_desc [sdl.cpp] Thanks. |
Submitted by: @pcisar
Is related to QA503
Votes: 27
SFID: 807929#
Submitted By: pcisar
A new datatype which the three states -
true/false/null.
Commits: 81fb754 c9ec26c FirebirdSQL/fbt-repository@99cf5b7
The text was updated successfully, but these errors were encountered: