-
-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[auto-bump] [no-release-notes] dependency by jycor (#7693)
- Loading branch information
1 parent
5333329
commit d476dda
Showing
13 changed files
with
193 additions
and
183 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
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
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
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
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
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
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 |
---|---|---|
@@ -1,89 +1,89 @@ | ||
library(RMariaDB) | ||
library(DBI) | ||
|
||
args = commandArgs(trailingOnly=TRUE) | ||
|
||
user = args[1] | ||
port = args[2] | ||
db = args[3] | ||
|
||
conn = dbConnect(RMariaDB::MariaDB(), host="127.0.0.1", port = port, | ||
username = user, dbname = db) | ||
|
||
# check standard queries | ||
queries = list("create table test (pk int, value int, primary key(pk))", | ||
"describe test", | ||
"insert into test (pk, `value`) values (0,0)", | ||
"select * from test") | ||
|
||
responses = list(NULL, | ||
data.frame(Field = c("pk", "value"), Type = c("int", "int"), Null = c("NO", "YES"), Key = c("PRI", ""), Default = c("NULL", "NULL"), Extra = c("", ""), stringsAsFactors = FALSE), | ||
NULL, | ||
data.frame(pk = c(0), value = c(0), stringsAsFactors = FALSE)) | ||
|
||
for(i in 1:length(queries)) { | ||
q = queries[[i]] | ||
want = responses[[i]] | ||
if (!is.null(want)) { | ||
got <- dbGetQuery(conn, q) | ||
if (!isTRUE(all.equal(want, got))) { | ||
print(q) | ||
print(want) | ||
print(got) | ||
quit(1) | ||
} | ||
} else { | ||
dbExecute(conn, q) | ||
} | ||
} | ||
|
||
# check prepared statements | ||
stmt <- dbSendStatement(conn, "INSERT INTO test values (?, ?)") | ||
rs <- dbBind(stmt, list(1,1)) | ||
rowsAff <- dbGetRowsAffected(rs) | ||
dbClearResult(rs) | ||
|
||
if (rowsAff != 1) { | ||
print("failed to execute prepared statement") | ||
quit(1) | ||
} | ||
|
||
got <- dbGetQuery(conn, "select * from test where pk = 1") | ||
want = data.frame(pk = c(1), value = c(1)) | ||
if (!isTRUE(all.equal(want, got))) { | ||
print("unexpected prepared statement result") | ||
print(got) | ||
quit(1) | ||
} | ||
|
||
dolt_queries = list("call DOLT_ADD('-A')", | ||
"call dolt_commit('-m', 'my commit')", | ||
"call dolt_checkout('-b', 'mybranch')", | ||
"insert into test (pk, `value`) values (2,2)", | ||
"call dolt_commit('-a', '-m', 'my commit2')", | ||
"call dolt_checkout('main')", | ||
"call dolt_merge('mybranch')") | ||
|
||
for(i in 1:length(dolt_queries)) { | ||
q = dolt_queries[[i]] | ||
dbExecute(conn, q) | ||
} | ||
|
||
count <- dbGetQuery(conn, "select COUNT(*) as c from dolt_log") | ||
want <- data.frame(c = c(3)) | ||
ret <- all.equal(count, want) | ||
if (!ret) { | ||
print("Number of commits is incorrect") | ||
quit(1) | ||
} | ||
|
||
# Add a failing query and ensure that the connection does not quit. | ||
# cc. https://github.com/dolthub/dolt/issues/3418 | ||
try(dbExecute(conn, "insert into test values (0, 1)"), silent = TRUE) | ||
one <- dbGetQuery(conn, "select 1 as pk") | ||
ret <- one == data.frame(pk=1) | ||
if (!ret) { | ||
print("Number of commits is incorrect") | ||
quit(1) | ||
} | ||
|
||
library(RMariaDB) | ||
library(DBI) | ||
|
||
args = commandArgs(trailingOnly=TRUE) | ||
|
||
user = args[1] | ||
port = args[2] | ||
db = args[3] | ||
|
||
conn = dbConnect(RMariaDB::MariaDB(), host="127.0.0.1", port = port, | ||
username = user, dbname = db) | ||
|
||
# check standard queries | ||
queries = list("create table test (pk int, value int, primary key(pk))", | ||
"describe test", | ||
"insert into test (pk, `value`) values (0,0)", | ||
"select * from test") | ||
|
||
responses = list(NULL, | ||
data.frame(Field = c("pk", "value"), Type = c("int", "int"), Null = c("NO", "YES"), Key = c("PRI", ""), Default = c(NA, NA), Extra = c("", ""), stringsAsFactors = FALSE), | ||
NULL, | ||
data.frame(pk = c(0), value = c(0), stringsAsFactors = FALSE)) | ||
|
||
for(i in 1:length(queries)) { | ||
q = queries[[i]] | ||
want = responses[[i]] | ||
if (!is.null(want)) { | ||
got <- dbGetQuery(conn, q) | ||
if (!isTRUE(all.equal(want, got))) { | ||
print(q) | ||
print(want) | ||
print(got) | ||
quit(1) | ||
} | ||
} else { | ||
dbExecute(conn, q) | ||
} | ||
} | ||
|
||
# check prepared statements | ||
stmt <- dbSendStatement(conn, "INSERT INTO test values (?, ?)") | ||
rs <- dbBind(stmt, list(1,1)) | ||
rowsAff <- dbGetRowsAffected(rs) | ||
dbClearResult(rs) | ||
|
||
if (rowsAff != 1) { | ||
print("failed to execute prepared statement") | ||
quit(1) | ||
} | ||
|
||
got <- dbGetQuery(conn, "select * from test where pk = 1") | ||
want = data.frame(pk = c(1), value = c(1)) | ||
if (!isTRUE(all.equal(want, got))) { | ||
print("unexpected prepared statement result") | ||
print(got) | ||
quit(1) | ||
} | ||
|
||
dolt_queries = list("call DOLT_ADD('-A')", | ||
"call dolt_commit('-m', 'my commit')", | ||
"call dolt_checkout('-b', 'mybranch')", | ||
"insert into test (pk, `value`) values (2,2)", | ||
"call dolt_commit('-a', '-m', 'my commit2')", | ||
"call dolt_checkout('main')", | ||
"call dolt_merge('mybranch')") | ||
|
||
for(i in 1:length(dolt_queries)) { | ||
q = dolt_queries[[i]] | ||
dbExecute(conn, q) | ||
} | ||
|
||
count <- dbGetQuery(conn, "select COUNT(*) as c from dolt_log") | ||
want <- data.frame(c = c(3)) | ||
ret <- all.equal(count, want) | ||
if (!ret) { | ||
print("Number of commits is incorrect") | ||
quit(1) | ||
} | ||
|
||
# Add a failing query and ensure that the connection does not quit. | ||
# cc. https://github.com/dolthub/dolt/issues/3418 | ||
try(dbExecute(conn, "insert into test values (0, 1)"), silent = TRUE) | ||
one <- dbGetQuery(conn, "select 1 as pk") | ||
ret <- one == data.frame(pk=1) | ||
if (!ret) { | ||
print("Number of commits is incorrect") | ||
quit(1) | ||
} | ||
|
Oops, something went wrong.