diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc3a8db9..f98689d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 <{'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"), diff --git a/t/55utf8.t b/t/55utf8.t index 6394b03c..29df37e0 100644 --- a/t/55utf8.t +++ b/t/55utf8.t @@ -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) { diff --git a/t/55utf8_errors.t b/t/55utf8_errors.t index 5eb9d276..dd2c69ad 100644 --- a/t/55utf8_errors.t +++ b/t/55utf8_errors.t @@ -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; diff --git a/t/80procs.t b/t/80procs.t index ad21071d..4eb356f5 100644 --- a/t/80procs.t +++ b/t/80procs.t @@ -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."; diff --git a/t/81procs.t b/t/81procs.t index 91094756..d169767c 100644 --- a/t/81procs.t +++ b/t/81procs.t @@ -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."; diff --git a/t/rt118977-zerofill.t b/t/rt118977-zerofill.t index 27ba1b7f..c55aa3ef 100644 --- a/t/rt118977-zerofill.t +++ b/t/rt118977-zerofill.t @@ -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) { diff --git a/t/rt75353-innodb-lock-timeout.t b/t/rt75353-innodb-lock-timeout.t index 9c97d60f..0ad9d06d 100644 --- a/t/rt75353-innodb-lock-timeout.t +++ b/t/rt75353-innodb-lock-timeout.t @@ -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;