-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds database name to Juxtaposer mssql queries #1135
Merged
Merged
Conversation
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
diverdane
force-pushed
the
juxtaposer-mssql-db-ensure
branch
from
February 10, 2020 14:45
1eade0c
to
dd4a9f0
Compare
5 tasks
5 tasks
sgnn7
previously approved these changes
Feb 10, 2020
This new change ensures that all supported DBs _and_ mssql will work with table creation and data insertion.
The were all named 'db' when they should have the right name for their DB type.
Juxtaposer can now interact with mssql databases with this change.
We can now deploy mssql juxtaposer into the XA env
With the addition of this driver, there's some informational info that needed to be put into the README on how to run this.
While attempting to run the Juxtaposer 4-day reliability test using Secretless with MSSQL, the following error was encountered: ``` vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv mssql_secretless_tcp vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv 2020/02/07 17:30:09 Calling Connect from ensureWantedDbDataState, debug=true 2020/02/07 17:30:09 Connect called with debug: true 2020/02/07 17:30:09 Connection string: sqlserver://:@127.0.0.1:11433?app+name=Juxtaposer 2020/02/07 17:30:09 Connected to DB 2020/02/07 17:30:09 Creating database (if it doesn't exist)... 2020/02/07 17:30:09 query string: IF NOT EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'secretless') CREATE DATABASE secretless 2020/02/07 17:30:11 Switching database... 2020/02/07 17:30:11 query string: USE secretless 2020/02/07 17:30:11 Query: DROP TABLE IF EXISTS mytable; 2020/02/07 17:30:11 2020/02/07 17:30:11 Query: CREATE TABLE mytable ( name TEXT, id INTEGER, birth_date DATE, result DECIMAL, passed BIT ); 2020/02/07 17:30:11 2020/02/07 17:30:11 ERROR sql: Could not execute query! 2020/02/07 17:30:11 Shutting down database connection... 2020/02/07 17:30:11 mssql: CREATE TABLE permission denied in database 'master'. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` This error was apparently caused by the MSSQL server not honoring the `USE <database-name>` query in any subsequent queries (i.e. the server would "forget" that the database had already been selected. The fix is twofold: - Modify the database existence test so that it is only done once at the beginning of testing (i.e. it won't get done for every call to Connect(). Otherwise, for tests that are configured with recreateConnections set to true, the database existence test would be done for every test query. - Once the database has been confirmed to exist, include the database name in the query header for all subsequent queries.
diverdane
force-pushed
the
juxtaposer-mssql-db-ensure
branch
from
February 10, 2020 16:44
dd4a9f0
to
0ab1c39
Compare
sgnn7
approved these changes
Feb 10, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@diverdane Yay LGTM!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do (include background context, if relevant)?
NOTE FOR REVIEWERS: The changes proposed are based on PR #1119, which hasn't been merged yet.
To review the changes being proposed here, look at the last commit:
1eade0c
This request is a followup to PR #1119 and Issue #1129, which adds an MSSQL backend tester
to the Juxtaposer test.
While running Juxtaposer with MSSQL on OpenShift, the following error was encountered:
This error was apparently caused by the MSSQL server not honoring the
prior
USE <database-name>
query in any subsequent queries (i.e. the serverwould "forget" that the database had already been selected).
After discussing with @sgnn7, the fix we arrived at is:
Modify the database existence test so that it is only done once at the beginning of testing (i.e. it won't get done for every call to Connect()).
Once the database has been confirmed to exist, include the database name in the query for all subsequent queries.
What ticket does this PR close?
Connected to #1134
Where should the reviewer start?
What is the status of the manual tests?
Have you run the following manual tests to verify existing functionality continues to function as expected?
If this feature does not have any/sufficent automated tests, have you created/updated a folder in
test/manual
that includes:start
andstop
scripts to spin up and tear down the test environmentstest
script to run some basic manual tests (optional; if does not exist, the README should have detailed instructions)Links to open issues for related automated integration and unit tests
Links to open issues for related documentation (in READMEs, docs, etc)
Screenshots (if appropriate)