poggit / libasynql

Asynchronous MySQL access library for PocketMine plugins.
https://poggit.github.io/libasynql
Apache License 2.0
134 stars 44 forks source link

Implement blob data support for SQLite #39

Closed CortexPE closed 4 years ago

CortexPE commented 4 years ago

SQLite3::escapeString() currently is not binary-safe, which causes blob data to be encoded into the final query incorrectly.

This can be tested by inserting binary data (with \0 a.k.a. the NULL character) into a blob column.

Without this patch, it would only insert the first-n bytes before a \0 is encountered.

Before: image

After: image

SOF3 commented 4 years ago

To be precise, this is binary string support, not blob data support.

Please update the CHANGELOG.md, then I will merge this.