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
Option to Perform ALTER ONLINE (or ALGORITHM=INPLACE) #15312
Comments
Fixes phpmyadmin#15312 Signed-off-by: Kartik Kathuria <kathuriakartik0@gmail.com>
|
Isn’t INPLACE the default, according to
https://dev.mysql.com/doc/refman/8.0/en/alter-table.html ?
I’m not particularly against implementing this, I just am not sure that
it’s needed.
|
|
@ibennetch the PR #15420 adds an option for 'ONLINE' only |
Fixes phpmyadmin#15312 Signed-off-by: Kartik Kathuria <kathuriakartik0@gmail.com>
Fixes phpmyadmin#15312 Signed-off-by: Kartik Kathuria <kathuriakartik0@gmail.com>
|
Thank you @kartik1000 for implementing this feature |
|
OMG - this!!! Just one thing - I believe that ALTER ONLINE is MariaDB specific. Unless I'm wrong? |
I found it in the MySQL docs https://dev.mysql.com/doc/refman/8.0/en/alter-table.html so I do not think it is specific at all :) |
|
I did a search in that page for "ONLINE", but I don't see it as part of the syntax. Also, I tried in phpMyAdmin Demo with MySQL, I got:
|
|
Indeed, I did read the docs too quicky So for MySQL and MariaDB we need to use https://dev.mysql.com/doc/refman/5.7/en/innodb-online-ddl.html https://mariadb.com/kb/en/alter-table/#algorithminplace seems to be a more compatible method |
|
Does Algorithm = Inplace works for both MariaDB and MySQL? Or we need to use different syntax on the basis of server? |
|
@kartik1000 @williamdes Should work for both. Thank you! |
Signed-off-by: William Desportes <williamdes@wdes.fr>

When editing the structure of a table, it would be nice to have an option next to the "Preview SQL" button to try an Online Transaction.
This would perform the ALTER TABLE with either:
ALTER ONLINE or ALGORITHM=INPLACE
Many times, I want to try to see if I can make a change in the database without locking the table. I could simply select this option and try. If it gives an error saying it's not possible to perform online, then I can try again when the traffic is low.
At the moment, the way I do it is by doing "Preview SQL", copy the generated SQL, and add the word "ONLINE" to it, and try the SQL manually.
Having this checkbox would be a nice feature to avoid these extra steps :)
Thank you.
The text was updated successfully, but these errors were encountered: