Backticks in table editor

kalvaro's profile image kalvaro posted 13 years ago in General Permalink
HeidiSQL has successfully removed redundant backticks from almost all places, but they remain in the "CREATE code" and "ALTER code" tabs:

ALTER TABLE `contact`
ADD COLUMN `var_number` VARCHAR(20) NULL DEFAULT NULL AFTER `contact_name`;


Would it be feasible to get rid of those as well?
ansgar's profile image ansgar posted 13 years ago Permalink
Oh they remain in more than these two places - they're just removed in the query tab features. But probably you're right - why not remove useless and annoying backticks wherever they touch the users eye.
Code modification/commit from ansgar.becker, 13 years ago, revision 6.0.0.3938
Remove redundant backticks in table editors CREATE and ALTER code. See http://www.heidisql.com/forum.php?t=9056
ansgar's profile image ansgar posted 13 years ago Permalink
Done in r3938
kalvaro's profile image kalvaro posted 13 years ago Permalink
Superb! Thanks a lot. I hadn't fully realised how much it hate backticks until they've vanished.
ansgar's profile image ansgar posted 13 years ago Permalink
Indeed. Well at least they made the backticks optionally.
Rapid-eraser's profile image Rapid-eraser posted 13 years ago Permalink
I kinda like backticks unhappy
Makes code more clear for me... I'll keep filling them my self :)
charlretief's profile image charlretief posted 13 years ago Permalink
I am with Rapid-eraser on this one. I write all my MySQL code with back-ticks in my MySQL sources. (As I have already stated in an earlier post).

I get it that alot of developers don`t like the back-ticks, but some of us do.

1) It makes it easier to read (for some of us)
2) and more robust vs future MySQL version updates that add new restricted keywords. How will you keep up with the new keywords introduced in v6 or 7 or 8 of MySQL [EX in MySQL 5.5 the following new words are now restricted (GENERAL; IGNORE_SERVER_IDS; MASTER_HEARTBEAT_PERIOD; MAXVALUE; RESIGNAL; SIGNAL; SLOW)]?
3) How about other servers like Percona or MariaDB that might add their own restricted keywords?

I am not saying this is a bad feature, but please make it configurable in the application preferences to always use back-ticks in sql.

charlretief's profile image charlretief posted 13 years ago Permalink
OK, sorry i was stupid with questions 2 and 3.
You probably just execute "SET SQL_QUOTE_SHOW_CREATE = 0;" in the background and let the server handle the necessary quoting.surprised

But my concerns are also for robustness vs future updates for the the 50000+ lines of sql code I have in stored routines. I don't take any chances with not having back-ticks in these routines for the reasons 2 and 3 states above.
ansgar's profile image ansgar posted 13 years ago Permalink
I broke the "copy columns" feature as I removed optional backticks in CREATE and ALTER tabs. ParseTableStructure requires backticks or doublequotes around column names. Not a problem until generated CREATE code was reused in that "copy columns" feature. I will revert r3938 so backticks in both tabs will reappear, to fix issue #2540.

Please login to leave a reply, or register at first.