Skip to content

Commit

Permalink
remove dolt stored procedure aliases (#7054)
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifersp authored Nov 28, 2023
1 parent 37c8b56 commit d3c4a9a
Show file tree
Hide file tree
Showing 19 changed files with 55 additions and 1,190 deletions.
22 changes: 0 additions & 22 deletions go/libraries/doltcore/sqle/dprocedures/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,28 +46,6 @@ var DoltProcedures = []sql.ExternalStoredProcedureDetails{
{Name: "dolt_revert", Schema: int64Schema("status"), Function: doltRevert},
{Name: "dolt_tag", Schema: int64Schema("status"), Function: doltTag},
{Name: "dolt_verify_constraints", Schema: int64Schema("violations"), Function: doltVerifyConstraints},

// Dolt stored procedure aliases
// TODO: Add new procedure aliases in doltProcedureAliasSet in go-mysql-server/sql/information_schema/routines.go file
{Name: "dadd", Schema: int64Schema("status"), Function: doltAdd},
{Name: "dbranch", Schema: int64Schema("status"), Function: doltBranch},
{Name: "dcheckout", Schema: doltCheckoutSchema, Function: doltCheckout, ReadOnly: true},
{Name: "dcherry_pick", Schema: cherryPickSchema, Function: doltCherryPick},
{Name: "dclean", Schema: int64Schema("status"), Function: doltClean},
{Name: "dclone", Schema: int64Schema("status"), Function: doltClone},
{Name: "dcommit", Schema: stringSchema("hash"), Function: doltCommit},
{Name: "dfetch", Schema: int64Schema("status"), Function: doltFetch, AdminOnly: true},

// {Name: "dgc", Schema: int64Schema("status"), Function: doltGC},

{Name: "dmerge", Schema: doltMergeSchema, Function: doltMerge},
{Name: "dpull", Schema: int64Schema("fast_forward", "conflicts"), Function: doltPull, AdminOnly: true},
{Name: "dpush", Schema: doltPushSchema, Function: doltPush, AdminOnly: true},
{Name: "dremote", Schema: int64Schema("status"), Function: doltRemote, AdminOnly: true},
{Name: "dreset", Schema: int64Schema("status"), Function: doltReset},
{Name: "drevert", Schema: int64Schema("status"), Function: doltRevert},
{Name: "dtag", Schema: int64Schema("status"), Function: doltTag},
{Name: "dverify_constraints", Schema: int64Schema("violations"), Function: doltVerifyConstraints},
}

// stringSchema returns a non-nullable schema with all columns as LONGTEXT.
Expand Down
4 changes: 2 additions & 2 deletions go/libraries/doltcore/sqle/enginetest/dolt_harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ func (d *DoltHarness) resetScripts() []setup.SetupScript {
resetCmds = append(resetCmds, setup.SetupScript{createTableStatement.String()})
}

resetCmds = append(resetCmds, setup.SetupScript{"call dclean()"})
resetCmds = append(resetCmds, setup.SetupScript{"call dreset('--hard', 'head')"})
resetCmds = append(resetCmds, setup.SetupScript{"call dolt_clean()"})
resetCmds = append(resetCmds, setup.SetupScript{"call dolt_reset('--hard', 'head')"})
}

