-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/Microsoft/mssql-jdbc into Az…
…ure-DW-Junit # Conflicts: # src/test/java/com/microsoft/sqlserver/jdbc/bvt/BvtTest.java # src/test/java/com/microsoft/sqlserver/testframework/AbstractTest.java
- Loading branch information
Showing
22 changed files
with
415 additions
and
106 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
name: Bug report | ||
about: Report a bug to help us improve | ||
title: "[BUG]" | ||
labels: bug | ||
assignees: '' | ||
|
||
--- | ||
|
||
## Driver version | ||
<!--- Provide the JDBC driver version (e.g. 7.0.0). --> | ||
|
||
## SQL Server version | ||
<!--- Provide the output of executing `SELECT @@VERSION` on your target SQL Server. --> | ||
|
||
## Client Operating System | ||
<!--- Provide the Operating System the client application is running on. --> | ||
|
||
## JAVA/JVM version | ||
<!--- Provide the JAVA/JVM version (e.g. java version "1.8.0", IBM J9 VM). --> | ||
|
||
## Table schema | ||
<!--- Provide the table schema. --> | ||
|
||
## Problem description | ||
<!--- Provide full details of the problem. --> | ||
1. Expected behaviour: | ||
2. Actual behaviour: | ||
3. Error message/stack trace: | ||
4. Any other details that can be helpful: | ||
|
||
## JDBC trace logs | ||
<!--- Provide the JDBC trace logs. Instructions can be found here: https://docs.microsoft.com/sql/connect/jdbc/tracing-driver-operation?view=sql-server-2017 --> | ||
|
||
## Reproduction code | ||
<!--- Provide standalone JAVA code that reproduces the issue, preferably raw JDBC code. --> |
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,27 @@ | ||
--- | ||
name: Feature Request | ||
about: Suggest an idea for this project | ||
title: "[FEATURE REQUEST]" | ||
labels: enhancement | ||
assignees: '' | ||
|
||
--- | ||
|
||
## Is your feature request related to a problem? If so, please give a short summary of the problem and how the feature would resolve it | ||
<!--- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] ---> | ||
|
||
## Describe the preferred solution | ||
<!--- A clear and concise description of what you want to happen. ---> | ||
|
||
## Describe alternatives you've considered | ||
<!--- A clear and concise description of any alternative solutions or features you've considered. ---> | ||
|
||
## Additional context | ||
<!--- Add any other context or screenshots about the feature request here. ---> | ||
|
||
## Reference Documentations/Specifications | ||
<!--- Provide links to JDBC Specifications or any other related documentation. ---> | ||
|
||
<!--- Optional ---> | ||
## Reference Implementation | ||
<!--- Provide link to any available implementation references ---> |
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 @@ | ||
--- | ||
name: Question | ||
about: Discuss an idea to see if it would be an appropriate Issue. | ||
title: "[QUESTION]" | ||
labels: question | ||
assignees: '' | ||
|
||
--- | ||
|
||
## Question | ||
<!--- What is the question that you have? Please be detailed and give examples. ---> | ||
|
||
## Relevant Issues and Pull Requests | ||
<!--- If there are relevant issues and pull requests please list and link them here. ---> |
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,19 @@ | ||
--- | ||
name: Bug Fix | ||
about: Fix for a driver issue | ||
title: "Fix | " | ||
|
||
--- | ||
|
||
## Problem description | ||
<!--- Provide full details of the problem if no corresponding GitHub issue exists. ---> | ||
|
||
### Fixes existing GitHub issue | ||
<!--- Provide link to GitHub issue above. ---> | ||
|
||
## Fix Description | ||
<!--- Briefly describe the fix implementation. ---> | ||
|
||
## New Public APIs | ||
<!--- List any new public APIs added with this Fix. ---> | ||
|
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,16 @@ | ||
--- | ||
name: Feature | ||
about: Propose a new feature to the driver | ||
title: "Feature | " | ||
|
||
--- | ||
|
||
## Brief Description | ||
<!--- Briefly describe the feature introduced with the PR. ---> | ||
|
||
<!--- Optional ---> | ||
### Fixes existing GitHub issue | ||
<!--- Provide link to GitHub issue above. ---> | ||
|
||
## New Public APIs | ||
<!--- List any new public APIs added with this Feature. ---> |
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,9 @@ | ||
--- | ||
name: Improvements | ||
about: Improve driver's performance/code quality | ||
title: "Improvement | " | ||
|
||
--- | ||
|
||
## Brief Description | ||
<!--- Briefly describe the changes introduced with the PR. ---> |
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,16 @@ | ||
--- | ||
name: Other | ||
about: Propose a custom change to the project source code. | ||
title: "Other | " | ||
|
||
--- | ||
|
||
## Brief Description | ||
<!--- Briefly describe the feature introduced with the PR. ---> | ||
|
||
<!--- Optional ---> | ||
### Fixes existing GitHub issue | ||
<!--- Provide link to GitHub issue above. ---> | ||
|
||
## New Public APIs | ||
<!--- List any new public APIs added with this Feature. ---> |
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,9 @@ | ||
--- | ||
name: Release | ||
about: Push changes for release preparations | ||
title: "Release | " | ||
|
||
--- | ||
|
||
## Brief Description | ||
<!--- Briefly describe the changes introduced with the PR. ---> |
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
110 changes: 110 additions & 0 deletions
110
src/main/java/com/microsoft/sqlserver/jdbc/SQLServerError.java
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,110 @@ | ||
/* | ||
* Microsoft JDBC Driver for SQL Server Copyright(c) Microsoft Corporation All rights reserved. This program is made | ||
* available under the terms of the MIT License. See the LICENSE file in the project root for more information. | ||
*/ | ||
|
||
package com.microsoft.sqlserver.jdbc; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* SQLServerError represents a TDS error or message event. | ||
*/ | ||
public final class SQLServerError extends StreamPacket implements Serializable { | ||
/** | ||
* Always update serialVersionUID when prompted | ||
*/ | ||
private static final long serialVersionUID = -7304033613218700719L; | ||
private String errorMessage = ""; | ||
private int errorNumber; | ||
private int errorState; | ||
private int errorSeverity; | ||
private String serverName; | ||
private String procName; | ||
private long lineNumber; | ||
|
||
/** | ||
* Returns error message as received from SQL Server | ||
* | ||
* @return Error Message | ||
*/ | ||
public String getErrorMessage() { | ||
return errorMessage; | ||
} | ||
|
||
/** | ||
* Returns error number as received from SQL Server | ||
* | ||
* @return Error Number | ||
*/ | ||
public int getErrorNumber() { | ||
return errorNumber; | ||
} | ||
|
||
/** | ||
* Returns error state as received from SQL Server | ||
* | ||
* @return Error State | ||
*/ | ||
public int getErrorState() { | ||
return errorState; | ||
} | ||
|
||
/** | ||
* Returns Severity of error (as int value) as received from SQL Server | ||
* | ||
* @return Error Severity | ||
*/ | ||
public int getErrorSeverity() { | ||
return errorSeverity; | ||
} | ||
|
||
/** | ||
* Returns name of the server where exception occurs as received from SQL Server | ||
* | ||
* @return Server Name | ||
*/ | ||
public String getServerName() { | ||
return serverName; | ||
} | ||
|
||
/** | ||
* Returns name of the stored procedure where exception occurs as received from SQL Server | ||
* | ||
* @return Procedure Name | ||
*/ | ||
public String getProcedureName() { | ||
return procName; | ||
} | ||
|
||
/** | ||
* Returns line number where the error occurred in Stored Procedure returned by <code>getProcedureName()</code> as | ||
* received from SQL Server | ||
* | ||
* @return Line Number | ||
*/ | ||
public long getLineNumber() { | ||
return lineNumber; | ||
} | ||
|
||
SQLServerError() { | ||
super(TDS.TDS_ERR); | ||
} | ||
|
||
void setFromTDS(TDSReader tdsReader) throws SQLServerException { | ||
if (TDS.TDS_ERR != tdsReader.readUnsignedByte()) | ||
assert false; | ||
setContentsFromTDS(tdsReader); | ||
} | ||
|
||
void setContentsFromTDS(TDSReader tdsReader) throws SQLServerException { | ||
tdsReader.readUnsignedShort(); // token length (ignored) | ||
errorNumber = tdsReader.readInt(); | ||
errorState = tdsReader.readUnsignedByte(); | ||
errorSeverity = tdsReader.readUnsignedByte(); // matches master.dbo.sysmessages | ||
errorMessage = tdsReader.readUnicodeString(tdsReader.readUnsignedShort()); | ||
serverName = tdsReader.readUnicodeString(tdsReader.readUnsignedByte()); | ||
procName = tdsReader.readUnicodeString(tdsReader.readUnsignedByte()); | ||
lineNumber = tdsReader.readUnsignedInt(); | ||
} | ||
} |
Oops, something went wrong.