go-testfixtures / testfixtures

Ruby on Rails like test fixtures for Go. Write tests against a real database
https://pkg.go.dev/github.com/go-testfixtures/testfixtures/v3?tab=doc
MIT License
1.1k stars 80 forks source link

Support TiDB #180

Closed tetsumaru closed 1 month ago

tetsumaru commented 12 months ago

In my environment I get the following error when initializing test fixtures.

"You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 8 near \"CHECKSUM TABLE `sample_table`\""

It seems that TiDB does not support CHECKSUM TABLE. https://docs.pingcap.com/tidbcloud/dev-guide-third-party-tools-compatibility#tidb-does-not-support-the-check-table-statement

We avoid this problem by forking testfixtures and commenting out the "CHECKSUM TABLE" so that it is not used.

I would like to be able to use test-fixtures in TiDB without forking and commenting out.

codeit14 commented 3 months ago

I'm facing the same issue as well, would it be possible to support for it

slsyy commented 2 months ago

@codeit14 #206 is merged and released. Could you verify, if it works for you?

tetsumaru commented 1 month ago

@codeit14 @slsyy I was able to resolve this issue in my local environment with v3.12.0 by adding the following:

testfixtures.New(
    ...
    testfixtures.SkipTableChecksumComputation(),
)

Thank you.