Skip to content

CI: test against TiDB #474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,39 @@ jobs:
make
- name: "Run test"
run: make test

test-tidb:
runs-on: 'ubuntu-latest'
services:
mariadb:
image: 'pingcap/tidb:v8.5.1'
ports:
- 4000:4000
steps:
- uses: actions/checkout@v4
- name: "Setup generic dependencies"
run: |
sudo apt update
sudo apt install -y \
gcc \
gnupg \
libdbi-perl \
libdevel-checklib-perl \
libtest-deep-perl \
libtest-pod-perl \
lsb-release \
make \
wget
sudo debconf-set-selections <<EOF
mysql-apt-config mysql-apt-config/select-server select mysql-8.4-lts
EOF
wget https://dev.mysql.com/get/mysql-apt-config_0.8.33-1_all.deb
DEBIAN_FRONTEND="noninteractive" sudo dpkg -i mysql-apt-config_0.8.33-1_all.deb
sudo apt update
sudo apt install -y libmysqlclient-dev
- name: "Run build"
run: |
perl Makefile.PL --testhost=127.0.0.1 --testuser=root --testport=4000
make
- name: "Run test"
run: make test
7 changes: 7 additions & 0 deletions t/51bind_type_guessing.t
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ if ($dbh->{'mysql_serverinfo'} =~ 'MariaDB') {
plan skip_all => "This test isn't made to work with MariaDB yet";
}

# Tested with TiDB v8.5.1.
# https://github.com/pingcap/tidb/issues/60671
if ($dbh->{'mysql_serverinfo'} =~ 'TiDB') {
plan skip_all =>
"SKIP TEST: test disabled on TiDB";
}

plan tests => 98;

ok $dbh->do("DROP TABLE IF EXISTS dbd_mysql_t51bind_type_guessing"),
Expand Down
7 changes: 7 additions & 0 deletions t/55utf8.t
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ if ($dbh->{mysql_serverversion} < 50000) {
plan skip_all =>
"SKIP TEST: You must have MySQL version 5.0 and greater for this test to run";
}

# Tested with TiDB v8.5.1.
if ($dbh->{'mysql_serverinfo'} =~ 'TiDB') {
plan skip_all =>
"SKIP TEST: TiDB doesn't support GEOMETRY data type";
}

plan tests => 16 * 2;

for my $mysql_server_prepare (0, 1) {
Expand Down
7 changes: 7 additions & 0 deletions t/55utf8_errors.t
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ eval {
if ($@) {
plan skip_all => "no database connection";
}

# Tested with TiDB v8.5.1.
if ($dbh->{'mysql_serverinfo'} =~ 'TiDB') {
plan skip_all =>
"SKIP TEST: lc_messages not supported on TiDB";
}

$dbh->disconnect();

plan tests => 10 * 3;
Expand Down
6 changes: 6 additions & 0 deletions t/80procs.t
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ if ($dbh->{mysql_serverversion} < 50000) {
"You must have MySQL version 5.0 and greater for this test to run";
}

# Tested with TiDB v8.5.1.
if ($dbh->{'mysql_serverinfo'} =~ 'TiDB') {
plan skip_all =>
"SKIP TEST: TiDB doesn't support stored procedures";
}

if (!CheckRoutinePerms($dbh)) {
plan skip_all =>
"Your test user does not have ALTER_ROUTINE privileges.";
Expand Down
6 changes: 6 additions & 0 deletions t/81procs.t
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ if ($dbh->{mysql_serverversion} < 50000) {
"You must have MySQL version 5.0 and greater for this test to run";
}

# Tested with TiDB v8.5.1.
if ($dbh->{'mysql_serverinfo'} =~ 'TiDB') {
plan skip_all =>
"SKIP TEST: TiDB doesn't support stored procedures";
}

if (!CheckRoutinePerms($dbh)) {
plan skip_all =>
"Your test user does not have ALTER_ROUTINE privileges.";
Expand Down
7 changes: 7 additions & 0 deletions t/rt118977-zerofill.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ require "t/lib.pl";
my $dbh = eval { DBI->connect($test_dsn, $test_user, $test_password, { PrintError => 1, RaiseError => 1 }) };
plan skip_all => "no database connection" if $@ or not $dbh;

# Tested with TiDB v8.5.1.
if ($dbh->{'mysql_serverinfo'} =~ 'TiDB') {
plan skip_all =>
# https://docs.pingcap.com/tidb/stable/mysql-compatibility/#incompatibility-due-to-deprecated-features
"SKIP TEST: TiDB doesn't support ZEROFILL";
}

plan tests => 4*2;

for my $mysql_server_prepare (0, 1) {
Expand Down
6 changes: 6 additions & 0 deletions t/rt75353-innodb-lock-timeout.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ require "t/lib.pl";
my $dbh1 = eval { DBI->connect($test_dsn, $test_user, $test_password, { RaiseError => 1, AutoCommit => 0 }) };
plan skip_all => "no database connection" if $@ or not $dbh1;

if ($dbh1->{'mysql_serverinfo'} =~ 'TiDB') {
plan skip_all =>
# https://docs.pingcap.com/tidb/stable/pessimistic-transaction/#difference-with-mysql-innodb
"SKIP TEST: locking behavior on TiDB is different";
}

my $dbh2 = eval { DBI->connect($test_dsn, $test_user, $test_password, { RaiseError => 1, AutoCommit => 0 }) };
plan skip_all => "no database connection" if $@ or not $dbh2;

Expand Down