Bug #118750 binary comparison has different results in prepared statement and normal SELECT query
Submitted: 30 Jul 3:33 Modified: 30 Jul 5:51
Reporter: chi zhang Email Updates:
Status: Analyzing Impact on me:
None 
Category:MySQL Server: Prepared statements Severity:S3 (Non-critical)
Version:9.3.0 OS:Any
Assigned to: MySQL Verification Team CPU Architecture:Any

[30 Jul 3:33] chi zhang
Description:
Hi, the following prepared statement should have the same result as the SELECT query, however, they produce different results.

```
SET @b = 68;
PREPARE prepare_query FROM "SELECT (CAST(? AS DECIMAL)) > ('7E 8F')";
EXECUTE prepare_query USING @b;
(CAST(? AS DECIMAL)) > ('7E 8F')
0

SELECT (CAST(68 AS DECIMAL)) > ('7E 8F');
(CAST(68 AS DECIMAL)) > ('7E 8F')
1
```

How to repeat:
```
SET @b = 68;
PREPARE prepare_query FROM "SELECT (CAST(? AS DECIMAL)) > ('7E 8F')";
EXECUTE prepare_query USING @b;
SELECT (CAST(68 AS DECIMAL)) > ('7E 8F');
```