ivospijker
ivospijker

Reputation: 732

MySQL Workbench falsely claiming I have an error in my syntax

I have a stored procedure that determines and sets the next minute to review by getting the last reviewed timestamp and then determining what the lowest timestamp is after that.

The thing that bothers me about this is that while it works perfectly (so far), but MySQL workbench claims that I have 2 syntax errors:

CREATE DEFINER=`forex`@`%` PROCEDURE `set_next_minute`()
BEGIN
    SET @next_minute = (
        SELECT FLOOR(timestamp/60000) * 60
        FROM tick 
        WHERE timestamp > (
            (SELECT value 
            FROM setting 
            WHERE name = 'next_minute')
            + 60) * 1000 
        ORDER BY timestamp 
        LIMIT 1);
    UPDATE setting 
    SET value = @next_minute 
    WHERE name = 'next_minute';
END
  1. WHERE name = 'next_minute') missing 'closing parenthesis'
  2. + 60) * 1000 missing 'semicolon'

Upvotes: 0

Views: 297

Answers (1)

Mike Lischke
Mike Lischke

Reputation: 53335

The funnier of these is that it says for the closing parenthesis it expects a closing parenthesis :-).

This is certainly a parser error and needs to be addressed. Can you file a bug report at http://bugs.mysql.com?

Upvotes: 1

Related Questions