TRUNCATE not highlight as keyword

[expired user #6983]'s profile image [expired user #6983] posted 10 years ago in General Permalink
TRUNCATE not highlight as keyword.
Want use TRUNCATE other than DELETE to Empty Tables
ansgar's profile image ansgar posted 10 years ago Permalink
At least in the current release and also the nightly builds, TRUNCATE *is* highlighted. Only it's both a function and a keyword, and the highlighter decides for the function.

From http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html#function_truncate :

TRUNCATE(X,D)
Returns the number X, truncated to D decimal places. If D is 0, the result has no decimal point or fractional part. D can be negative to cause D digits left of the decimal point of the value X to become zero.

From http://dev.mysql.com/doc/refman/5.0/en/truncate-table.html:
TRUNCATE [TABLE] tbl_name
TRUNCATE TABLE empties a table completely. Logically, this is equivalent to a DELETE statement that deletes all rows, but there are practical differences under some circumstances.
[expired user #6983]'s profile image [expired user #6983] posted 10 years ago Permalink
when click the "Empty tabels..." context menu, AUTO_INCREMENT value not changed, but a TRUNCATE command does
ansgar's profile image ansgar posted 10 years ago Permalink
What has the "empty tables" menu item to do with the highlighter?

HeidiSQL fires a TRUNCATE <table> command when emptying tables.

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