Bug #6321 | strange error, string function FIELD(<uservariable content NULL>, ... | ||
---|---|---|---|
Submitted: | 29 Oct 2004 14:14 | Modified: | 5 Nov 2004 10:10 |
Reporter: | Matthias Leich | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 4.1 | OS: | |
Assigned to: | Alexander Barkov | CPU Architecture: | Any |
[29 Oct 2004 14:14]
Matthias Leich
[29 Oct 2004 15:13]
Matthias Leich
One additional observation: If I replace select FIELD( @var,'1it','Hit','3it') as my_column ; with a prepared statement like prepare stmt from "select FIELD( ?,'1it','Hit','3it') as my_column" ; execute stmt using @var ; I get the expected result.
[5 Nov 2004 6:32]
Alexander Barkov
A bit more descriptive example: set @var= NULL; select FIELD( @var,'1it','Hit') as my_column ; ERROR 1270 (HY000): Illegal mix of collations (binary,NONE), (latin1_swedish_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE) for operation 'field'