-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support floating-point notation without exponent (#2197)
T-SQL supports floating-point without specifying an exponent, or specifying the exponent only as '+' or '-'. This defaults the exponent to 0. Some examples: 2.1E, -.2e+, -2.e- . This fix adds support by rewriting the exponent in ANTLR by appending a 0 in these cases. In addition, adding entry/exitEveryRule listeners in tsqlMutator for debugging infrastucture: these floating-points cases may occur also as parameters in stored proc calls meaning we have to handle them in tsqlMutator (as well as in tsqlBuilder where this debugging infrastructure is already present). Task: BABEL-4108 Signed-off-by: Rob Verschoor [email protected]
- Loading branch information
1 parent
2273124
commit dfe9a38
Showing
9 changed files
with
712 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
drop procedure p1_float_exponent | ||
go | ||
|
||
drop procedure p2_float_exponent | ||
go | ||
|
||
drop function f1_float_exponent | ||
go | ||
|
||
drop view v1_float_exponent | ||
go | ||
|
||
drop table t1_float_exponent | ||
go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
create table t1_float_exponent(a int, b real, c float, d decimal(10,2)) | ||
go | ||
|
||
create view v1_float_exponent as select 2e as c | ||
go | ||
|
||
create procedure p1_float_exponent @p float as select @p | ||
go | ||
|
||
create procedure p2_float_exponent as | ||
insert t1_float_exponent values (2e+, 3.1e, -.4e-, 5.e-) | ||
go | ||
|
||
create function f1_float_exponent (@p float) returns float as begin return @p end | ||
go |
Oops, something went wrong.