Skip to content

fix single quote for ANSI_QUOTES sql_mode#5832

Open
fogelito wants to merge 2 commits into
sysown:v3.0from
fogelito:v3.0
Open

fix single quote for ANSI_QUOTES sql_mode#5832
fogelito wants to merge 2 commits into
sysown:v3.0from
fogelito:v3.0

Conversation

@fogelito

@fogelito fogelito commented May 31, 2026

Copy link
Copy Markdown

Fix ANSI_QUOTES when set in sql_mode.
ANSI_QUOTES is the default configuration in Digital Ocean managed databases.

This is our sql_mode configuration

REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ONLY_FULL_GROUP_BY,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

I am getting an errors

SELECT GROUP_CONCAT(CONCAT(member_host, ":", member_port)) FROM performance_schema.replication_group_members;
ERROR 1054 (42S22): Unknown column ':' in 'field list'

Summary by CodeRabbit

  • Bug Fixes
    • Fixed MySQL Group Replication member discovery to correctly parse host and port information.

@coderabbitai

coderabbitai Bot commented May 31, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request updates a MySQL 8.0 Group Replication discovery query by changing the separator used in CONCAT from a quoted string ":" to a character literal ':' when joining member host and port information. The query logic and all other functionality remain unchanged.

Changes

MySQL Group Replication Query Update

Layer / File(s) Summary
Query syntax adjustment
lib/MySQL_Monitor.cpp
The MYSQL_8_GR_QUERY constant updates the members field to use CONCAT(member_host, ':', member_port) with a character literal separator instead of a quoted string literal.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A colon once quoted now stands bare and free,
From : strings to ':' where it ought to be,
A syntax refresh for MySQL's keen eye,
No logic was harmed in this tidy goodbye! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and accurately describes the main change: fixing the query to use single quotes instead of double quotes to handle MySQL's ANSI_QUOTES sql_mode setting.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the SQL query MYSQL_8_GR_QUERY in lib/MySQL_Monitor.cpp to use single quotes for the colon separator in the CONCAT function instead of escaped double quotes. There are no review comments to address, and the change looks correct.

@fogelito

fogelito commented Jun 1, 2026

Copy link
Copy Markdown
Author

@renecannao Can you review please?

@renecannao

Copy link
Copy Markdown
Contributor

Hi @fogelito ,
Thank you for the PR . I had reviewed it some time ago, and also prepared some automated testing. But the last few weeks were very busy.
Getting back to this now.

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants