Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion +dj/+internal/GeneralRelvar.m
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ function clip(self)
for iArg=1:length(specs)
% if renamed, use the renamed attribute
name = regexp(specs{iArg}, '(\w+)\s*$', 'tokens');
if isnumeric(s(1).(name{1}{1})) && length(s(1).(name{1}{1})) == 1
sel = cellfun(@(x) strcmp(x, name{1}), {self.header.attributes.name});
if self.tableHeader.attributes(sel).isNumeric
varargout{iArg} = [s.(name{1}{1})]';
else
varargout{iArg} = {s.(name{1}{1})}';
Expand Down
6 changes: 3 additions & 3 deletions LNX-docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# docker-compose -f LNX-docker-compose.yaml --env-file LNX.env up --build --exit-code-from app
# docker-compose -f LNX-docker-compose.yaml --env-file LNX.env up --exit-code-from app --build
version: '2.2'
x-net: &net
networks:
Expand Down Expand Up @@ -29,7 +29,7 @@ services:
interval: 1s
fakeservices.datajoint.io:
<<: *net
image: raphaelguzman/nginx:v0.0.11
image: datajoint/nginx:v0.0.15
environment:
- ADD_db_TYPE=DATABASE
- ADD_db_ENDPOINT=db:3306
Expand Down Expand Up @@ -120,4 +120,4 @@ services:
- ./tests:/tmp/tests
- .:/src
networks:
main:
main:
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ MYSQL_TAG=5.7
| ---------------------------- | ------------------------------------------------------------------------------ |
| Run all tests | `run(Main)` |
| Run one class of tests | `run(TestTls)` |
| Run one specific test | `runtests('TestTls/testInsecureConn')` |
| Run one specific test | `runtests('TestTls/TestTls_testInsecureConn')` |
| Run tests based on test name | `import matlab.unittest.TestSuite;`<br>`import matlab.unittest.selectors.HasName;`<br>`import matlab.unittest.constraints.ContainsSubstring;`<br>`suite = TestSuite.fromClass(?Main, ... `<br><code>&nbsp;&nbsp;&nbsp;&nbsp;</code>`HasName(ContainsSubstring('Conn')));`<br>`run(suite)`|


Expand Down
2 changes: 1 addition & 1 deletion docs-parts/definition/07-Primary-Key_lang1.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. code-block:: matlab

key.scah_idx = fetch1(Scan & key, 'next=max(scan_idx)+1')
key.scan_idx = fetch1(Scan & key, 'max(scan_idx)+1 -> next')

5 changes: 5 additions & 0 deletions docs-parts/intro/Releases_lang1.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
3.4.2 -- March 16, 2021
--------------------------
* Bugfix: Fetchn with zero results throws an error (#353) PR #???
* Bugfix: Syntax error in documentation for next auto_increment value (#352) PR #???

3.4.1 -- December 18, 2020
--------------------------
* Bugfix: Error on accessing unmanaged Imported/Computed tables (#336) PR #338
Expand Down
22 changes: 22 additions & 0 deletions tests/TestFetch.m
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,28 @@ function TestFetch_testNullable(testCase)
testCase.verifyEqual(number(1), NaN);
testCase.verifyEqual(blob{1}, '');
end
function TestFetch_testFetchn(testCase)
st = dbstack;
disp(['---------------' st(1).name '---------------']);
% related to % https://github.com/datajoint/datajoint-matlab/issues/353
package = 'University';

c1 = dj.conn(...
testCase.CONN_INFO.host,...
testCase.CONN_INFO.user,...
testCase.CONN_INFO.password,'',true);

dj.createSchema(package,[testCase.test_root '/test_schemas'], ...
[testCase.PREFIX '_university']);

q = University.A & 'id=999';
testCase.verifyEqual(q.fetchn('id'), []);
testCase.verifyEqual(q.fetchn('string'), {});
testCase.verifyEqual(q.fetchn('datetime'), {});
testCase.verifyEqual(q.fetchn('date'), {});
testCase.verifyEqual(q.fetchn('number'), []);
testCase.verifyEqual(q.fetchn('blob'), {});
end
function TestFetch_testDescribe(testCase)
st = dbstack;
disp(['---------------' st(1).name '---------------']);
Expand Down