[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] fix float parser for 1.1E1


Hi!

>>>>> "Cristian" == Cristian Paslaru <crys@xxxxxxxxxxxxx> writes:

Cristian> The case for this patch is that you can do sql queries with 1.1e+1 to say,
Cristian> or 1.1e01, but if you try 1.1e1 will give you an error.

Cristian> I try it on MySQL 3.23.39 and 3.23.33. I think this is a very old and not
Cristian> seen bug.

Cristian> Regards.

Cristian> -- 
Cristian> Cristian Paslaru
Cristian> http://devel.iasi.ro


Cristian> -------- cut --------
Cristian> diff -ruN mysql-3.23.39.orig/sql/sql_lex.cc mysql-3.23.39/sql/sql_lex.cc
Cristian> --- mysql-3.23.39.orig/sql/sql_lex.cc	Tue Jun 12 22:07:26 2001
Cristian> +++ mysql-3.23.39/sql/sql_lex.cc	Wed Jun 27 12:22:35 2001
Cristian> @@ -655,7 +655,7 @@
Cristian>  	  state= STATE_CHAR;
Cristian>  	  break;
Cristian>  	}
Cristian> -	if (!isdigit(yyGet()))
Cristian> +	if (c == '-' || c == '+' && !isdigit(yyGet()))
Cristian>  	{				// No digit after sign
Cristian>  	  state= STATE_CHAR;
Cristian>  	  break;

I have now applied the following patch to MySQL 3.23.39 which fixes
the same problem.

===== sql/sql_lex.cc 1.15 vs edited =====
*** /tmp/sql_lex.cc-1.15-11545  Wed Mar 14 15:15:27 2001
--- edited/sql/sql_lex.cc       Thu Jun 28 12:39:13 2001
***************
*** 650,661 ****
        if (c == 'e' || c == 'E')
        {
        c = yyGet();
!       if (c != '-' && c != '+' && !isdigit(c))
!       {                               // No exp sig found
!         state= STATE_CHAR;
!         break;
!       }
!       if (!isdigit(yyGet()))
        {                               // No digit after sign
          state= STATE_CHAR;
          break;
--- 650,658 ----
        if (c == 'e' || c == 'E')
        {
        c = yyGet();
!       if (c == '-' || c == '+')
!         c = yyGet();                  // Skipp sign
!       if (!isdigit(c))
        {                               // No digit after sign
          state= STATE_CHAR;
          break;

Regards,
Monty

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <mysql-thread77899@xxxxxxxxxxxxxxx>
To unsubscribe, e-mail <mysql-unsubscribe-treed=ultraviolet.org@xxxxxxxxxxxxxxx>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



This mailing list archive is a service of Copilot Consulting.