Page 1 of 1
Result + 1 >= MaxDestBytes, Result = 4, MaxDestBytes = 4
Posted: Tue 21 Mar 2006 15:52
by ben
Result + 1 >= MaxDestBytes, Result = 4, MaxDestBytes = 4
any idea about this error?
when I set UseUnicode to true I got this message to one of my queries.
Posted: Tue 21 Mar 2006 15:53
by ben
in MyClasses.pas line 3570
and I use the latest version. downloaded today
Posted: Tue 21 Mar 2006 16:11
by Antaeus
This is MySQL Server bug. It's related to using property UseUnicode=True. Server returns wrong field length in this mode. Unfortunately we can't fix this bug. Please see
this topic.
Posted: Tue 21 Mar 2006 16:20
by ben
why MySQLFront, Navicat and phpAdmin return correct result? Only MyDAC complains about that. I also never hear about such bug in MySQL.
Posted: Wed 22 Mar 2006 13:53
by Antaeus
MyDAC allocates for data as much memory as MySQL server reports. This helps our components work quickly. But when unicode is used, MySQL server returns wrong field length for the fields that are the result of conversion functions. For example, DATE_FORMAT.
Posted: Wed 22 Mar 2006 14:52
by ben
until mysql fix this problem can you please add a small property
IgnoreReturnLength or something similar?
also I would like to point me a URL that shows that mysql bug, from mysql.com site.
Can you provide us a solution or we have to make a research for another DAC component? We just CANT work with it.
Posted: Thu 23 Mar 2006 10:04
by Ikar
This bug concerns only MySQL 4.1 and 5.0 and does not concerns MySQL 4.0. As we can see (
http://bugs.mysql.com/bug.php?id=16678), it will be fixed in nearest time by MySQL AB.
Also, we will try to avoid this problem in nearest MyDAC build.
As temporary solution you can use something like this:
Code: Select all
'SELECT DATE_FORMAT(''2006-01-01'',''%m %Y' ')'
instead of
Code: Select all
'SELECT DATE_FORMAT(''2006-01-01'',''%m %Y'')'
Posted: Thu 23 Mar 2006 11:19
by ben
my query is
Code: Select all
select * from (select
prepay_offers.*, date_format(now(), '%H:%i') as timenow,
case
when offertype = 'NORMAL' then
cast(concat(prepay_offers.description, ' (' , format(prepay_offers.price, 2), ' +', format(prepay_offers.a_price, 2), ')') as char(64))
when offertype ='RANGE' then
cast(concat(prepay_offers.description, ' ', format(prepay_offers.price, 2), ' (', fromtime, '-', totime, ')') as char(64))
end as description1
from
prepay_offers
order by
prepay_offers.position asc) as inlinequery
where
(offertype = 'NORMAL')
or ((offertype = 'RANGE') and (timenow >= fromtime and timenow <= totime))
what can I do as temporary solution?
i use v5.0 or 4.1 cause I have subqueries, I cant use 4 !
Thanks
Posted: Thu 23 Mar 2006 11:27
by ben
ok i fixed the date_format with your tip and it works.
i can also set active to TRUE while design mode with no problems.
but during runtime i receive the error:
illegal mix of collations for operation 'concat'
all my tables, fields are utf8, i double checked it.
Posted: Thu 23 Mar 2006 11:41
by ben
ok I fixed everything, and wait until 5.0.20 for the final fix.
thanks Ikar, you were addressful and helpful!