-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[YSQL][backup] Backup-restore failed due to unexpected NULLABLE column attribute. #6886
Comments
Fix:
|
OlegLoginov
added a commit
that referenced
this issue
Jan 15, 2021
…NULLABLE column attribute value. Summary: YB implementation for SQL statements CREATE TABLE and ALTER TABLE ADD can set internal attribute 'nullable' differently. As result the column attributes can be different if it was created via CREATE TABLE and via ALTER TABLE ADD. It can be a reason of backup-restore failure. Changes: 1. PgAlterTable::AddColumn() should not set the 'nullable' column attribute as PgCreateTable::AddColumn() does not do it. 2. For backward compatibility backup-restore should ignore the 'nullable' column attribute to be able restoring from backups created by older releases. 3. Schema::Equals() now has a new template argument 'ColumnComparator' for flexibility in the schema comparison. Test Plan: ybd --java-test org.yb.pgsql.TestYbBackup#testAlteredYSQLTableBackupWithNotNull Jenkins: hot Reviewers: mihnea Reviewed By: mihnea Subscribers: bogdan, yql Differential Revision: https://phabricator.dev.yugabyte.com/D10365
OlegLoginov
added a commit
that referenced
this issue
Jan 15, 2021
…to unexpected NULLABLE column attribute value. Summary: YB implementation for SQL statements CREATE TABLE and ALTER TABLE ADD can set internal attribute 'nullable' differently. As result the column attributes can be different if it was created via CREATE TABLE and via ALTER TABLE ADD. It can be a reason of backup-restore failure. Changes: 1. PgAlterTable::AddColumn() should not set the 'nullable' column attribute as PgCreateTable::AddColumn() does not do it. 2. For backward compatibility backup-restore should ignore the 'nullable' column attribute to be able restoring from backups created by older releases. 3. Schema::Equals() now has a new template argument 'ColumnComparator' for flexibility in the schema comparison. Original diff: D10365 / d4b6ece Test Plan: ybd --java-test org.yb.pgsql.TestYbBackup#testAlteredYSQLTableBackupWithNotNull Jenkins: rebase: 2.4, hot Reviewers: mihnea Reviewed By: mihnea Subscribers: yql, bogdan Differential Revision: https://phabricator.dev.yugabyte.com/D10368
polarweasel
pushed a commit
to lizayugabyte/yugabyte-db
that referenced
this issue
Mar 9, 2021
…xpected NULLABLE column attribute value. Summary: YB implementation for SQL statements CREATE TABLE and ALTER TABLE ADD can set internal attribute 'nullable' differently. As result the column attributes can be different if it was created via CREATE TABLE and via ALTER TABLE ADD. It can be a reason of backup-restore failure. Changes: 1. PgAlterTable::AddColumn() should not set the 'nullable' column attribute as PgCreateTable::AddColumn() does not do it. 2. For backward compatibility backup-restore should ignore the 'nullable' column attribute to be able restoring from backups created by older releases. 3. Schema::Equals() now has a new template argument 'ColumnComparator' for flexibility in the schema comparison. Test Plan: ybd --java-test org.yb.pgsql.TestYbBackup#testAlteredYSQLTableBackupWithNotNull Jenkins: hot Reviewers: mihnea Reviewed By: mihnea Subscribers: bogdan, yql Differential Revision: https://phabricator.dev.yugabyte.com/D10365
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
YB implementation for SQL statements CREATE TABLE and ALTER TABLE ADD can set internal NULLABLE attribute differently. As result the column attributes can be different if it was created via CREATE TABLE and via ALTER TABLE ADD.
Reproducible scenario:
In the example ALTER TABLE ADD created a column with internal attribute 'NOT NULL
. But on the backup-restore step the same column is created via CREATE TABLE with attribute
NULLABLE`.The text was updated successfully, but these errors were encountered: