-
-
Notifications
You must be signed in to change notification settings - Fork 530
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
Vinai/more dbeaver stuff #1455
Vinai/more dbeaver stuff #1455
Conversation
This pr needs a bumped gms before review. |
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.
Mostly good, just a few comments about the test logic
go/go.mod
Outdated
@@ -78,4 +78,6 @@ require ( | |||
|
|||
replace github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi => ./gen/proto/dolt/services/eventsapi | |||
|
|||
replace github.com/dolthub/go-mysql-server => /Users/vinairachakonda/go/src/dolthub/go-mysql-server |
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.
Remove this, go get github.com/dolthub/go-mysql-server@master
instead
if currentDb == "" { | ||
return sql.ErrNoDatabaseSelected.New() | ||
func (sess *DoltSession) CommitTransaction(ctx *sql.Context, dbName string) error { | ||
if dbName == "" { |
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.
When does this happen?
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.
Leave a comment
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.
This was a bug that was happening when dbeaver would run a query and throw a "commit" statement when no database was selected. For some reason even with autocommit off, dbeaver forces these transaction statements on you.
skiponwindows "Has dependencies that are missing on the Jenkins Windows installation." | ||
|
||
cd repo1 | ||
start_sql_server repo1 |
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.
Make sure this is actually testing what you think it is. These test helper methods definitely use
a particular database one way or another.
Would be better to pass repo2
here, since you're operating on repo1 below.
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.
So each of these queries form a new connection to the server. So if start_sql_server does in fact connect to the db, the unselected_sql_query will only connect to the serve but not the db. I can add an additional statement validating that no database is selected to give more clarity
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.
Just use repo2.one_pk etc. I know what you're doing is right, but you don't know how the underlying code might change and make your test worthless. If want the test to be durable, run the statements on a different database than the one you're giving as an argument to start_sql_server
unselected_update_query 1 "DELETE FROM repo1.one_pk WHERE pk=3" | ||
unselected_server_query 1 "SELECT * FROM repo1.one_pk" "pk\n0\n1" | ||
|
||
# We don't have transactions but some editors will throws this commit statement along |
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.
?
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.
Yeah that was just a sanity check that someone typing "commit" into the server doesn't mess anything up
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.
I mean the comment doesn't make sense, read it again
# In the event that the results do not match expectations, the python process will exit with an exit code of 1 | ||
# * param1 is 1 for autocommit = true, 0 for autocommit = false | ||
# * param2 is the query_str | ||
unselected_server_query() { |
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.
How is this different from server_query?
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.
This does not connect to a database. The normal server_query uses $DEFAULT_DB variable which translates to USE DB
. Since we're not connecting to a database the engine does not have a currentDB set
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.
Ah ok, i missed that bit
# unselected_update_query runs an update query and should be called with 2 parameters | ||
# * param1 is 1 for autocommit = true, 0 for autocommit = false | ||
# * param2 is the query string | ||
unselected_update_query() { |
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.
See above question, not sure what these methods are doing different
unselected_update_query 1 "DELETE FROM repo1.one_pk WHERE pk=3" | ||
unselected_server_query 1 "SELECT * FROM repo1.one_pk" "pk\n0\n1" | ||
|
||
# We don't have transactions but some editors will throws this commit statement along |
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.
I mean the comment doesn't make sense, read it again
# In the event that the results do not match expectations, the python process will exit with an exit code of 1 | ||
# * param1 is 1 for autocommit = true, 0 for autocommit = false | ||
# * param2 is the query_str | ||
unselected_server_query() { |
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.
Ah ok, i missed that bit
skiponwindows "Has dependencies that are missing on the Jenkins Windows installation." | ||
|
||
cd repo1 | ||
start_sql_server repo1 |
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.
Just use repo2.one_pk etc. I know what you're doing is right, but you don't know how the underlying code might change and make your test worthless. If want the test to be durable, run the statements on a different database than the one you're giving as an argument to start_sql_server
This pr unblocks basic dbeaver functionality.