Skip to content

Commit

Permalink
Better handling for unicodes in JS-API prepared statements
Browse files Browse the repository at this point in the history
  • Loading branch information
carlopi committed Aug 22, 2024
1 parent 9b5991a commit 202e00c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/src/webdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@ arrow::Result<duckdb::unique_ptr<duckdb::QueryResult>> WebDB::Connection::Execut
if (v.IsLosslessDouble())
values.emplace_back(v.GetDouble());
else if (v.IsString())
values.emplace_back(v.GetString());
// Use GetStringLenght otherwise null bytes will be counted as terminators
values.emplace_back(string_t(v.GetString(), v.GetStringLength()));
else if (v.IsNull())
values.emplace_back(nullptr);
else if (v.IsBool())
Expand Down

0 comments on commit 202e00c

Please sign in to comment.