Skip to content

fix(xugudb): use OracleSqlParser instead of MysqlSqlParser for Oracle-dialect plugin - #12

Closed
HandSonic wants to merge 12 commits into
mainfrom
fix/review-xugudb
Closed

HandSonic wants to merge 12 commits into
mainfrom
fix/review-xugudb

Conversation

@HandSonic

Copy link
Copy Markdown
Owner

Fixes verified review finding: XUGUDBSqlParser was an empty subclass of MysqlSqlParser (MySQL grammar), but the XuguDB plugin is Oracle-dialect (dbms_metadata, DUAL, ALL_* views, IDENTITY columns), so Oracle-style PL/SQL blocks (BEGIN...END trigger/procedure bodies) were mis-split in console/script parsing. Switched to OracleSqlParser, matching sibling Oracle-dialect plugins (DM/SUNDB), and swapped the pom dependency chat2db-community-mysql -> chat2db-community-oracle accordingly. Regression tests added: parser class hierarchy, PL/SQL trigger block split as single statement, plain statement splitting. Module build + tests green (5 tests). Part of code-review findings tracked in OtterMind#2281.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 648838d4ff

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

import ai.chat2db.plugin.oracle.parser.OracleSqlParser;

public class XUGUDBSqlParser extends MysqlSqlParser {
public class XUGUDBSqlParser extends OracleSqlParser {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve XuguDB's LIMIT-select recognition

For XuguDB paginated queries, XUGUDBSqlBuilder.buildPageLimit emits LIMIT <size> [OFFSET <offset>] (XUGUDBSqlBuilder.java:135-150), but Oracle's select_statement grammar accepts only Oracle OFFSET/FETCH clauses. Consequently, XuguDB's public parser paths—especially AbstractSqlParser.isSelect, which uses BailErrorStrategy and requires exactly one parsed statement—can reject or misclassify the plugin's own generated SELECTs after this superclass switch. Retain XuguDB-compatible query parsing while customizing PL/SQL block splitting, or extend the new parser for XuguDB's LIMIT syntax and add coverage for isSelect and normal statement parsing.

AGENTS.md reference: AGENTS.md:L144-L145

Useful? React with 👍 / 👎.

HandSonic and others added 6 commits July 28, 2026 17:15
… not leaked (code review follow-up) (OtterMind#2304)

Co-authored-by: openai0229 <136558319+openai0229@users.noreply.github.com>
…2312)

Set the default nullable value of newly added columns in the table
editor to NullableType.Null, so new non-primary-key columns start as
nullable. Primary key columns are still forced to NOT NULL by the
existing handelPrimaryKey handler.

Closes OtterMind#2245

Co-authored-by: liulipengju <monkeycode-ai@chaitin.com>
Co-authored-by: openai0229 <136558319+openai0229@users.noreply.github.com>
…m (code review follow-up) (OtterMind#2303)

Co-authored-by: openai0229 <136558319+openai0229@users.noreply.github.com>
…t bare in SQL value conversion (code review follow-up) (OtterMind#2302)

Co-authored-by: openai0229 <136558319+openai0229@users.noreply.github.com>
…er-growing JDBC URL on reconnect (code review follow-up) (OtterMind#2289)

Co-authored-by: openai0229 <136558319+openai0229@users.noreply.github.com>
@HandSonic HandSonic closed this Aug 23, 2026
@HandSonic
HandSonic deleted the fix/review-xugudb branch August 23, 2026 08:13
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.

3 participants