Hi Quentin,
Testing against the latest development archive the server does not crash, thus
this issue should be resolved in the final VOS stable/7 release being prepared:
SQL> create procedure test.test.resultsetCrash( ) { declare meta, _dt any;
declare query, query2, errorCode, errorMessage varchar; declare inx integer;
declare parameters vector; parameters := vector(); query := 'sparql select ?S
?P ?O {GRAPH <ResultsetCrashTest> { {{ select distinct ?S { ?S a ?class } limit
1 offset 1 }} ?S ?P ?O . }}'; exec (query, errorCode, errorMessage, vector(),
0, meta, _dt); declare meta2, _dt2 any; declare errorCode2, errorMessage2
varchar; query2 := 'sparql select count(distinct ?S) as ?count { GRAPH
<ResultsetCrashTest> { ?S a ?class . }}'; declare entCount integer; declare
entVector any; exec (query, errorCode, errorMessage, vector(), 0, meta, _dt);
if (meta <> 0) { exec_result_names (meta[0]); inx := 0; if (_dt <> 0) {
while (inx < length (_dt)) { exec_result (_dt[inx]); inx := inx
+ 1; } declare meta, _dt any; declare errorCode, errorMessage varchar;
declare inx integer; end_result(); exec (query2, errorCode, errorMessage,
vector(), 0, meta, _dt); exec_result (_dt[0]); } } }
Done. -- 3 msec.
SQL>
SQL> sparql drop silent graph <ResultsetCrashTest>;
Done. -- 47 msec.
SQL> sparql
Type the rest of statement, end with a semicolon (;)> insert into graph
<ResultsetCrashTest>
Type the rest of statement, end with a semicolon (;)> {
Type the rest of statement, end with a semicolon (;)> <s1> a <class> .
Type the rest of statement, end with a semicolon (;)> <s2> a <class> .
Type the rest of statement, end with a semicolon (;)> <s3> a <class> .
Type the rest of statement, end with a semicolon (;)> <s1> <name>
"s1"^^xsd:string .
Type the rest of statement, end with a semicolon (;)> <s2> <name>
"s2"^^xsd:string .
Type the rest of statement, end with a semicolon (;)> <s3> <name>
"s3"^^xsd:string .
Type the rest of statement, end with a semicolon (;)> };
Done. -- 122 msec.
SQL> test.test.resultsetCrash();
S
P
O
VARCHAR
VARCHAR
VARCHAR
_______________________________________________________________________________
s2
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
class
s2
name
s2
2 Rows. -- 4 msec.
SQL>
Best Regards
Hugh Williams
Professional Services
OpenLink Software, Inc. // http://www.openlinksw.com/
Weblog -- http://www.openlinksw.com/blogs/
LinkedIn -- http://www.linkedin.com/company/openlink-software/
Twitter -- http://twitter.com/OpenLink
Google+ -- http://plus.google.com/100570109519069333827/
Facebook -- http://www.facebook.com/OpenLinkSoftware
Universal Data Access, Integration, and Management Technology Providers
On 5 Feb 2014, at 23:33, Quentin <quent...@clearbluewater.com.au> wrote:
> I believe it's just an effect of calling exec_result with a row that doesn't
> match the columns declared to exec_result_names, with that in mind, I've
> simplified the test case.
>
> =====================================================================
> create procedure
> test.test.resultsetCrash( )
> {
>
> declare meta, _dt any;
> declare query, query2, errorCode, errorMessage varchar;
> declare inx integer;
> declare parameters vector;
> parameters := vector();
>
> query := 'sparql
> select ?S ?P ?O
> {GRAPH <ResultsetCrashTest> {
> {{ select distinct ?S { ?S a ?class } limit 1 offset 1 }}
> ?S ?P ?O .
> }}';
>
> exec (query, errorCode, errorMessage, vector(), 0, meta, _dt);
>
> declare meta2, _dt2 any;
> declare errorCode2, errorMessage2 varchar;
>
> query2 := 'sparql
> select count(distinct ?S) as ?count
> { GRAPH <ResultsetCrashTest> {
> ?S a ?class .
> }}';
>
> declare entCount integer;
> declare entVector any;
>
> exec (query, errorCode, errorMessage, vector(), 0, meta, _dt);
> if (meta <> 0) {
> exec_result_names (meta[0]);
> inx := 0;
> if (_dt <> 0) {
> while (inx < length (_dt))
> {
> exec_result (_dt[inx]);
> inx := inx + 1;
> }
>
> declare meta, _dt any;
> declare errorCode, errorMessage varchar;
> declare inx integer;
>
> end_result();
> exec (query2, errorCode, errorMessage, vector(), 0, meta, _dt);
> exec_result (_dt[0]);
> }
> }
> }
> =====================================================================
>
> sparql drop silent graph <ResultsetCrashTest>;
> sparql
> insert into graph <ResultsetCrashTest>
> {
> <s1> a <class> .
> <s2> a <class> .
> <s3> a <class> .
> <s1> <name> "s1"^^xsd:string .
> <s2> <name> "s2"^^xsd:string .
> <s3> <name> "s3"^^xsd:string .
> };
> test.test.resultsetCrash();
> -- The crash has already occurred.
> =====================================================================
>
>
> On 5 February 2014 22:03, Hugh Williams <hwilli...@openlinksw.com> wrote:
> Hi Quentin,
>
> Can you provide the complete compilable and runnable procedure you are
> running that is causing the crash, as I cannot get the snippet you have
> provide below to create ...
>
> Best Regards
> Hugh Williams
> Professional Services
> OpenLink Software, Inc. // http://www.openlinksw.com/
> Weblog -- http://www.openlinksw.com/blogs/
> LinkedIn -- http://www.linkedin.com/company/openlink-software/
> Twitter -- http://twitter.com/OpenLink
> Google+ -- http://plus.google.com/100570109519069333827/
> Facebook -- http://www.facebook.com/OpenLinkSoftware
> Universal Data Access, Integration, and Management Technology Providers
>
> On 5 Feb 2014, at 07:45, Quentin <quent...@clearbluewater.com.au> wrote:
>
>> Hi,
>>
>> Running develop7 with a procedure that attempts to return two result sets.
>> Probably not wise but I was experimenting with ways to return metadata about
>> a query.
>>
>> The procedure did something including:
>> ==================
>> ...other stuff...
>> query := 'select ?S ?P ?O {....} limit 10 offset 20';
>> exec (query, errorCode, errorMessage, vector(), 0, meta, _dt);
>> if (meta <> 0) {
>> exec_result_names (meta[0]);
>> inx := 0;
>> if (_dt <> 0) {
>> while (inx < length (_dt))
>> {
>> exec_result (_dt[inx]);
>> inx := inx + 1;
>> }
>> }
>> } else exec_result_names(vector('?NullRecords'));
>>
>> declare meta, _dt any;
>> declare errorCode, errorMessage varchar;
>> declare inx integer;
>>
>> query := 'select count (distinct ?S) as ?count {....}';
>> end_result();
>> exec (query, errorCode, errorMessage, vector(), 0, meta, _dt);
>> exec_result (_dt[0]);
>> }
>> ==================
>>
>> I wasn't really expecting it to work but a server crash seems worth
>> reporting.
>>
>> As an aside, does anyone have any advice on how to return something like a
>> count of total rows together in the same query that returns a paginated set
>> of rows?
>>
>> I'm actually paginating the entities themselves and would like to be able to
>> report the number of entities in the same procedure so as to avoid
>> unnecessary pagination.
>> --
>> Quentin | Clear Blue Water Pty Ltd
>> quent...@clearbluewater.com.au
>> ------------------------------------------------------------------------------
>> Managing the Performance of Cloud-Based Applications
>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
>> Read the Whitepaper.
>> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk_______________________________________________
>> Virtuoso-users mailing list
>> Virtuoso-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
>
>
>
>
> --
> Quentin | Clear Blue Water Pty Ltd
> quent...@clearbluewater.com.au
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk_______________________________________________
> Virtuoso-users mailing list
> Virtuoso-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users