-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Description
When using sql_minifier version 0.1.5, minify_sql incorrectly removes spaces around symbols inside string literals. This leads to incorrect SQL when the string content contains operators like > or <.
To Reproduce
use sql_minifier::minify_sql;
#[test]
fn test_string_with_symbols() {
let sql = r#"
INSERT INTO messages (content) VALUES ('A > B and C < D');
"#;
let minified = minify_sql(sql);
assert_eq!(
minified,
"INSERT INTO messages(content) VALUES('A > B and C < D')"
);
}Expected behavior
The minified SQL should preserve all spaces and symbols inside string literals:
INSERT INTO messages(content) VALUES('A > B and C < D')
Actual behavior
Currently, minify_sql may remove spaces around > and < inside the string, breaking the SQL logic.
Environment
sql_minifierversion: 0.1.5- Rust version: rustc 1.89.0 (29483883e 2025-08-04) cargo 1.89.0 (c24e10642 2025-06-23)
- OS: Microsoft Windows 11
Metadata
Metadata
Assignees
Labels
No labels