MediaWiki/Parser46

From Nick Jenkins
Jump to: navigation, search

Input:

curl --silent --include \
 -F 'limit'='-200'\
 -F 'go'='first'\
 -F 'dir'='prev'\
 -F 'diff'='+1'\
 -F 'oldid'='prev'\
 '192.168.0.64/wiki/index.php?title=Main_Page&action=history' > /dev/null

Causes this SQL error on r14758:

Wed Jun 14 18:04:54 EST 2006    bling   PageHistory::getLastOffsetForPaging     localhost       1064    
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-200' at line 1 (localhost)
 SELECT  rev_timestamp  FROM `revision`  WHERE rev_page=1  ORDER BY rev_timestamp ASC  LIMIT -200

(i.e. whinges about the negative LIMIT statement).

There's also another variant of this, which causes this error:

Wed Jun 14 17:43:02 EST 2006    bling   PageHistory::fetchRevisions     localhost       1064    
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 1 (localhost)
SELECT  rev_id,rev_page,rev_text_id,rev_user,rev_comment,rev_user_text,rev_timestamp,rev_minor_edit,rev_deleted  
FROM `revision` FORCE INDEX (page_timestamp) WHERE (rev_page=1) AND (rev_timestamp <= '19700102031714')  ORDER BY rev_timestamp DESC  LIMIT -1

Version information for the above was:

  • MediaWiki: 1.7alpha (r14823)
  • PHP: 5.1.2 (apache2handler)
  • MySQL: 5.0.21-Debian_3ubuntu1-log