Page 1 of 1
More BIT datatype mess?
Posted: Sun 08 Jan 2006 16:06
by upscene
Create table:
create table bit_and_others_table
( b_10 bit(10),
b_ bit,
bool_ boolean
)
When selecting data, the b_10 column comes back as a TBooleanField? This seems incorrect. Is there any length recognition for the BIT datatype?
--
Martijn Tonies
Upscene Productions
Posted: Mon 09 Jan 2006 09:40
by upscene
When working with BIT datatypes with a length of >2, this might be useful:
http://dev.mysql.com/doc/refman/5.0/en/ ... alues.html
I guess it shouldn't always come back as a TBooleanField and the component needs to be changed.
Can you confirm?
--
Martijn Tonies
Upscene Productions
Posted: Mon 09 Jan 2006 10:17
by GEswin
Has it any sense to define a bit field > 1 bit ?? I would supose those fields are for setting boolean (True/False).
Posted: Mon 09 Jan 2006 10:25
by upscene
If MySQL allows you to do that, and define, for example:
create table myflags
(
flag bit(4)
)
Then yes, it makes sense. Would I do it? No. Would my customers? Yes, I just got a bug-report about this
--
Martijn Tonies
Upscene Productions
Posted: Tue 10 Jan 2006 16:20
by Ikar
Without additional request to server we can't distinguish BIT from BIT(2). We can distinguish BIT from BIT(10) by using Length parameter. But for BIT and BIT(2)value of Length is same.
Posted: Tue 10 Jan 2006 16:30
by upscene
Well, I guess the components need some modification then
BIT(2) is just very different from BIT(1) and MyDAC currently doesn't support it.
--
Martijn Tonies
Upscene Productions[/quote]
Posted: Wed 11 Jan 2006 10:25
by Ikar
This is MySQL server technology restriction. Supporting this feature would slow down execution of statements greatly.
Posted: Wed 11 Jan 2006 14:58
by upscene
Sorry, but I fail to see the problem here.
Thing is: supplying us Delphi-guys with a TBooleanField is simply wrong for BIT(> 1).
For example, the Microolap guys just introduced BIT support:
[+] BIT datatype support. Fields are represented like TLargeintField (int64).
Which makes sense, given that there's a max of 64 bits to be supported in the BIT datatype.
Can't you do this for BIT(>1)? Actually, you SHOULD do this, given that the current BIT-support implementation is crippled.
--
Martijn Tonies
Upscene Productions
Posted: Mon 16 Jan 2006 10:06
by upscene
Any news on this? What are your plans on solving this?
As far as I can see, there are two issues here:
1) flawed implementation for BIT with a length > 1
2) problems in the implementation with the Prepared protocol and MyDAC.
For (1) I would say: use some kind of integer based TField instead of a TBooleanField.
For (2), I sent you two e-mail addresses of people with the MySQL crew that are willing to help, IF there is a problem.
--
Martijn Tonies
Upscene Productions
Posted: Mon 16 Jan 2006 13:32
by Ikar
> 1) flawed implementation for BIT with a length > 1
MySQL API doesn't provide ability to distinguish BIT(1) and BIT(>1). So, from nearest build all MySQL 5 BIT fields, including BIT(1), will be represented as TLargeintField.
> 2) problems in the implementation with the Prepared protocol and MyDAC.
> I sent you two e-mail addresses of people
We will contact them at nearest time.