resetCmds = append(resetCmds, setup.SetupScript{"SET foreign_key_checks=1;"})
Expand Down
6 changes: 3 additions & 3 deletions go/libraries/doltcore/sqle/enginetest/dolt_queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -1004,10 +1004,10 @@ var DoltScripts = []queries.ScriptTest{
"CREATE TABLE t(pk varchar(20), val int)",
"ALTER TABLE t ADD PRIMARY KEY (pk, val)",
"INSERT INTO t VALUES ('zzz',4),('mult',1),('sub',2),('add',5)",
"CALL dadd('.');",
"CALL dcommit('-am', 'add rows');",
"CALL dolt_add('.');",
"CALL dolt_commit('-am', 'add rows');",
"INSERT INTO t VALUES ('dolt',0),('alt',12),('del',8),('ctl',3)",
"CALL dcommit('-am', 'add more rows');",
"CALL dolt_commit('-am', 'add more rows');",
},
Assertions: []queries.ScriptTestAssertion{
{
Expand Down
16 changes: 8 additions & 8 deletions integration-tests/bats/filter-branch.bats
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ teardown() {
dolt sql <<SQL
create table t (pk int primary key);
insert into t values (1),(2);
call dcommit('-Am', 'msg');
call dolt_commit('-Am', 'msg');
insert into t values (3);
call dcommit('-Am', 'three');
call dtag('myTag');
call dolt_commit('-Am', 'three');
call dolt_tag('myTag');
insert into t values (4);
call dcommit('-Am', 'four');
call dolt_commit('-Am', 'four');
SQL
run dolt sql -q "select * from t as of 'myTag'" -r csv
[ "$status" -eq 0 ]
Expand All @@ -113,12 +113,12 @@ SQL
dolt sql <<SQL
create table t (pk int primary key);
insert into t values (1),(2);
call dcommit('-Am', 'msg');
call dolt_commit('-Am', 'msg');
insert into t values (3);
call dcommit('-Am', 'three');
call dtag('myTag');
call dolt_commit('-Am', 'three');
call dolt_tag('myTag');
insert into t values (4);
call dcommit('-Am', 'four');
call dolt_commit('-Am', 'four');
SQL
run dolt sql -q "select * from t" -r csv
[ "$status" -eq 0 ]
Expand Down
66 changes: 33 additions & 33 deletions integration-tests/bats/migrate.bats
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ function checksum_table {
dolt sql <<SQL
CREATE TABLE test (pk int primary key, c0 int, c1 int);
INSERT INTO test VALUES (0,0,0);
CALL dadd('-A');
CALL dcommit('-am', 'added table test');
CALL dolt_add('-A');
CALL dolt_commit('-am', 'added table test');
SQL
CHECKSUM=$(checksum_table test head)

Expand Down Expand Up @@ -51,8 +51,8 @@ SQL
dolt sql <<SQL
CREATE TABLE test (pk int primary key, c0 int, c1 int);
INSERT INTO test VALUES (0,0,0);
CALL dadd('-A');
CALL dcommit('-am', 'added table test');
CALL dolt_add('-A');
CALL dolt_commit('-am', 'added table test');
SQL

mkdir db_one db_two
Expand Down Expand Up @@ -83,8 +83,8 @@ SQL
dolt sql <<SQL
CREATE TABLE test (pk int primary key, c0 int, c1 int);
INSERT INTO test VALUES (0,0,0);
CALL dadd('-A');
CALL dcommit('-am', 'added table test');
CALL dolt_add('-A');
CALL dolt_commit('-am', 'added table test');
SQL

dolt migrate
Expand All @@ -96,20 +96,20 @@ SQL
dolt sql <<SQL
CREATE TABLE test (pk int primary key, c0 int, c1 int);
INSERT INTO test VALUES (0,0,0);
CALL dadd('-A');
CALL dcommit('-am', 'added table test');
CALL dolt_add('-A');
CALL dolt_commit('-am', 'added table test');
SQL
dolt branch one
dolt branch two

dolt sql <<SQL
CALL dcheckout('one');
CALL dolt_checkout('one');
INSERT INTO test VALUES (1,1,1);
CALL dcommit('-am', 'row (1,1,1)');
CALL dcheckout('two');
CALL dolt_commit('-am', 'row (1,1,1)');
CALL dolt_checkout('two');
INSERT INTO test VALUES (2,2,2);
CALL dcommit('-am', 'row (2,2,2)');
CALL dmerge('one');
CALL dolt_commit('-am', 'row (2,2,2)');
CALL dolt_merge('one');
SQL

MAIN=$(checksum_table test main)
Expand All @@ -135,11 +135,11 @@ SQL
dolt sql <<SQL
CREATE TABLE test (pk int primary key, c0 int, c1 int);
INSERT INTO test VALUES (0,0,0);
CALL dadd('-A');
CALL dcommit('-am', 'added table test');
CALL dtag('tag1', 'head');
CALL dolt_add('-A');
CALL dolt_commit('-am', 'added table test');
CALL dolt_tag('tag1', 'head');
INSERT INTO test VALUES (1,1,1);
CALL dcommit('-am', 'added rows');
CALL dolt_commit('-am', 'added rows');
INSERT INTO test VALUES (2,2,2);
SQL

Expand Down Expand Up @@ -169,8 +169,8 @@ TXT
CREATE TABLE test (pk int primary key, c0 int, c1 int);
CREATE VIEW test2 AS SELECT c0, c1 FROM test;
INSERT INTO test VALUES (0,0,0);
CALL dadd('-A');
CALL dcommit('-am', 'added table test');
CALL dolt_add('-A');
CALL dolt_commit('-am', 'added table test');
SQL
dolt docs upload README.md README.md
dolt add .
Expand All @@ -191,10 +191,10 @@ SQL
dolt sql <<SQL
CREATE TABLE keyless (c0 int, c1 int);
INSERT INTO keyless VALUES (0,0),(1,1);
CALL dadd('-A');
CALL dcommit('-am', 'added keyless table');
CALL dolt_add('-A');
CALL dolt_commit('-am', 'added keyless table');
INSERT INTO keyless VALUES (2,2),(3,3);
CALL dcommit('-am', 'added more rows');
CALL dolt_commit('-am', 'added more rows');
SQL

HEAD=$(checksum_table keyless head)
Expand Down Expand Up @@ -276,21 +276,21 @@ SQL
dolt sql <<SQL
CREATE TABLE test (pk int primary key, c0 int, c1 int);
INSERT INTO test VALUES (0,0,0);
CALL dcommit('-Am', 'added table test');
CALL dcheckout('-b', 'other');
CALL dbranch('third');
CALL dolt_commit('-Am', 'added table test');
CALL dolt_checkout('-b', 'other');
CALL dolt_branch('third');
INSERT INTO test VALUES (1, 2, 3);
CALL dcommit('-am', 'added row on branch other');
CALL dcheckout('main');
CALL dolt_commit('-am', 'added row on branch other');
CALL dolt_checkout('main');
INSERT INTO test VALUES (1, -2, -3);
CALL dcommit('-am', 'added row on branch main');
CALL dolt_commit('-am', 'added row on branch main');
SET @@dolt_allow_commit_conflicts = 1;
CALL dmerge('other');
CALL dolt_merge('other');
INSERT INTO test VALUES (9,9,9);
SET @@dolt_allow_commit_conflicts = 1;
SET @@dolt_force_transaction_commit = 1;
CALL dcommit( '--force', '-am', 'commit conflicts');
CALL dcheckout('third');
CALL dolt_commit( '--force', '-am', 'commit conflicts');
CALL dolt_checkout('third');
SQL
dolt migrate --drop-conflicts
}
Expand All @@ -299,8 +299,8 @@ SQL
dolt sql <<SQL
CREATE TABLE test (pk int primary key, c0 int, c1 int);
INSERT INTO test VALUES (0,0,0);
CALL dadd('-A');
CALL dcommit('-am', 'added table test');
CALL dolt_add('-A');
CALL dolt_commit('-am', 'added table test');
SQL
dolt migrate
run dolt migrate
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/bats/multidb.bats
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ teardown() {
start_multi_db_server repo1
dolt sql -q "create database new;
use new;
call dcheckout('-b', 'feat');
call dolt_checkout('-b', 'feat');
create table t (x int);
call dolt_add('.');
call dcommit('-am', 'cm');
call dolt_commit('-am', 'cm');
set @@global.new_default_branch='feat'"
dolt sql -q "use repo1"
}
Expand Down
Loading

0 comments on commit d3c4a9a

Please sign in to comment.