Skip to content

Conversation

@StpMax
Copy link
Collaborator

@StpMax StpMax commented Nov 14, 2025

This is fix for ON as value of variable:

set @@var=ON

@StpMax StpMax requested a review from ea-rus November 14, 2025 15:59
@github-actions
Copy link

Coverage

Coverage Report
FileStmtsMissCoverMissing
mindsdb_sql_parser
   __about__.py10100%1–10
   __init__.py1192381%44, 48, 53, 98, 115, 118, 139–158, 165–166
   lexer.py2832193%373, 375, 377, 389, 391, 393, 399–417
   logger.py19479%14, 17, 23, 26
   parser.py11173097%129, 133, 301, 326, 432, 619, 636, 660–661, 882, 936, 1013, 1114, 1168, 1178, 1247, 1258, 1341, 1417, 1456, 1492, 1688–1689, 1868–1869, 2045, 2053, 2106–2109
   utils.py791186%73–79, 116, 132, 134, 136, 142–145
mindsdb_sql_parser/ast
   base.py36586%13, 28, 31, 46, 51
   create.py82989%7–8, 23–31, 95
   drop.py52296%10, 13
   insert.py63494%39–41, 46
   show.py48198%18
   update.py53591%40–42, 75–76
mindsdb_sql_parser/ast/mindsdb
   knowledge_base.py118397%79, 118, 128
mindsdb_sql_parser/ast/select
   case.py37197%22
   constant.py36197%23
   data.py11464%10–12, 15, 19
   identifier.py831187%56, 104–112, 122
   native_query.py13192%25
   operation.py139497%57, 66, 178, 202
   parameter.py15287%17, 20
   select.py108397%160–165
   star.py12283%8–9
TOTAL345815795% 

Tests Skipped Failures Errors Time
314 0 💤 0 ❌ 0 🔥 13.420s ⏱️

@entelligence-ai-pr-reviews
Copy link

🔒 Entelligence AI Vulnerability Scanner

No security vulnerabilities found!

Your code passed our comprehensive security analysis.

📊 Files Analyzed: 1 files


@entelligence-ai-pr-reviews
Copy link

Review Summary

🏷️ Draft Comments (1)

Skipped posting 1 draft comments that were valid but scored below your review threshold (>=13/15). Feel free to update them here.

mindsdb_sql_parser/parser.py (1)

1758-1761: ON is parsed as a string constant ('ON') instead of a boolean True, which can cause incorrect runtime behavior for SQL like SET @@var=ON.

📊 Impact Scores:

  • Production Impact: 4/5
  • Fix Specificity: 5/5
  • Urgency Impact: 3/5
  • Total Score: 12/15

🤖 AI Agent Prompt (Copy & Paste Ready):

In mindsdb_sql_parser/parser.py, lines 1758-1761, the parser currently returns `Constant(value='ON', with_quotes=False)` for the `ON` keyword. This causes `ON` to be treated as a string instead of a boolean, which is incorrect for SQL statements like `SET @@var=ON`. Change the return value to `Constant(value=True)` so that `ON` is parsed as a boolean True.

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