group_concat_max_len -> Expecting: String actual: Memo
Posted: Fri 15 Feb 2008 16:01
Hello,
I've encourted a problem with using group_concat() and adding fields to Query. In some situations the field is detected as TMemoField and in others as TStringField. The former works OK everytime but the latter doesn't work if 'SET group_concat_max_len...' was sent -> Error: Type mismatch for field 'sth', expecting: String actual: Memo.
Here are the steps to reproduce, create the following database:
Create a MyConnection and 2 Queries:
MyQuery1:
MyQuery2:
Use Fields Editor and Add Fields to both queries.
The sth in MyQuery1 is TMemoField.
The sth in MyQuery2 is TStringField.
Run the Application.
Issue:
If you don't issue ExecSQL() then both queries open correctly, but if you do then the second one raises the Exception.
I use MyDAC 5.20.0.13 and MySQL 5.0.
Regards,
Crafty
I've encourted a problem with using group_concat() and adding fields to Query. In some situations the field is detected as TMemoField and in others as TStringField. The former works OK everytime but the latter doesn't work if 'SET group_concat_max_len...' was sent -> Error: Type mismatch for field 'sth', expecting: String actual: Memo.
Here are the steps to reproduce, create the following database:
Code: Select all
CREATE DATABASE `tests` /*!40100 DEFAULT CHARACTER SET cp1250 */;
USE `tests`;
CREATE TABLE `newtb_r` (
`id` int(10) NOT NULL auto_increment,
`somestr` varchar(255) character set cp1250 default NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
CREATE TABLE `newtb_b` (
`id` int(10) NOT NULL auto_increment,
`somestr` varchar(255) default NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
MyQuery1:
Code: Select all
select group_concat(S.somestr) as sth from
newtb_r SCode: Select all
select group_concat(S.somestr) as sth from
newtb_b SThe sth in MyQuery1 is TMemoField.
The sth in MyQuery2 is TStringField.
Run the Application.
Issue:
Code: Select all
MyConnection1.Open;
MyConnection1.ExecSQL('SET group_concat_max_len = 100000;', []);
MyQuery1.Open;
MyQuery2.Open; -> exceptionI use MyDAC 5.20.0.13 and MySQL 5.0.
Regards,
Crafty