SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[12.1.277 Pro] - Auto delimit issues (MariaDB)

Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[12.1.277 Pro] - Auto delimit issues (MariaDB)
Author Message

Joined: 11 Mar 2010
Posts: 2114

Post [12.1.277 Pro] - Auto delimit issues (MariaDB) Reply with quote
Let's suppose me being extraordinarily lenient and stop cursing after just a few minutes regarding MariaDB amply sprinkling the retrieved definition with absolutely unnecessary and unwanted parentheses while generously removing any AS keywords from the table aliases which instantly ruins alias alignment and watch this not-so-short video here, please (fast-forward to 00:55 to miss all the cussing part).

What you can see (after I restore the missing parts MariaDB removed, and remove all the garbage MariaDB put in, shame on you, MariaDB) is that all the table aliases in the FROM part are delimited. That's not something I usually do on purpose (and the auto delimit feature of SA doesn't do it either), but I don't think that should break anything. But here it has a special kind of side-effect. I removed the delimiter from one of that aliases (just out of curiosity) and noticed that when selecting a column from the popup, those being from a table that has no delimiters will be inserted correctly. However, those having their table alias delimited will insert a bad kind of delimiter (the ones SQL Server uses) for their alias.
Tue Apr 26, 2022 10:16 am View user's profile Send private message
Site Admin

Joined: 26 Nov 2006
Posts: 7859

Post Reply with quote
While I can't explain yet why you get there T-SQL delimiters instead of MariaDB delimiters, I would like to suggest an alternative method if not a solution to the issue at hand, avoiding spending time on reconstructing the original create view query. If you're running 12.1, instead of using "edit" macro, hit Alt+F12 to open the History pane, and start typing the view name. It will find for you the original query you executed. Note, if it was executed in 12.1 within last 30 days. That doesn't apply to all situations, and certainly doesn't help with code somebody else executed to create that view, but in combination with other methods it may help with better productivity. If you feel like retrieving longer code history doesn't slow down your system, you can change default 30 days settings to a longer retention period.
Tue Apr 26, 2022 11:09 am View user's profile Send private message

Joined: 11 Mar 2010
Posts: 2114

Post Reply with quote
This was an edge case. I used the view as an example because in this case, MariaDB does not rely on the developer to screw up the code, it gladly wrecks it in the developer's stead. We are "strongly encouraged" not to make any changes bypassing the versioned deployment scripts, which have all the object definitions in a properly formatted state, so I rarely fall back to this method of retrieving definitions nowadays. I'm only doing it when the deployment script is either not available or when I have to quickly check if there was any undocumented tampering with the object. That view is nearing the legal age of consuming alcohol in most countries around the world :) Its original is long lost (if there was any of it saved).

Anyhow, thanks for the hint, I'm a frequent visitor to both the History and the Recent Documents. I'm quite forgetful, so those two would definitely be worth their weight in gold if they weighed anything at all.
Tue Apr 26, 2022 12:58 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.