mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-04 01:25:07 +08:00
Fixed 12787 with syntax error in generated MySql json path expression (#12929)
### What problem does this PR solve? Fixed 12787 with syntax error in generated MySql json path expression https://github.com/infiniflow/ragflow/issues/12787 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) #### What was fixed: - Changed line 237 in ob_conn.py from value_str = get_value_str(value) if value else "" to value_str = get_value_str(value) - This fixes the bug where falsy but valid values (0, False, "", [], {}) were being converted to empty strings, causing invalid SQL syntax #### What was tested: - Comprehensive unit tests covering all edge cases - Regression tests specifically for the bug scenario --------- Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
This commit is contained in:
@ -236,7 +236,7 @@ def get_metadata_filter_expression(metadata_filtering_conditions: dict) -> str:
|
||||
continue
|
||||
|
||||
expr = f"JSON_EXTRACT(metadata, '$.{name}')"
|
||||
value_str = get_value_str(value) if value else ""
|
||||
value_str = get_value_str(value)
|
||||
|
||||
# Convert comparison operator to MySQL JSON path syntax
|
||||
if comparison_operator == "is":
|
||||
|
||||
Reference in New Issue
Block a user