Re: cfquery returns db tinyint(1) as boolean

2008-06-02 Thread Richard White
hi dave. yeah we just found that it is a previously submitted bug for mysql 
jconnector which we use in dreamweaver. 

to get around it we just changed those columns to smallint(1)

thanks

 after lots of problematic select statements we have realised 

I don't know if this is a problem specific to MySQL or the MySQL JDBC
drivers.

You might work around this by simply casting within your SQL.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information! 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306600
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: cfquery returns db tinyint(1) as boolean

2008-06-02 Thread Dave Watts
 after lots of problematic select statements we have realised 
 that if a db column has a type of tinyint(1) and that column 
 in the mysql db has '2' stored in it, then running a cfquery 
 will only return 0 or 1
 
 so we realise that cfquery must convert tinyint(1) columns to boolean
 
 we couldn't believe that a the same select statement directly 
 in mysql returned a value of 2 but a cfquery returned the 
 value 1 - on the tinyint(1) column
 
 is this right?, is this a bug? or is there a way we can turn 
 this conversion to a boolean off? or will we have to change 
 any tinyint(1) columns to smallint(1)

I don't know if this is a problem specific to MySQL or the MySQL JDBC
drivers.

You might work around this by simply casting within your SQL.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306585
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: cfquery returns db tinyint(1) as boolean

2008-06-02 Thread Azadi Saryev
iirc, this is not a cfquery doing, but rather the mysql jdbc driver's.
there is some setting for the connector-j and/or in mysql server config
file that changes this behaviour, but you will have to look it up in the
mysql reference manual - i do not remember the details of this setting...

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/



Richard White wrote:
 hi,

 after lots of problematic select statements we have realised that if a db 
 column has a type of tinyint(1) and that column in the mysql db has '2' 
 stored in it, then running a cfquery will only return 0 or 1

 so we realise that cfquery must convert tinyint(1) columns to boolean

 we couldn't believe that a the same select statement directly in mysql 
 returned a value of 2 but a cfquery returned the value 1 - on the tinyint(1) 
 column

 is this right?, is this a bug? or is there a way we can turn this conversion 
 to a boolean off? or will we have to change any tinyint(1) columns to 
 smallint(1)

 thanks

 richard 

 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306614
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: cfquery returns db tinyint(1) as boolean

2008-06-02 Thread Richard White
oh i see, i didnt think they had fixed it yet, ok thanks ill look into the 
config - thanks azadi

iirc, this is not a cfquery doing, but rather the mysql jdbc driver's.
there is some setting for the connector-j and/or in mysql server config
file that changes this behaviour, but you will have to look it up in the
mysql reference manual - i do not remember the details of this setting...

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/



Richard White wrote:
 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306617
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4