More BIT datatype mess?

More BIT datatype mess?

Postby upscene » Sun 08 Jan 2006 16:06

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
upscene
 

Postby upscene » Mon 09 Jan 2006 09:40

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
upscene
 

Postby GEswin » Mon 09 Jan 2006 10:17

Has it any sense to define a bit field > 1 bit ?? I would supose those fields are for setting boolean (True/False).
GEswin
 
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain

Postby upscene » Mon 09 Jan 2006 10:25

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
upscene
 

Postby Ikar » Tue 10 Jan 2006 16:20

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.
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Postby upscene » Tue 10 Jan 2006 16:30

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]
upscene
 

Postby Ikar » Wed 11 Jan 2006 10:25

This is MySQL server technology restriction. Supporting this feature would slow down execution of statements greatly.
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Postby upscene » Wed 11 Jan 2006 14:58

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
upscene
 

Postby upscene » Mon 16 Jan 2006 10:06

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
upscene
 

Postby Ikar » Mon 16 Jan 2006 13:32

> 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.
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56


Return to MySQL Data Access Components