Skip to content

Fix "Warn when updating a table fails" test without requiring SUPER privilege - #253

Merged
swissspidy merged 1 commit into
mainfrom
claude/lucid-gauss-yne8u6
Nov 18, 2026
Merged

swissspidy merged 1 commit into
mainfrom
claude/lucid-gauss-yne8u6

Conversation

@swissspidy

@swissspidy swissspidy commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

The Warn when updating a table fails due to a database error scenario started failing in CI (log):

ERROR 1419 (HY000) at line 1: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)

The test created a BEFORE UPDATE trigger as the non-root test user. MySQL 8 has binary logging on by default, and in that case it won't let a user without SUPER create a trigger.

This PR causes the update error a different way: the data column now has a UNIQUE key, and the table already holds both old-value and new-value. Replacing old-value with new-value hits a duplicate-key error. That happens on the SQL REPLACE() path and on the PHP path alike, and it needs no special privileges. The test now expects Duplicate entry instead of the custom trigger message.


Generated by Claude Code

Summary by CodeRabbit

  • Tests
    • Updated a database-error scenario to verify that duplicate values trigger the expected error.

Creating a trigger fails with ERROR 1419 when binary logging is enabled
and the test user lacks the SUPER privilege. Trigger the update error
via a unique key conflict instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UWTd5qRHChT2dgTfE2dswC
@swissspidy
swissspidy requested a review from a team as a code owner November 18, 2026 06:27
Copilot AI balanced review requested due to automatic review settings November 18, 2026 06:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The database-error scenario now uses a unique index and two inserted values to produce a duplicate-entry error. The expected error text changes from Table is read-only to Duplicate entry.

Changes: Database error scenario

Layer / File(s) Summary
Duplicate-entry fixture
features/search-replace.feature
The scenario creates a uniquely indexed VARCHAR(191) column and inserts old-value and new-value. It expects Duplicate entry instead of Table is read-only.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Suggested reviewers: schlessera, ernilambar

Merge Risk: Minimal · up to 91788

This change only adjusts a test scenario so it no longer needs elevated database privileges. It does not affect production behavior, and the risk of merging is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the test being fixed and the constraint it addresses. The changeset replaces the BEFORE UPDATE trigger in the database-error scenario of features/search-replace.feature with a UNIQUE k…
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.
Full details: Title check

Explanation

The title names the test being fixed and the constraint it addresses. The changeset replaces the BEFORE UPDATE trigger in the database-error scenario of features/search-replace.feature with a UNIQUE key and a duplicate-entry conflict. The title states the primary change, so the check passes.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d5463347-290a-4718-8086-89eb79e1be71
Commits

Reviewing files that changed from the base of the PR and between f2d5572 and 91788ee.

Files selected for processing: 1

  • features/search-replace.feature

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@github-actions github-actions Bot added automated-pr bug command:search-replace Related to 'search-replace' command scope:testing Related to testing labels Nov 18, 2026
@swissspidy swissspidy added this to the 3.1.0 milestone Nov 18, 2026
@codecov

codecov Bot commented Nov 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@swissspidy
swissspidy merged commit 5181346 into main Nov 18, 2026
60 checks passed
@swissspidy
swissspidy deleted the claude/lucid-gauss-yne8u6 branch November 18, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated-pr bug command:search-replace Related to 'search-replace' command scope:testing Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants