This repository has been archived by the owner on Dec 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
backend: dynamically calculate the maximum auto-inc ID (#227)
This makes sure the final AUTO_INCREMENT value is exactly the maximum value of the auto-inc column. Fix #222.
- Loading branch information
Showing
12 changed files
with
98 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[lightning] | ||
file = "/tmp/lightning_test_result/lightning.log" | ||
|
||
[tikv-importer] | ||
addr = "127.0.0.1:8808" | ||
|
||
[mydumper] | ||
data-source-dir = "tests/tool_1472/data" | ||
|
||
[tidb] | ||
host = "127.0.0.1" | ||
port = 4000 | ||
user = "root" | ||
status-port = 10080 | ||
pd-addr = "127.0.0.1:2379" | ||
log-level = "error" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
create database `EE1472`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
create table `notpk` ( | ||
a int primary key, | ||
b tinyint auto_increment, | ||
key(a) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
insert into `notpk` values (1111, 6); | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
insert into `notpk` values (2222, 9); | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
create table `pk` ( | ||
a tinyint primary key auto_increment | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
insert into `pk` values (3); | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
insert into `pk` values (4); | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. | ||
-- include some comments to inflate the file size. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/sh | ||
# | ||
# Copyright 2019 PingCAP, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# This test verifies if TOOL-1420 is fixed. | ||
# It involves column names not in lower-case. | ||
|
||
set -eu | ||
|
||
run_sql 'drop database if exists EE1472;' | ||
run_lightning | ||
|
||
run_sql 'insert into EE1472.pk values ();' | ||
run_sql 'select count(a), max(a) from EE1472.pk;' | ||
check_contains 'count(a): 3' | ||
check_contains 'max(a): 5' | ||
|
||
run_sql 'insert into EE1472.notpk (a) values (3333);' | ||
run_sql 'select b from EE1472.notpk where a = 3333;' | ||
check_contains 'b: 10' |