Skip to content
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

LOCK TABLES does not warn/error when unsupported #10194

Closed
morgo opened this issue Apr 18, 2019 · 3 comments
Closed

LOCK TABLES does not warn/error when unsupported #10194

morgo opened this issue Apr 18, 2019 · 3 comments

Comments

@morgo
Copy link
Contributor

morgo commented Apr 18, 2019

Feature Request

Is your feature request related to a problem? Please describe:

The table t1 exists, the other table does not:

mysql> LOCK TABLES t1 WRITE;
Query OK, 0 rows affected (0.00 sec)

mysql> LOCK TABLES idontexist WRITE;
Query OK, 0 rows affected (0.00 sec)

In either case, this command is a noop in TiDB, which is unsafe, and breaks a contract with user expectations.

Describe the feature you'd like:

FR 1: This statement should produce an error if the table does not exist.

Option 1: Produce an error (since FLUSH TABLES WITH READ LOCK already errors). This means that mysqldump can no longer restore! This could be addressed via a compatibility mode similar to #10065 will when set downgrades the error to a warning.

Option 2: Produce a warning. This means that a compatibility mode is required. Or alternatively, the compatibility mode could exist but have a different default value to #10065 (default ON).

Option 3: Do nothing. LOCK TABLES as a feature is planned, so we could also consider doing nothing for the interim.

Describe alternatives you've considered:

I lean towards option 2, simply because I think backup restore-ability out of the box is paramount. I could be convinced otherwise.

Teachability, Documentation, Adoption, Migration Strategy:

If a compatibility mode is chosen, the error message should say the mode name. This will help users discover the problem.

@winkyao
Copy link
Contributor

winkyao commented Apr 19, 2019

@morgo we are designing the Lock tables and is going to finish the development in the next month. So Do we still need to return a warning for that?

@morgo
Copy link
Contributor Author

morgo commented Apr 22, 2019

@winkyao If it is one month ago, that is option #3. I think its the best choice, assuming it makes TiDB 3.0.

@winkyao
Copy link
Contributor

winkyao commented Jul 23, 2019

Table Lock is supported in this PR #10343, so I close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants