Hi,
I have a MySQL DB, a delphi32 server and a IOS Client.
I have found something strange :
I have 2 fields like this : show_price_section TINYINT(1) UNSIGNED NOT NULL DEFAULT ‘1’ date_add DATETIME NULL DEFAULT ‘2011-01-01 00:00:00’
if show_price_section is 1 in MySQL I get 255 on IOS
if date_add is “2012-04-13 11:06:52” in MySQL I get ‘Fri Apr 13 2012 11:06:51 GMT+0200 (CEST)’
I’m trying to reproduce this locally.
Can I ask you what kind of driver you are using in the server application?
Also what is the data type for your ‘show_price_section’ field is in the DASchema?
I could reproduce it partially.
The TINYINT(1) field for this driver returns 255 when value is 1.
The cause of this in double conversion. MyDAC consider TINYINT(1) as typical boolean field while in schema it registered as datByte. So it convert 1 to Boolean and then Boolean to Byte.
I’ve registered an issue #55380 for our Delphi team to investigate and fix, and as the workaround I can advice to change field type from datByte to datBoolean. It should avoid this double conversion and you will get proper value.
As for date values I couldn’t reproduce that. Value I get is exact the same as I wrote it into database.
As I see in your report you get value that differs from database value for 1 second. Could it be a rounding issue? say in the server you have “2012-04-13 11:06:51.888” which was rounded on the client side to “2012-04-13 11:06:52”? But I couldn’t add such value to the server for checking.
Hi Alex,
to be honnest I havn’t seen the diff in seconds.
I was more speaking about the value itself, the value is stored as “2012-04-13 11:06:52” in MySQL, and DA return ‘Fri Apr 13 2012 11:06:51 GMT+0200 (CEST)’ wich is another format, my SQLLite client local tables use the same format as MySQL. Here DA Xcode return it in different value.
Regards