Skip to content

Commit

Permalink
[auto-bump] [no-release-notes] dependency by jycor (#7693)
Browse files Browse the repository at this point in the history
  • Loading branch information
coffeegoddd authored Apr 5, 2024
1 parent 5333329 commit d476dda
Show file tree
Hide file tree
Showing 13 changed files with 193 additions and 183 deletions.
2 changes: 1 addition & 1 deletion go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ require (
github.com/cespare/xxhash v1.1.0
github.com/creasty/defaults v1.6.0
github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2
github.com/dolthub/go-mysql-server v0.18.1-0.20240403215131-bea58f6a1988
github.com/dolthub/go-mysql-server v0.18.1-0.20240403225518-8145826df225
github.com/dolthub/swiss v0.1.0
github.com/goccy/go-json v0.10.2
github.com/google/go-github/v57 v57.0.0
Expand Down
4 changes: 2 additions & 2 deletions go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ github.com/dolthub/fslock v0.0.3 h1:iLMpUIvJKMKm92+N1fmHVdxJP5NdyDK5bK7z7Ba2s2U=
github.com/dolthub/fslock v0.0.3/go.mod h1:QWql+P17oAAMLnL4HGB5tiovtDuAjdDTPbuqx7bYfa0=
github.com/dolthub/go-icu-regex v0.0.0-20230524105445-af7e7991c97e h1:kPsT4a47cw1+y/N5SSCkma7FhAPw7KeGmD6c9PBZW9Y=
github.com/dolthub/go-icu-regex v0.0.0-20230524105445-af7e7991c97e/go.mod h1:KPUcpx070QOfJK1gNe0zx4pA5sicIK1GMikIGLKC168=
github.com/dolthub/go-mysql-server v0.18.1-0.20240403215131-bea58f6a1988 h1:a7GMWJBlE3gnPp7QEo2GQZhP5sBdF630JeW8X5rkSOU=
github.com/dolthub/go-mysql-server v0.18.1-0.20240403215131-bea58f6a1988/go.mod h1:SJleIOwC74u9tdUoGgVgM/eLlwVj3sJEFfx0sdStvW0=
github.com/dolthub/go-mysql-server v0.18.1-0.20240403225518-8145826df225 h1:63qiK4ooVG8yUrwwx8PzMQH2cBKQ3Fm/tzB8sRyiZ9U=
github.com/dolthub/go-mysql-server v0.18.1-0.20240403225518-8145826df225/go.mod h1:SJleIOwC74u9tdUoGgVgM/eLlwVj3sJEFfx0sdStvW0=
github.com/dolthub/ishell v0.0.0-20221214210346-d7db0b066488 h1:0HHu0GWJH0N6a6keStrHhUAK5/o9LVfkh44pvsV4514=
github.com/dolthub/ishell v0.0.0-20221214210346-d7db0b066488/go.mod h1:ehexgi1mPxRTk0Mok/pADALuHbvATulTh6gzr7NzZto=
github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71 h1:bMGS25NWAGTEtT5tOBsCuCrlYnLRKpbJVJkDbrTRhwQ=
Expand Down
18 changes: 9 additions & 9 deletions go/libraries/doltcore/sqle/enginetest/dolt_queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,30 +342,30 @@ var DescribeTableAsOfScriptTest = queries.ScriptTest{
{
Query: "describe a as of @Commit1;",
Expected: []sql.Row{
{"pk", "int", "NO", "PRI", "NULL", ""},
{"c1", "int", "YES", "", "NULL", ""},
{"pk", "int", "NO", "PRI", nil, ""},
{"c1", "int", "YES", "", nil, ""},
},
},
{
Query: "describe a as of @Commit2;",
Expected: []sql.Row{
{"pk", "int", "NO", "PRI", "NULL", ""},
{"c1", "int", "YES", "", "NULL", ""},
{"c2", "varchar(20)", "YES", "", "NULL", ""},
{"pk", "int", "NO", "PRI", nil, ""},
{"c1", "int", "YES", "", nil, ""},
{"c2", "varchar(20)", "YES", "", nil, ""},
},
},
{
Query: "describe a as of @Commit3;",
Expected: []sql.Row{
{"pk", "int", "NO", "PRI", "NULL", ""},
{"c2", "varchar(20)", "YES", "", "NULL", ""},
{"pk", "int", "NO", "PRI", nil, ""},
{"c2", "varchar(20)", "YES", "", nil, ""},
},
},
{
Query: "describe a as of HEAD;",
Expected: []sql.Row{
{"pk", "int", "NO", "PRI", "NULL", ""},
{"c2", "varchar(20)", "YES", "", "NULL", ""},
{"pk", "int", "NO", "PRI", nil, ""},
{"c2", "varchar(20)", "YES", "", nil, ""},
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ var SchemaOverrideTests = []queries.ScriptTest{
{
Query: "describe t;",
Expected: []sql.Row{
{"pk", "int", "NO", "PRI", "NULL", ""},
{"c2", "varchar(255)", "YES", "", "NULL", ""},
{"pk", "int", "NO", "PRI", nil, ""},
{"c2", "varchar(255)", "YES", "", nil, ""},
},
},
{
Expand Down
12 changes: 6 additions & 6 deletions go/libraries/doltcore/sqle/enginetest/privilege_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,8 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{
Host: "localhost",
Query: "desc test;",
Expected: []sql.Row{
{"pk", "bigint", "NO", "PRI", "NULL", ""},
{"a", "int", "YES", "", "NULL", ""},
{"pk", "bigint", "NO", "PRI", nil, ""},
{"a", "int", "YES", "", nil, ""},
},
},
},
Expand Down Expand Up @@ -641,8 +641,8 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{
Host: "localhost",
Query: "desc test;",
Expected: []sql.Row{
{"pk", "bigint", "NO", "PRI", "NULL", ""},
{"a", "int", "YES", "MUL", "NULL", ""},
{"pk", "bigint", "NO", "PRI", nil, ""},
{"a", "int", "YES", "MUL", nil, ""},
},
},
{
Expand Down Expand Up @@ -674,8 +674,8 @@ var DoltOnlyRevisionDbPrivilegeTests = []queries.UserPrivilegeTest{
Host: "localhost",
Query: "desc test;",
Expected: []sql.Row{
{"pk", "bigint", "NO", "PRI", "NULL", ""},
{"a", "int", "YES", "", "NULL", ""},
{"pk", "bigint", "NO", "PRI", nil, ""},
{"a", "int", "YES", "", nil, ""},
},
},
},
Expand Down
10 changes: 5 additions & 5 deletions integration-tests/bats/create-views.bats
Original file line number Diff line number Diff line change
Expand Up @@ -375,14 +375,14 @@ SQL
run dolt sql -r csv -q "describe view1"
[ "$status" -eq 0 ]
[ "${#lines[@]}" -eq 3 ]
[[ "${lines[1]}" =~ 'pk,int,NO,"",NULL,""' ]] || false
[[ "${lines[2]}" =~ 'val,int,YES,"",NULL,""' ]] || false
[[ "${lines[1]}" =~ 'pk,int,NO,"",,""' ]] || false
[[ "${lines[2]}" =~ 'val,int,YES,"",,""' ]] || false

dolt sql -q "create view view2 as select pk from t"
run dolt sql -r csv -q "describe view2"
[ "$status" -eq 0 ]
[ "${#lines[@]}" -eq 2 ]
[[ "${lines[1]}" =~ 'pk,int,NO,"",NULL,""' ]] || false
[[ "${lines[1]}" =~ 'pk,int,NO,"",,""' ]] || false

dolt sql -q "create table t2(pk int primary key, val int)"
dolt sql -q "insert into t values (1,1)"
Expand All @@ -392,8 +392,8 @@ SQL
run dolt sql -r csv -q "describe view3"
[ "$status" -eq 0 ]
[ "${#lines[@]}" -eq 3 ]
[[ "${lines[1]}" =~ 'v1,int,YES,"",NULL,""' ]] || false
[[ "${lines[2]}" =~ 'v2,int,YES,"",NULL,""' ]] || false
[[ "${lines[1]}" =~ 'v1,int,YES,"",,""' ]] || false
[[ "${lines[2]}" =~ 'v2,int,YES,"",,""' ]] || false
}

@test "create-views: can correctly alter a view" {
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/mysql-client-tests/node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ const tests = [
Type: "int",
Null: "NO",
Key: "PRI",
Default: "NULL",
Default: null,
Extra: "",
},
{
Field: "value",
Type: "int",
Null: "YES",
Key: "",
Default: "NULL",
Default: null,
Extra: "",
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ export const tableTests = [
Type: "int",
Null: "NO",
Key: "PRI",
Default: "NULL",
Default: null,
Extra: "",
},
{
Field: "value",
Type: "int",
Null: "YES",
Key: "",
Default: "NULL",
Default: null,
Extra: "",
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
QUERY_RESPONSE = [
{"create table test (pk int, `value` int, primary key(pk))": []},
{"describe test": [
('pk', 'int', 'NO', 'PRI', 'NULL', ''),
('value', 'int', 'YES', '', 'NULL', '')
('pk', 'int', 'NO', 'PRI', None, ''),
('value', 'int', 'YES', '', None, '')
]},
{"insert into test (pk, `value`) values (0,0)": []},
{"select * from test": [(0, 0)]},
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/mysql-client-tests/python/pymysql-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
QUERY_RESPONSE = [
{"create table test (pk int, `value` int, primary key(pk))": ()},
{"describe test": (
('pk', 'int', 'NO', 'PRI', 'NULL', ''),
('value', 'int', 'YES', '', 'NULL', '')
('pk', 'int', 'NO', 'PRI', None, ''),
('value', 'int', 'YES', '', None, '')
)},
{"insert into test (pk, `value`) values (0,0)": ()},
{"select * from test": ((0, 0),)},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
QUERY_RESPONSE = [
{"create table test (pk int, `value` int, primary key(pk))": []},
{"describe test": [
('pk', 'int', 'NO', 'PRI', 'NULL', ''),
('value', 'int', 'YES', '', 'NULL', '')
('pk', 'int', 'NO', 'PRI', None, ''),
('value', 'int', 'YES', '', None, '')
]},
{"insert into test (pk, `value`) values (0,0)": ()},
{"select * from test": [(0, 0)]},
Expand Down
178 changes: 89 additions & 89 deletions integration-tests/mysql-client-tests/r/rmariadb-test.r
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)
}

Loading

0 comments on commit d476dda

Please sign in to comment.