tidb-lightning
tidb-lightning copied to clipboard
Inserting non-UTF-8 data into a VARCHAR column should produce an error in strict SQL_MODE
Bug Report
Please answer these questions before submitting your issue. Thanks!
- What did you do? If possible, provide a recipe for reproducing the error.
With this schema:
CREATE DATABASE issue205;
CREATE TABLE issue205.a (b VARCHAR(256) CHARACTER SET 'utf8mb4');
and some non-UTF-8 CSV content (issue205.a.csv)
head -c 15 /dev/urandom > issue205.a.csv
with configuration
[tikv-importer]
addr = '127.0.0.1:8808'
[tidb]
host = '127.0.0.1'
port = 4000
user = 'root'
status-port = 10080
[mydumper]
data-source-dir = /«path»
no-schema = true
[post-restore]
checksum = true
analyze = true
- What did you expect to see?
With the default SQL mode, the INSERT should fail with Error 1366 (incorrect utf8 value).
- What did you see instead?
Lightning completed successfully with zero warnings. The malformed data can be seen from SELECT * FROM issue205.a;
- Versions of the cluster
(Everything is master)
-
Operation logs
-
Configuration of the cluster and the task
-
Screenshot/exported-PDF of Grafana dashboard or metrics' graph in Prometheus for TiDB-Lightning if possible