Aqua Data Studio 15.0.0-dev-329
Build #: 38608
Built on: 2014-Jun-18 05:52:13 PM
Operating Environment : Windows, Linux
Issue : In MySQL, In Schema Script Generator, object qualifying name is not generated for “Table/Views/Procedure/Function”.
Steps to Reproduce :
1.In ADS, connect to MySQL 5.7.4 Database, expand it
2.Go to Databases node, right click and select option “Tools->Schema Script Generator”
3. In “Schema Script Generator” window,
i)Check objects “Table/Views/Procedure/Function” from Objects Types pane.
ii)Then check any “Table/Views/Procedure/Function” from Objects pane.
iii)Click on “Next” button
4.In Options tab,
i)Select “Preview Tab” from “Save as” drop down
ii)Check option “Generate the CREATE”
iii)Check option “Qualify Objects”
iv)Click on Next button
5.In preview tab, we can see that qualifying objects are missing in script. In MySQL it should show database name before table/view..etc name.
6. Whereas, for Triggers it shows qualifying name successfully. It shows database name before trigger name.
(Follow same steps, just select “Triggers” instead of “Table/Views/Procedure/Function”)
7.If we create (“Table/Views/Procedure/Function”) in query analyser then it takes database name before these objects and it runs also.
|
222 KB
|
86 KB
|
273 KB
|
134 KB
|
176 KB
|
178 KB
|
287 KB
|
121 KB
![]() |
3 KB
|
121 KB
In MySQL qualifying objects are missing in script for Indexes and Events.
@Sachin Sir,
This issue has not been addressed yet. But for Schema sync, as the query analyzer is opened with target database we do not face any issues.
@Sachin Sir,
This issue has not been addressed yet. But for Schema sync, as the query analyzer is opened with target database we do not face any issues.
I have made the needed changes so that the objects are qualified with there schema field now. The schema field was never stored until v19. For compare, objects will never qualify with schema for mysql. Database & Schema are synonyms, but in the compare dialog the user will not have a list of schemas to choose from, but instead will have the <All Schemas> selected.
@Tariq : I have tested this with all objects. The schema qualification will only be done for versions 5.0 and above, so no need to test before that version. We need a full regression test scripting objects for this.
Committed revision: 54812
I have made the needed changes so that the objects are qualified with there schema field now. The schema field was never stored until v19. For compare, objects will never qualify with schema for mysql. Database & Schema are synonyms, but in the compare dialog the user will not have a list of schemas to choose from, but instead will have the <All Schemas> selected.
@Tariq : I have tested this with all objects. The schema qualification will only be done for versions 5.0 and above, so no need to test before that version. We need a full regression test scripting objects for this.
Committed revision: 54812
Table, view, procedure, function and trigger dialog code has been modified to handle this correctly now. There is no GUI for event objects. Modifications made to the scripting of triggers so that qualify object flag will also be taken into account when scripting its target object. Code checked into US trunk with Committed revision: 54829
Table, view, procedure, function and trigger dialog code has been modified to handle this correctly now. There is no GUI for event objects. Modifications made to the scripting of triggers so that qualify object flag will also be taken into account when scripting its target object. Code checked into US trunk with Committed revision: 54829
I tested the Database Schema and Data Exporter project to make sure that the objects in the ddl were getting qualified correctly when "Script Qualify Object" is checked and unchecked. This is working correctly. Additionally, I tested the ddl extraction before and after the fix and now all the objects are getting qualified when "Script Qualify Object" is checked. I tested this with MySQL 5.1, 5.5, 5.6 and 5.7.
I tested the Database Schema and Data Exporter project to make sure that the objects in the ddl were getting qualified correctly when "Script Qualify Object" is checked and unchecked. This is working correctly. Additionally, I tested the ddl extraction before and after the fix and now all the objects are getting qualified when "Script Qualify Object" is checked. I tested this with MySQL 5.1, 5.5, 5.6 and 5.7.
CREATE TABLE `view_dep_table_01` ( `Id` int(11) NOT NULL, `Eid` integer(11) NOT NULL, `Name` text NULL ) GO CREATE VIEW `view_dep_table_02` AS SELECT `Id`, `Eid`, `Name` FROM `view_dep_table_01` GO
CREATE TABLE `view_dep_table_01` ( `Id` int(11) NOT NULL, `Eid` integer(11) NOT NULL, `Name` text NULL ) GO CREATE VIEW `view_dep_table_02` AS SELECT `Id`, `Eid`, `Name` FROM `view_dep_table_01` GO
The code changes made in SVN 54812 and 54829 have caused regression issues. I've reverted those code changes. The problem reported in this comment should now be fixed.
I'm resetting this issue to New to look into the original problem reported in the issue description.
The code changes made in SVN 54812 and 54829 have caused regression issues. I've reverted those code changes. The problem reported in this comment should now be fixed.
I'm resetting this issue to New to look into the original problem reported in the issue description.
Refer to issue VA:#9586. Trigger names are no longer qualified with the database name in v19.
Refer to issue VA:#9586. Trigger names are no longer qualified with the database name in v19.
5.In preview tab, we can see that qualifying objects are missing in script. In MySQL it should show database name before table/view..etc name.
Checking ADS code from previous releases, we intentionally make separate code paths for MySQL to not include database or schema name even when the qualify object flag is on. See AFBaseDBObject.getQualifiedName.
This is expected behavior. Won't Fix.
6. Whereas, for Triggers it shows qualifying name successfully. It shows database name before trigger name.
In v19, we've already fixed the scripting code for Trigger such that the database name is no longer included. All scripting code is now consistent for MySQL.
5.In preview tab, we can see that qualifying objects are missing in script. In MySQL it should show database name before table/view..etc name.
Checking ADS code from previous releases, we intentionally make separate code paths for MySQL to not include database or schema name even when the qualify object flag is on. See AFBaseDBObject.getQualifiedName.
This is expected behavior. Won't Fix.
6. Whereas, for Triggers it shows qualifying name successfully. It shows database name before trigger name.
In v19, we've already fixed the scripting code for Trigger such that the database name is no longer included. All scripting code is now consistent for MySQL.
Resolution for main issue description: Won't Fix
Resolution for highlighted scenario in this comment: Fixed in beta-28
Resolution for main issue description: Won't Fix
Resolution for highlighted scenario in this comment: Fixed in beta-28
Verified above-highlighted scenario in ADS 19.0.0-beta-28. The issue is no longer reproduced.(issue_closed_2nd_12283.png)
Verified above-highlighted scenario in ADS 19.0.0-beta-28. The issue is no longer reproduced.(issue_closed_2nd_12283.png)
Issue #12283 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build ADS 19.0.0-beta-28 |
No time estimate |
2 issue links |
is a duplicate of #15339
Issue #15339Unable to create table through Create Table GUI |
breaks #15347
Issue #15347Table Data Editor : Script fails due to Qualified object name scripted twice. |
In MySQL qualifying objects are missing in script for Indexes and Events.