Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendored/sqlite3-parser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libsql-sqlite3-parser"
version = "0.13.0"
version = "0.13.1"
edition = "2021"
authors = ["gwenn"]
description = "SQL parser (as understood by SQLite) (libsql fork)"
Expand Down
12 changes: 11 additions & 1 deletion vendored/sqlite3-parser/src/dialect/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl TokenType {
}

fn from_bytes(bytes: &[u8]) -> String {
unsafe { str::from_utf8_unchecked(bytes).to_owned() }
String::from_utf8_lossy(bytes).to_string()
}

include!(concat!(env!("OUT_DIR"), "/keywords.rs"));
Expand Down Expand Up @@ -403,3 +403,13 @@ impl TokenType {
}
}
}

#[cfg(test)]
mod tests {
use super::from_bytes;

#[test]
fn converts_invalid_utf8_lossily() {
assert_eq!(from_bytes(&[0xC0, 0x80]), "��");
}
}
Loading