Skip to content

Commit

Permalink
Merge pull request #54 from datajoint/stage-external-storage
Browse files Browse the repository at this point in the history
Fix crash related to parsing 8-byte strings
  • Loading branch information
eywalker authored Jul 17, 2020
2 parents 77733f7 + 15692ce commit 209f45d
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions +tests/TestInsertFetch.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ function TestInsertFetch_testInsertFetch(testCase)
testCase.CONN_INFO.password, 'false');
mym(curr_conn, ['create database `' testCase.PREFIX '_insert`;']);

% test random string
testCase.TestInsertFetch_check(testCase, curr_conn, 'varchar(7)','','S','raphael');
% test 8-byte ASCII string
testCase.TestInsertFetch_check(testCase, curr_conn, 'varchar(32)','','S', ...
'lteachen');
testCase.TestInsertFetch_check(testCase, curr_conn, 'longblob','','M', ...
int64([1;2]));
testCase.TestInsertFetch_check(testCase, curr_conn, 'varchar(4)','','S','ýýýý');
Expand Down
2 changes: 1 addition & 1 deletion LNX-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
- MYSQL_ROOT_PASSWORD=simple
fakeservices.datajoint.io:
<<: *net
image: raphaelguzman/nginx:v0.0.3
image: raphaelguzman/nginx:v0.0.8
environment:
- ADD_db_TYPE=DATABASE
- ADD_db_ENDPOINT=db:3306
Expand Down
Binary file modified distribution/mexa64/mym.mexa64
Binary file not shown.
Binary file modified distribution/mexmaci64/mym.mexmaci64
Binary file not shown.
Binary file modified distribution/mexw64/mym.mexw64
Binary file not shown.
3 changes: 2 additions & 1 deletion local-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ services:
# - ./mysql/data:/var/lib/mysql
fakeservices.datajoint.io:
<<: *net
image: raphaelguzman/nginx:v0.0.3
image: raphaelguzman/nginx:v0.0.8
environment:
- ADD_db_TYPE=DATABASE
- ADD_db_ENDPOINT=db:3306
ports:
- "80:80"
- "443:443"
- "3306:3306"
depends_on:
Expand Down
2 changes: 1 addition & 1 deletion src/mym.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1535,7 +1535,7 @@ char* serializeString(size_t &rnBytes, const mxArray*rpArray, const char*rpArg,
// matlab string
p_buf = (char*)mxCalloc(length+1, sizeof(char));
p_buf = mxArrayToString(rpArray);
p_buf = char2hex(p_buf, strlen(p_buf), length);
p_buf = char2hex(p_buf, strlen(p_buf), length + 1);
rnBytes = length;
}
else if (mxIsNumeric(rpArray)||mxIsLogical(rpArray)) {
Expand Down
2 changes: 1 addition & 1 deletion src/mym.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
// mym version information
#define MYM_VERSION_MAJOR 2
#define MYM_VERSION_MINOR 8
#define MYM_VERSION_BUGFIX 1
#define MYM_VERSION_BUGFIX 2


// some local defintion
Expand Down

0 comments on commit 209f45d

Please sign in to comment.