tidb-lightning icon indicating copy to clipboard operation
tidb-lightning copied to clipboard

Inserting non-UTF-8 data into a VARCHAR column should produce an error in strict SQL_MODE

Open kennytm opened this issue 6 years ago • 0 comments

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. 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
  1. What did you expect to see?

With the default SQL mode, the INSERT should fail with Error 1366 (incorrect utf8 value).

  1. What did you see instead?

Lightning completed successfully with zero warnings. The malformed data can be seen from SELECT * FROM issue205.a;

  1. Versions of the cluster

(Everything is master)

  1. Operation logs

  2. Configuration of the cluster and the task

  3. Screenshot/exported-PDF of Grafana dashboard or metrics' graph in Prometheus for TiDB-Lightning if possible

kennytm avatar Jul 03 '19 12:07 kennytm