Skip to content

Quote phonetic_question RANK so MySQL 8 write-back inserts succeed - #22

Open
thcathy wants to merge 1 commit into
masterfrom
cursor/quote-rank-column-14f5
Open

thcathy wants to merge 1 commit into
masterfrom
cursor/quote-rank-column-14f5

Conversation

@thcathy

@thcathy thcathy commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

UAT smoke of #21 (2.1.1-245 / 497c987) returned HTTP 408 with an empty body for enriched misses such as serendipity and petrichor.

Hibernate sent insert into phonetic_question (..., RANK, WORD) values (...). MySQL 8.0.32 treats bare RANK as a reserved word, so the insert failed with SQLSyntaxErrorException near 'RANK,WORD) values ('. That exception is an InvalidDataAccessResourceUsageException, which insertIfAbsent does not catch, and VocabPracticeController maps it to 408. No rank-0 rows were written. Bank hits such as apple still worked because selected columns are table-qualified.

@Column(name = "\"RANK\"") makes the MySQL dialect emit `RANK` on insert and update. Other columns stay unquoted. No schema job.

Write-back rules are unchanged: true miss only, both IPA and pronunciation URL, rank 0, picture hide left as-is.

Tests

./gradlew test is green.

  • PhoneticQuestionMysqlRankSqlTest renders insert and update with the MySQL dialect and fails if RANK is unquoted. H2 accepted the old SQL, which is why the original suite missed this.
  • PhoneticQuestionWriteBackTest and PhoneticQuestionServiceTest still cover the insert path.

Not deployed.

Open in Web Open in Cursor 

Unquoted RANK is reserved, so slim write-back inserts failed with a syntax error and the vocab lookup returned 408.
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.

1 participant