Version: 07.20.3239
Build: Feb 13 2024 (d698f21712)
One procedure works well with “SOAP” or “dba” user permissions:
Another procedure works well or returns “error 500” depends of SOAP user.
Problematic line in the procedure: foreach (any row in data) DO {
1
This 2 procedures will works well no matter if published with “SOAP” or “dba” user permissions:
1.1
create procedure XYZ.DBA.xyz_download (
out ret varchar
) {
for (sparql SELECT distinct * WHERE { ?s ?p ?o . } limit 5 ) DO {
ret := 'test';
}
}
1.2
create procedure XYZ.DBA.xyz_download (
out ret varchar
) {
declare qr, data, meta, message, state, env, ses any;
env := vector (dict_new (16000), 0, '', '', '', 0, 0, 0, 0, 0);
qr := 'sparql SELECT distinct * WHERE { ?s ?p ?o . } limit 5 ';
exec (qr, state, message, vector (), vector('use_cache', 1, 'max_rows', 0), meta, data);
ret := 'test';
}
2
This procedure works well published with “DBA” user permissions only:
create procedure XYZ.DBA.xyz_download (
out ret varchar
) {
declare qr, data, meta, message, state, env, ses any;
env := vector (dict_new (16000), 0, '', '', '', 0, 0, 0, 0, 0);
qr := 'sparql SELECT distinct * WHERE { ?s ?p ?o . } limit 5 ';
exec (qr, state, message, vector (), vector('use_cache', 1, 'max_rows', 0), meta, data);
foreach (any row in data) DO {
ret := 'test';
}
}
Or will return error then published with “SOAP” user permissions:
<faultstring>[Virtuoso SOAP server] SR016: Function length needs a string or array as its argument, not an argument of type 189 (= INTEGER)</faultstring>
The only difference between last two procedures:
foreach (any row in data) DO {
...
}
3 Question
Why “foreach” works for “dba” user only ?
Is it a bug or feature ?