 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
[12.1.277 Pro] - Auto delimit issues (MariaDB) |
|
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
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 |
|
 |
|
|
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
|
|
|