Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

SqlServer 2008 DDL parser errror #1306

Closed
viruscamp opened this issue Jun 23, 2016 · 4 comments
Closed

SqlServer 2008 DDL parser errror #1306

viruscamp opened this issue Jun 23, 2016 · 4 comments
Labels
Milestone

Comments

@viruscamp
Copy link

viruscamp commented Jun 23, 2016

druid 1.0.20
sqljdbc41 4.2.6420.100
SqlServer 2008 Express with default config

When I enabled the wall filter , it blocked the two ddl statemnets below.

When I disabled the wall filter and enabled the stat filter only, the two statements were executed, but it also has parser exception logs.

sql injection violation, syntax error:
syntax error, expect LPAREN, actual NOT not :

create table leave_jpa (
id bigint identity not null, 
apply_time datetime2, 
start_time datetime2, 
user_id varchar(255), 
primary key (id)
)

sql injection violation, syntax error:
syntax error, error in :'uble precision,
LONG_ numeric(19,0',expect RPAREN, actual IDENTIFIER precision :

create table ACT_RU_VARIABLE (
ID_ nvarchar(64) not null,
DOUBLE_ double precision,
LONG_ numeric(19,0),
TEXT_ nvarchar(4000),
primary key (ID_)
)
@wenshao wenshao added this to the 1.0.21 milestone Jun 29, 2016
@wenshao
Copy link
Member

wenshao commented Jun 29, 2016

DOUBLE_ double precision,

这是什么鬼语法?

@wenshao wenshao added the Bug label Jun 29, 2016
@wenshao wenshao modified the milestones: 1.0.22, 1.0.21 Jun 29, 2016
@viruscamp
Copy link
Author

DOUBLE_ double precision,

这什么鬼语法我也不知道,只知道这是合法的,在 SQL Server Management Studio 里能正常执行。
生成的表,再去查 create 是这样的。

CREATE TABLE [dbo].[ACT_RU_VARIABLE](
    [ID_] [nvarchar](64) NOT NULL,
    [DOUBLE_] [float] NULL,
    [LONG_] [numeric](19, 0) NULL,
    [TEXT_] [nvarchar](4000) NULL,
PRIMARY KEY CLUSTERED 
(
    [ID_] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

@viruscamp
Copy link
Author

我查到了, DOUBLE PRECISION 是 SQL92 标准数据类型,这两个词是一个整体。

这边有
http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt
The data types FLOAT, REAL, and DOUBLE PRECISION are col-lectively referred to as approximate numeric types.
定义了三种浮点类型,其中一个完整名称就是 DOUBLE PRECISION ,但是数据库实现一般就用 double

@wenshao
Copy link
Member

wenshao commented Jul 10, 2016

22f3891

@wenshao wenshao closed this as completed Jul 10, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants