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

fix generated column check in information_schema extra field #29

Merged
merged 2 commits into from
Jun 18, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix generated column match regex
amyangfei committed Jun 14, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 54db9e9cc81310477779dfd51b6b9b7f09273bd1
4 changes: 2 additions & 2 deletions mydumper.c
Original file line number Diff line number Diff line change
@@ -1796,7 +1796,7 @@ MYSQL_STMT *execute_detect_fields_stmt(MYSQL *conn, char *database, char *table,
}

gboolean detect_generated_fields(MYSQL *conn, char *database, char *table){
const char* query = "select 1 from information_schema.COLUMNS where TABLE_SCHEMA=? and TABLE_NAME=? and extra REGEXP 'STORED|VIRTUAL GENERATED'";
const char* query = "select 1 from information_schema.COLUMNS where TABLE_SCHEMA=? and TABLE_NAME=? and extra REGEXP '(STORED|VIRTUAL) GENERATED'";
MYSQL_STMT *stmt = execute_detect_fields_stmt(conn, database, table, query);
if (!stmt) {
return FALSE;
@@ -1861,7 +1861,7 @@ void append_escaped_identifier(GString *str, const gchar *identifier) {
}

GString * get_insertable_fields(MYSQL *conn, char *database, char *table){
const char* query = "select COLUMN_NAME from information_schema.COLUMNS where TABLE_SCHEMA=? and TABLE_NAME=? and extra NOT REGEXP 'STORED|VIRTUAL GENERATED'";
const char* query = "select COLUMN_NAME from information_schema.COLUMNS where TABLE_SCHEMA=? and TABLE_NAME=? and extra NOT REGEXP '(STORED|VIRTUAL) GENERATED'";
MYSQL_STMT *stmt = execute_detect_fields_stmt(conn, database, table, query);
if (!stmt) {
return NULL;