I have a possible fix in trunk. Can you help test it?
On Wednesday, 11 June 2014 23:06:44 UTC-5, André Kablu wrote:
>
>
> I have a mysql database and created a LIST:INTEGER field
>
> It is created in MYSQL as LONGTEXT type of data
>
>
> In one of my queries I have received an error:
>
> *WEB2PY QUERY:*
> db.table.id_field_list.contains(db.table2.id)
>
> *MYSQL QUERY:*
> SELECT * FROM table, table2 WHERE (table.id_field_list LIKE
> (CONCAT('%|',(REPLACE((REPLACE(CAST(table2.id AS
> LONGTEXT),'%','%%')),'|','||')),'|%')))
>
> The error is with CAST()
>
> Reading mysql documentation, CAST() does not support LONGTEXT
> *http://dev.mysql.com/doc/refman/5.0/en/cast-functions.html#function_cast
> <http://dev.mysql.com/doc/refman/5.0/en/cast-functions.html#function_cast>*
>
> And there are some discussions on google about CAST with LONGTEXT in MYSQL
> that also said it is not compatible
>
>
> If you want to test this behavior, try this command in MYSQL:
>
>
> SELECT CAST(123 as LONGTEXT);
> you will receive the error
>
> then try:
>
> SELECT CAST(123 as char);
> and everything goes fine
>
>
> Is there any way to fix this issue in official version by removing the
> CAST from list: fields for MYSQL or any other better idea?
>
> Thanks
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.