* Added test case * ddl fix #38669. The issue was that mysql.tidb_ddl_reorg table was updated by an inner transaction after the outer transaction started, which then made a commit conflict in the outer transaction, when it deleted the same row. * Fixed typo in comment * Added test case for #24427 * Disabled tests for CI testing * Revert "Disabled tests for CI testing" This reverts commit 17c28f30ba8802c578fed5653107aa6995e17607. * Revert "Revert "Disabled tests for CI testing"" This reverts commit 65c84d94f7ab4440c739703312f5329619c6ccdc. * removed test skips * Clean up the tidb_ddl_reorg entry after DDL is completed * Use a cleanup job afterwards instead. * Fixed test * Moved cleanup before asyncNotify * More detailed test failure log * Refined test error message * Injecting timoeut to get stack traces from CI * Updated Debug Dump on timeout * Delete mulitple entries in tidb_ddl_reorg if needed * Linting * Linting * Added CI debug logs * Linting + CI debugs * fixed CI debug * Try to cleanup also if job.State == synced * check for non-error of runErr instead of error... * Use a new session, instead of reusing worker.sess * Also handle case when job == nil * Removed CI debug logs * Misssed change session from w.sess to newly created sess * Improved TestConcurrentDDLSwitch and added CI debug logs * Always cleaning up all orphan mysql.tidb_ddl_reorg entries * linting * Also cleanup if job is nil * Updated TestModifyColumnReorgInfo + CI debug logs * more CI debug * refactored the cleanupDDLReorgHandle code * Added missing cleanup in handleDDLJobQueue * Removed debug panic * Code cleanup * Test updates * Debug cleanup * Cleaned up test after removal of old non-concurrent DDL code merge * Linting * always wrap changes to tidb_ddl_reorg in an own transaction + fixed some typos * Minimum fix * Always update reorg meta, not only on error * Issue is here :) * Fixed newReorgHandler * Wrapped more tidb_ddl_reorg changes into separate transactions * linting * Removed updateDDLReorgStartHandle * cleanups * Made runInTxn a method on *session, instead of normal function * Update test * Final touches * Removed duplicate test * CleanupDDLReorgHandles should only be called from HandleJobDone. * Variable rename * Renamed 'delete' variabel name * Updated test * small revert * Removed timeout debugging code * Simplified the cleanup to only start a new txn and not a new session * Reverted the change of GetDDLInfo Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Parser - A MySQL Compatible SQL Parser
The goal of this project is to build a Golang parser that is fully compatible with MySQL syntax, easy to extend, and high performance. Currently, features supported by parser are as follows:
- Highly compatible with MySQL: it supports almost all features of MySQL. For the complete details, see parser.y and hintparser.y.
- Extensible: adding a new syntax requires only a few lines of Yacc and Golang code changes. As an example, see PR-680.
- Good performance: the parser is generated by goyacc in a bottom-up approach. It is efficient to build an AST tree with a state machine.
How to use it
Please read the quickstart.
Future
- Support more MySQL syntax
- Optimize the code structure, make it easier to extend
- Improve performance and benchmark
- Improve the quality of code and comments
Getting Help
If you have any questions, feel free to discuss in sig-ddl. Here are the steps to join:
- Join TiDB Slack community, and then
- Join sig-ddl Slack channel.
If you want to join as a special interest group member, see DDL Special Interest Group.
Users
These projects use this parser. Please feel free to extend this list if you found you are one of the users but not listed here:
Contributing
Contributions are welcomed and greatly appreciated. See Contribution Guide for details on submitting patches and the contribution workflow.
Acknowledgments
Thanks cznic for providing some great open-source tools.
License
Parser is under the Apache 2.0 license. See the LICENSE file for details.