Skip to content

[Feature Request] MySQL 8.0 Expressions Compatibility: SOUNDS LIKE and ROW constructor #24496

Description

Overview

Based on comprehensive testing against MySQL 8.0 Reference Manual (Section 11.5 Expressions), MatrixOne v3.0 has excellent compatibility (96.2%) with MySQL 8.0 expression syntax. However, 2 expression features are currently not supported.

Environment


Feature 1: SOUNDS LIKE Predicate

Description

The SOUNDS LIKE predicate is used for phonetic (Soundex algorithm) similarity matching between strings. This is commonly used for name matching scenarios where similar-sounding names should match.

Current Behavior

SELECT 'hello' SOUNDS LIKE 'halo';

Error:

ERROR 1064 (HY000): SQL parser error: You have an error in your SQL syntax; 
check the manual that corresponds to your MatrixOne server version for the 
right syntax to use. syntax error at line 1 column 26 near " LIKE 'halo'"

Expected Behavior (MySQL 8.0)

SELECT 'hello' SOUNDS LIKE 'halo';

Result:

+----------------------------+
| 'hello' SOUNDS LIKE 'halo' |
+----------------------------+
|                          1 |
+----------------------------+

Workaround

-- Use REGEXP for pattern matching
SELECT 'hello' REGEXP '^h.*o';

-- Or implement Soundex algorithm in application layer

Impact Assessment

  • Severity: Low
  • Usage: Phonetic matching (name matching, fuzzy search)
  • Alternative: Available via REGEXP or application-layer implementation

Feature 2: ROW Constructor Expression

Description

The ROW constructor creates row values that can be compared. This is useful for multi-column comparisons and tuple comparisons in SQL queries.

Current Behavior

SELECT ROW(1, 2) = ROW(1, 2);

Error:

ERROR 1064 (HY000): SQL parser error: You have an error in your SQL syntax; 
check the manual that corresponds to your MatrixOne server version for the 
right syntax to use. syntax error at line 1 column 10 near " ROW(1, 2) = ROW(1, 2)"

Expected Behavior (MySQL 8.0)

SELECT ROW(1, 2) = ROW(1, 2);

Result:

+--------------------------+
| ROW(1, 2) = ROW(1, 2)    |
+--------------------------+
|                        1 |
+--------------------------+

Common Use Cases

1. Multi-column comparison in subqueries

-- MySQL syntax
SELECT * FROM t1 WHERE (c1, c2) = (SELECT c1, c2 FROM t2 WHERE id = 1);

2. Row value IN queries

-- MySQL syntax
SELECT * FROM t1 WHERE (c1, c2) IN (SELECT c1, c2 FROM t2);

3. Composite ordering comparisons

-- MySQL syntax
SELECT * FROM users WHERE (last_name, first_name) > ('Smith', 'John');

Workarounds

For multi-column comparison:

-- Rewrite using AND
SELECT * FROM t1 
WHERE c1 = (SELECT c1 FROM t2 WHERE id = 1) 
  AND c2 = (SELECT c2 FROM t2 WHERE id = 1);

-- Or use JOIN
SELECT t1.* FROM t1 
JOIN t2 ON t1.c1 = t2.c1 AND t1.c2 = t2.c2 
WHERE t2.id = 1;

For row value IN queries:

-- Rewrite using JOIN
SELECT DISTINCT t1.* FROM t1 
JOIN t2 ON t1.c1 = t2.c1 AND t1.c2 = t2.c2;

For composite ordering:

-- Rewrite using compound conditions
SELECT * FROM users 
WHERE last_name > 'Smith' 
   OR (last_name = 'Smith' AND first_name > 'John');

Impact Assessment

  • Severity: Medium
  • Usage: Multi-column comparisons, complex queries from ORM frameworks
  • Alternative: Available but requires verbose query rewrites

Summary

Feature Priority Workaround Available Common Usage
SOUNDS LIKE Low Yes (REGEXP) Phonetic matching
ROW constructor Medium Yes (AND/JOIN) Multi-column comparison

Recommendation

While both features have workarounds, supporting them would:

  1. Improve MySQL 8.0 compatibility to 98%+
  2. Reduce migration effort from MySQL applications
  3. Support ORM frameworks that generate such SQL

The ROW constructor is recommended as higher priority due to its more common usage in complex SQL queries and ORM-generated statements.


Activity

  1. ghost added this to the MO-202605 milestone on May 20, 2026
  2. ghost added theissue type on May 20, 2026
  3. ghost added
    priority/p1
    on May 20, 2026
  4. Repository owner unassigned on May 20, 2026
  5. ghost added
    kind/compatibility
    on May 20, 2026
  6. added
    ai-light
    on Jul 1, 2026
  7. removed
    ai-light
    on Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/compatibilitykind/featurepriority/p1

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions