Home Dashboard Directory Help
Search

Query with newline character fails by ajaykumarks


Status: 

Closed
 as Fixed Help for as Fixed


1
0
Sign in
to vote
Type: Bug
ID: 735610
Opened: 4/5/2012 6:39:15 AM
Access Restriction: Public
0
Workaround(s)
view
1
User(s) can reproduce this bug

Description

Web 2.0 application allows users to enter SQL into a text box and submit it to a SQL Server backend. One of our users reported a failure submitting a simple query. It turns out the problem is that there is a newline character proceeding the from clause, when this is removed the error does not occur. The call throwing the exception is getParameterMetaData().

Using Cut N Paste from a UNIX envrionment the end of line (EOL) is a newline (\n). The parser does not seem to recognize these as a delimiter and failes to parse the query properly.

Execute the attached program using the following command - the logon specified must be able to create and delete tables in the database.

You supply the connection URL for the SqlServer you will be using to run the test. The required tables are created, populated with data and then deleted. The output from the program is below. I have annotated the output in this font:    

java ParamMetaDataProblem "jdbc:sqlserver://<serverHost>:<port>;databaseName=<DBname>;user=<username>;password=<password>"

...

* java -cp .\sqljdbc4.jar;.;%CLASSPATH% ParamMetaDataProblem "jdbc:sqlserver://sqlHost:1433;databaseName=dbname;user=adm;password=xxx"


Details
Sign in to post a comment.
Posted by Microsoft on 4/5/2012 at 3:04 PM
Thank you for your feedback, we will look into it.
Sign in to post a workaround.
File Name Submitted By Submitted On File Size  
ParamMetaDataProblem.doc (restricted) 4/5/2012 -