Bug #27433 Parser error for MySQL 5.0.37 with Bison 1.75 for sql_yacc.yy
Submitted: 26 Mar 2007 8:02 Modified: 30 Nov 2007 17:59
Reporter: Tetsuro Ikeda Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Parser Severity:S2 (Serious)
Version:5.0.37 OS:Any (2.6.17-2-686 SMP)
Assigned to: Chad MILLER CPU Architecture:Any
Tags: 5.0.37, bison, Contribution

[26 Mar 2007 8:02] Tetsuro Ikeda
Description:
MySQL ref-man says bison 1.75 works.
http://dev.mysql.com/doc/refman/5.0/en/installing-source-tree.html

But, I can't compile sql_yacc.yy of MySQL 5.0.37 with Bison 1.75.
And, I can compile sql_yacc.yy with Bison 2.3

How to repeat:
(with bison 1.75)
shell> bison --version
shell> cd $MYSQL_SRC/sql
shell> touch sql_yacc.yy
shell> make
bison -y -p MYSQL  -d --debug --verbose sql_yacc.yy
sql_yacc.yy:6793.13: parse error, unexpected ":", expecting ";" or "|"
make: *** [sql_yacc.cc] Error 1

(with bison 2.3)
shell> bison --version
shell> cd $MYSQL_SRC/sql
shell> touch sql_yacc.yy
shell> make
bison -y -p MYSQL  -d --debug --verbose sql_yacc.yy
conflicts: 250 shift/reduce

Suggested fix:
http://yu.irx.jp/dev/senna/files/t101.m5037.s103.fixyacc1.diff
[26 Mar 2007 9:20] Sveta Smirnova
Thank you for the report.

I can not repeat it on Linux. Please indicate operation system you use.
[26 Mar 2007 10:40] Tetsuro Ikeda
Hi Sveta,

Operating system I use is:

- Debian etch
- 2.6.17-2-686 SMP
[26 Mar 2007 15:29] Sveta Smirnova
Thank you for the report.

Verified as described. Bug is repeatable only with community tree
[10 Oct 2007 12:21] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/35279

ChangeSet@1.2526, 2007-10-10 08:19:01-04:00, cmiller@zippy.cornsilk.net +1 -0
  Bug#27433: Parser error for MySQL 5.0.37 with Bison 1.75 for \
  	sql_yacc.yy
  
  Yacc rules lacked semicolons to terminate rules, which is illegal in
  old versions of bison.
  
  Added semicolons.
[30 Nov 2007 17:49] Joerg Bruehe
Fix is included in the sources of 5.0.51 (community release).
[30 Nov 2007 17:59] Paul DuBois
Noted in 5.0.51 changelog.

The parser rules for the SHOW PROFILE statement were revised to work
with older versions of bison.
[28 Jan 2008 6:40] Bugs System
Pushed into 6.0.5-alpha
[28 Jan 2008 6:51] Bugs System
Pushed into 5.1.24-rc
[6 Mar 2008 5:50] Jon Stephens
Fix also documented for 5.1.23-ndb-6.2.14, 5.1.24, and 6.0.5.
[30 Mar 2008 8:22] Jon Stephens
Also documented for 5.1.23-ndb-6.3.11.
[6 May 2009 20:23] Bugs System
Pushed into 5.0.82 (revid:chad@mysql.com-20090506130632-s1cl4ygdj9rt2rrz) (version source revid:chad@mysql.com-20090506130632-s1cl4ygdj9rt2rrz) (merge vers: 5.0.82) (pib:6)