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

[MySQL] Import data fails while migrating the table with name same as system table in target #757

Closed
priyanshi-yb opened this issue Jan 25, 2023 · 0 comments
Labels
triage Needs to be triaged

Comments

@priyanshi-yb
Copy link
Contributor

priyanshi-yb commented Jan 25, 2023

Import data fails while migrating the table with name same as system table as datafile has that name only and all other places that name is with quotes.
ex- user table is the system table in the PG/YB for storing user info and hence cann't be used table_name.

Example on MySQL:

Source schema -

create table user(id int, col text);
insert into user values(1,'Test');
insert into user values(2,'Test');
insert into user values(3,'Test');
insert into user values(4,'Test');

Export schema in table.sql -

CREATE TABLE "user" (
	id bigint,
	col text
) ;

Exported data in datafile which is named as - user_data.sql, as can be seen the table_name in the content of the file is also with quotes.

SET client_encoding TO 'UTF8';
COPY "user" (id,col) FROM STDIN;
1	Test
2	Test
3	Test
4	Test
\.

Import schema went fine but import data fails with message-

Following tables are not empty. TRUNCATE them before importing data with --start-clean.
user
@github-actions github-actions bot added the triage Needs to be triaged label Jan 25, 2023
sanyamsinghal pushed a commit that referenced this issue Feb 24, 2023
…reSQL) tables having same name as system table in target
sanyamsinghal added a commit that referenced this issue Feb 27, 2023
…reSQL) tables having same name as system table in target (#775)

* Removed manual editing step of renaming data files for pg-hasura-ecommerce test case

* Added a reserved keywords test case for MySQL

* Updated oracle ora-trunc-tests test case to verify if orafce extension installed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants