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

Exporting a view broken in 1.1.2 #3322

Open
joshstrike opened this Issue Nov 30, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@joshstrike

joshstrike commented Nov 30, 2018

This seems to be a bug that cropped up in the exporter back in 2013
#707

But in 1.1.2, I just stumbled across the same thing happening. Views are exported with a CREATE TABLE instead of CREATE VIEW.

@dmoagx

This comment has been minimized.

Member

dmoagx commented Nov 30, 2018

Sequel Pro exports will always create a dummy table first and at the end of the export replace it with the actual view because of possible dependency issues.
Perhaps you are looking at the wrong statement?

@joshstrike

This comment has been minimized.

joshstrike commented Nov 30, 2018

Ah, I see. That wasn't the problem with the export Sequel Pro was producing. There was something else. When a view column is the sum of FLOAT(11,2) types, Sequel Pro is rendering it as DOUBLE(19), which MySQL rejects.

This is reproducible:

CREATE TABLE `unit` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `price` float(11,2) NOT NULL DEFAULT '0.00',
  `tax` float(11,2) NOT NULL DEFAULT '0.00',
PRIMARY KEY (`id`)
) ENGINE=MyISAM

CREATE VIEW test AS SELECT unit.id, price AS tot FROM unit;
Sequel Pro exports price to the placeholder test table as a float

CREATE VIEW test AS SELECT unit.id, price+tax AS tot FROM unit;
Sequel Pro exports tot as a double

@dmoagx

This comment has been minimized.

Member

dmoagx commented Dec 1, 2018

That is most likely a duplicate of #2927

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment