Hi.
Ran into a wierd scenario today, and was wondering if anyone else has had this problem. When using MySQL MEDIUMTEXT field, either allowing null values or not, if sent a blank value, MySQL is saving this as "\0" (ASCIICHAR(0)), which IS the equivalent to NULL in the same way "\r" is ASCIICHAR(13) or "\n" is ASCIICHAR(10). So in order to only return records where that field has a value i have to construct a query like so:
{ 'SELECT * FROM `theField` WHERE
`thefield` != \'\' AND
`thefield` != \'\\0\' AND
`thefield` IS NOT NULL;' }
I can't find anything on MySQL's site about this, so i was wondering if maybe it was the Empressa connector sending ASCIICHAR(0) for null and/or blank values?
Using MySQL 5.1 and Empressa's MySQL v5 connector.
I do not believe i've had this problem on MySQL versions < v5 and I am 95% sure it isnt happening with CHAR/VARCHAR fields, only TEXT types.
Thanks,
Bill
Ran into a wierd scenario today, and was wondering if anyone else has had this problem. When using MySQL MEDIUMTEXT field, either allowing null values or not, if sent a blank value, MySQL is saving this as "\0" (ASCIICHAR(0)), which IS the equivalent to NULL in the same way "\r" is ASCIICHAR(13) or "\n" is ASCIICHAR(10). So in order to only return records where that field has a value i have to construct a query like so:
{ 'SELECT * FROM `theField` WHERE
`thefield` != \'\' AND
`thefield` != \'\\0\' AND
`thefield` IS NOT NULL;' }
I can't find anything on MySQL's site about this, so i was wondering if maybe it was the Empressa connector sending ASCIICHAR(0) for null and/or blank values?
Using MySQL 5.1 and Empressa's MySQL v5 connector.
I do not believe i've had this problem on MySQL versions < v5 and I am 95% sure it isnt happening with CHAR/VARCHAR fields, only TEXT types.
Thanks,
Bill
Comment