Under semantic-equivalent rewriting, the source and mutated queries are logically equivalent, but produce different results in polardbx-sql.
Summary: when an empty first UNION ALL arm has type BIT(1), moving the second arm into a view changes integer constant 1 into byte string 0x01.
version: 5.4.19-SNAPSHOT
How to repeat:
DROP DATABASE IF EXISTS t1;
CREATE DATABASE t1;
USE t1;
CREATE TABLE t2 (
c12 BIT(1)
);
-- Source Original SQL
SELECT c12 AS col1 FROM t2 WHERE 1=0
UNION ALL
SELECT 1 AS col1;
-- View SQL
CREATE VIEW V AS
SELECT 1 AS col1;
-- Mutated SQL
SELECT c12 AS col1 FROM t2 WHERE 1=0
UNION ALL
SELECT col1 FROM V;
Observed result - Query A (original):
Observed result - Query B (mutated):
Under semantic-equivalent rewriting, the source and mutated queries are logically equivalent, but produce different results in
polardbx-sql.Summary: when an empty first
UNION ALLarm has typeBIT(1), moving the second arm into a view changes integer constant1into byte string0x01.version:
5.4.19-SNAPSHOTHow to repeat:
Observed result - Query A (original):
Observed result - Query B (mutated):
\x01