Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

User Manager not working on MySQL 4.x

[expired user]'s profile image [expired user] posted 12 years ago in General Permalink
Hi,
the SQL-queries
GRANT SELECT ON TABLE `database`.`table` TO 'user'@'host';
REVOKE SELECT ON TABLE `database`.`table` FROM 'user'@'host';
which are used by the user manager, results in a syntax errors on MySQL 4.x databases. The correct syntax for 4.x is:
GRANT SELECT ON `database`.`table` TO 'user'@'host';
REVOKE SELECT ON `databse`.`table` FROM 'user'@'host';

MySQL 5.x Server understand both, with and without "TABLE".
The MySQL 5.x doc says:
GRANT
priv_type [(column_list)]
[, priv_type [(column_list)]] ...
ON [object_type] priv_level ...
where [object_type] is optional and can be one of TABLE|FUNCTION|PROCEDURE

I think, the object_type is only needed, if there is a table and a function/procedure of same name (?)

Could you please support MySQL 4.x in the user manager ?
Thanks
Plasm
ansgar's profile image ansgar posted 12 years ago Permalink
Sure. Solution will be something like that:
if ServerVersion > 40100 then ... + objectType + ...
Code modification/commit from ansgar.becker, 12 years ago, revision 3688
Servers up to 5.0.6 do not support the object type in a GRANT or REVOKE query. See http://www.heidisql.com/forum.php?t=7753
ansgar's profile image ansgar posted 12 years ago Permalink
Fixed in r3688
[expired user]'s profile image [expired user] posted 12 years ago Permalink
Thx a lot

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




Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.