-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from datajoint/stage
Added support for {} in comments when creating tables
- Loading branch information
Showing
9 changed files
with
87 additions
and
33 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
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,5 +1,6 @@ | ||
classdef Main < ... | ||
TestConnection & ... | ||
TestDeclare & ... | ||
TestExternal & ... | ||
TestInsertFetch & ... | ||
TestTls | ||
|
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
classdef TestDeclare < Prep | ||
% TestDeclare tests typical connection scenarios. | ||
methods (Test) | ||
function TestDeclare_delcareTable(testCase) | ||
% Test table declare with comments that has \{ or \} | ||
st = dbstack; | ||
disp(['---------------' st(1).name '---------------']); | ||
conn1 = mym(-1, 'open', testCase.CONN_INFO.host, ... | ||
testCase.CONN_INFO.user, testCase.CONN_INFO.password, ... | ||
'false'); | ||
|
||
mym(conn1, ['create database `' testCase.PREFIX '_declare`']); | ||
mym(['create table {S}(id int, data varchar(30) default null) COMMENT "\{username\}_\{subject_nickname\}"'], ... | ||
sprintf('`%s_%s`.`%s`', testCase.PREFIX, 'declare', 'test_table')); | ||
query_string = mym(sprintf('SHOW CREATE TABLE `%s_%s`.`%s`', testCase.PREFIX, 'declare', 'test_table')); | ||
|
||
if ~strfind(query_string.('Create Table'){1}, 'COMMENT=''{username}_{subject_nickname}''') | ||
throw(MException('TestDeclare:invalidDeclareTable',... | ||
'Table comments got inserted incorrectly')); | ||
end | ||
mym(conn1, ['drop database `' testCase.PREFIX '_declare`']); | ||
mym(conn1, 'close'); | ||
end | ||
end | ||
end |