forked from dajobe/rasqal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChangeLog.5
3234 lines (2548 loc) · 124 KB
/
ChangeLog.5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
2007-12-28 Dave Beckett <dave@dajobe.org>
* utils/srxread.c: init fh
* utils/srxread.c: init before arg check
* utils/srxread.c: Pass variable_names ownership
* utils/srxread.c: use memset properly
* src/rasqal_query.c: (rasqal_query_execute): Initialise
variable_names using rasqal_query_results_set_variables.
* src/rasqal_engine.c: (rasqal_engine_query_result_row_print):
Renamed to public rasqal_query_result_row_print.
* src/rasqal_query_results.c: (rasqal_free_query_results): Free
variable_names
(rasqal_query_results_set_variables): set variable_names.
(rasqal_query_result_row_print): Added - renamed from
rasqal_engine_query_result_row_print.
* src/rasqal_internal.h: struct rasqal_query_results_s gains field
variable_names.
Added rasqal_query_result_row_print prototype
* utils/Makefile.am: Remove srxread_CPPFLAGS
* utils/srxread.c: Use 1.4.17 raptor API
* configure.ac: Require raptor 1.4.17 for SAX2 API
* configure.ac, RELEASE.html, NEWS.html, src/win32_rasqal_config.h:
Bump version to 0.9.16
Update libtool version to 1:0:0
2007-12-09 Dave Beckett <dave@dajobe.org>
* utils/Makefile.am, utils/srxread.c: Added test SPARQL XML
results reader. Incomplete
* src/rasqal_engine.c, src/rasqal_internal.h, src/rasqal_query.c,
src/rasqal_query_results.c,
utils/Makefile.am: (rasqal_new_query_result_row,
rasqal_new_query_result_row_from_query_result_row,
rasqal_free_query_result_row): Added based on previously
engine-specific rasqal_engine_new_query_result_row,
rasqal_engine_new_query_result_row_from_query_result_row and
rasqal_engine_free_query_result_row.
(rasqal_new_query_result_row): No longer does the
rasqal_engine_query_result_row_update work, so that has to be
called externally.
(rasqal_engine_excute_next_lazy): Call
rasqal_engine_query_result_row_update after
rasqal_new_query_result_row.
(rasqal_query_results_set_variables,
(rasqal_query_results_set_order_conditions): Added.
(rasqal_query_execute): Call rasqal_query_results_set_variables
and rasqal_query_results_set_order_conditions.
* src/rasqal_engine.c: Switch to non-lazy execution
* src/rasqal_engine.c: Add RASQAL_ENGINE_EVAL_LAZY macro to
enable/disable lazy evaluation. Existing code and default is
enabled.
(rasqal_engine_check_limit_offset): Limit to 1 result when query
is an ASK.
(rasqal_engine_new_query_result_row): Allow non-bindings,
non-graph queries to enter here, when doing ASK for example.
(rasqal_engine_execute_and_save): Allow map to be optional if
need_map is not true.
(rasqal_engine_execute_run): Use RASQAL_ENGINE_EVAL_LAZY to call
lazy or save version of execution.
2007-11-29 Lauri Aalto <laalto@iki.fi>
* src/rasqal.h: Guard against double declaration of
rasqal_query_results_formatter.
2007-11-26 Dave Beckett <dave@dajobe.org>
* autogen.sh: Update to handle OSX glibtoolize and optional ltdl
2007-11-19 Lauri Aalto <laalto@iki.fi>
* src/rasqal_expr.c: (rasqal_expression_evaluate) Fix memory leak
in RASQAL_EXPR_LANG.
* tests/sparql/ExprBuiltins/Makefile.am,
tests/sparql/ExprEquals/Makefile.am: Revert r13225 - make check to
pass with svn HEAD raptor
* src/rasqal_query.c, src/rasqal_result_formats.c: Reapply r13173
reverted in r13199 - compile cleanly against svn HEAD raptor.
2007-11-17 Dave Beckett <dave@dajobe.org>
* Snapshotted rasqal_0_9_15 for 0.9.15 release (SVN 13232)
* tests/sparql/ExprBuiltins/Makefile.am,
tests/sparql/ExprEquals/Makefile.am: Revert test results to match
builing with raptor 1.4.16
* src/rasqal_literal.c: (rasqal_new_decimal_literal): Fix after
doc change
* docs/rasqal-sections.txt, docs/tmpl/section-unused.sgml: docs
* docs/tmpl/section-literal.sgml, docs/tmpl/section-unused.sgml,
docs/tmpl/section-xsd.sgml: docs
* src/rasqal_datetime.c: docs
* src/rasqal_literal.c: docs
* docs/rasqal-sections.txt: update new functions
2007-11-15 Dave Beckett <dave@dajobe.org>
* src/rasqal.h, src/rasqal_literal.c, src/sparql_lexer.l: Restore
rasqal_new_decimal_literal back to APi signature from 0.9.14. Add
rasqal_new_decimal_literal_from_decimal to build from a
rasqal_xsd_decimal
2007-11-15 Lauri Aalto <laalto@iki.fi>
* src/rasqal_expr.c: (rasqal_expression_as_boolean,
rasqal_expression_as_integer, rasqal_expression_compare) Removed
unused functions - eliminates compiler warnings.
2007-11-14 Dave Beckett <dave@dajobe.org>
* src/rasqal_query.c, src/rasqal_result_formats.c: Revert r13173
for compiling against raptor 1.4.16 (or earlier)
raptor_uri_handler
2007-11-14 Lauri Aalto <laalto@iki.fi>
* src/rasqal_datetime.c: Fix copyright notice - it's all this
year. Add contributions notice.
Move tests to main().
2007-11-13 Lauri Aalto <laalto@iki.fi>
* src/rasqal_raptor.c: indent tabs -> spaces
2007-11-13 Dave Beckett <dave@dajobe.org>
* configure.ac: Require raptor 1.4.16 for uri compare factory method
* src/rasqal_literal.c: (rasqal_literal_ebv): Handle decimal zero
* src/rasqal.h: Added rasqal_xsd_decimal_is_zero prototype
* src/rasqal_decimal.c: (rasqal_xsd_decimal_is_zero): Added.
(rasqal_xsd_decimal_divide): Use rasqal_xsd_decimal_is_zero.
* src/Makefile.am, src/rasqal_datetime.c (from
/rasqal/trunk/src/rasqal_xsd_datatypes.c:13190),
src/rasqal_internal.h, src/rasqal_xsd_datatypes.c: Added
rasqal_datetime.c for XSD dateTime code. Added
rasqal_xsd_datetime_check() internal function for checking
* tests/laqrs/syntax/Makefile.am, tests/laqrs/syntax/insert.rq:
Added insert.rq
* docs/tmpl/section-expression.sgml,
docs/tmpl/section-literal.sgml, docs/tmpl/section-unused.sgml:
docs updates
* tests/sparql/examples/Makefile.am:
sparql-query-example-Testing-Values-0 now passes
* src/rasqal_raptor.c: (rasqal_raptor_bind_match): Use
rasqal_literal_equals_flags with RASQAL_COMPARE_RDF to compare for
equality. Also, this may be cheaper than using
rsaqal_literal_compare.
* src/rdql_parser.y: Set RDQL default compare_flags to
RASQAL_COMPARE_URI
* src/sparql_parser.y: add missing ;
2007-11-12 Dave Beckett <dave@dajobe.org>
* src/rasqal_engine.c:
(rasqal_query_result_literal_sequence_compare): Call
rasqal_literal_compare with RASQAL_COMPARE_URI
* src/rasqal_literal.c: (rasqal_literal_compare): Use
RASQAL_COMPARE_URI to allow comparison of URIs. It's not allowed
via the < operator but is ok when using literal with SPARQL ORDER
BY
* src/rasqal.h: rasqal_compare_flags add RASQAL_COMPARE_URI
* tests/sparql/check-sparql: Invoke roqet correctly with named graphs
* Last known good revision 13179: 'make check' succeeds.
* src/rasqal_literal.c: (rasqal_literal_equals_flags): For XQUERY
style, try RDF term equality if numeric promotion fails.
Add debug messages
2007-11-12 Lauri Aalto <laalto@iki.fi>
* src/rasqal_internal.h, src/rasqal_xsd_datatypes.c: Pulled
rasqal_xsd_datatype_info from rasqal_xsd_datatypes.c to
rasqal_internal.h
* src/rasqal_query.c, src/rasqal_result_formats.c: Make
raptor_uri_handlers const.
2007-11-11 Dave Beckett <dave@dajobe.org>
* src/rasqal_expr.c: (rasqal_expression_evaluate): Revert:
RASQAL_EXPR_NEQ return type errors again.
* src/rasqal_internal.h: Update rasqal_literal_string_to_native
prototype
* src/rasqal_literal.c: (rasqal_literal_string_to_native): Add
flags arg to use to pass on to rasqal_xsd_datatype_check.
(rasqal_new_string_literal): Call rasqal_literal_string_to_native
with flags=1 so that a literal with a bad lexical form is kept but
never converted to native type.
(rasqal_literal_expand_qname): Call
rasqal_literal_string_to_native with flags=0 for original check.
* src/rasqal_expr.c: (rasqal_expression_evaluate): RASQAL_EXPR_NEQ
type errors are not equal.
2007-11-07 Lauri Aalto <laalto@iki.fi>
* src/rasqal_general.c: (rasqal_uri_init) Check for oom.
(rasqal_uri_finish) Do not leave dangling pointers.
2007-11-06 Lauri Aalto <laalto@iki.fi>
* src/rasqal_feature.c: fix eol style
* src/rasqal.h: Allow RASQAL_API to be externally defined e.g. in
a static config.h. Remove __SYMBIAN32__ case.
* src/rasqal_internal.h: Allow flagging out writable static data
in RASQAL_DEPRECATED macros with NO_STATIC_DATA.
* src/rasqal_expr.c, src/rasqal_feature.c,
src/rasqal_graph_pattern.c, src/rasqal_literal.c,
src/rasqal_query.c, src/rasqal_xsd_datatypes.c: Remove writable
static data. Make const arrays const.
2007-10-31 Lauri Aalto <laalto@iki.fi>
* src/rasqal_expr.c: (rasqal_expression_evaluate) Avoid
division-by-zero exceptions in RASQAL_EXPR_REM.
* src/rasqal_expr.c: (rasqal_expression_evaluate) Ensure NULL
result and no leaks on error.
* src/rasqal_expr.c: (rasqal_expression_evaluate) Do not leak
literal args in DATATYPE expressions.
2007-10-30 Lauri Aalto <laalto@iki.fi>
* src/rasqal_graph_pattern.c, src/rasqal_query.c: Move
rasqal_graph_pattern_* functions from rasqal_query.c to
rasqal_graph_pattern.c
* src/rdql_lexer.l: Lowmem leak fixes. Merged experimental lexer
leak prevention code from sparql_lexer r12922.
Flagged with LEXER_ALLOC_TRACKING, disabled by default.
2007-10-29 Dave Beckett <dave@dajobe.org>
* tests/sparql/ExprEquals/Makefile.am: "Equality - 2 var - test
equals" now passes
* tests/sparql/ExprBuiltins/Makefile.am: str-2 now passes
* src/rasqal_literal.c: (rasqal_literal_get_rdf_term_type): Not
static and use parent type to handle XSD numeric sub-types.
* src/rasqal_internal.h: Add rasqal_literal_get_rdf_term_type
* src/rasqal_expr.c: (rasqal_expression_evaluate):
RASQAL_EXPR_LANG and RASQAL_EXPR_DATATYPE: Handle only for RDF
Term literals including INTEGER etc using
rasqal_literal_get_rdf_term_type() RASQAL_EXPR_ISLITERAL: Use
rasqal_literal_get_rdf_term_type() to check for
literal type.
2007-10-29 Lauri Aalto <laalto@iki.fi>
* src/rasqal_literal.c: (rasqal_literal_set_typed_value) Don't
need to copy literal string if no new string passed in.
* src/rasqal_literal.c: (rasqal_new_typed_literal) Ensure type is
set before calling rasqal_free_literal().
(rasqal_literal_set_typed_value) Do not free strings that are not
owned.
* src/rasqal_literal.c: (rasqal_literal_set_typed_value) Do not
leak string
* src/rasqal_literal.c: (rasqal_new_decimal_literal) Return NULL
if rasqal_xsd_datatype_type_to_uri() fails.
* src/rasqal_literal.c: (rasqal_literal_set_typed_value) Fix
leaking datatype uris
* src/rasqal_literal.c: (rasqal_new_decimal_literal) Make a copy
of datatype uri.
* src/rasqal_literal.c: (rasqal_new_typed_literal) Do not return
stale pointers.
2007-10-28 Dave Beckett <dave@dajobe.org>
* tests/rdql/testsuite/check-rdql: Remove xsd:string mutation
* src/rasqal_literal.c: (rasqal_literal_string_to_native): Remove
removal of xsd:string datatype.
(rasqal_literal_string_equals): Make "xx" and "xx"^^xsd:string
compare equal here.
* tests/sparql/ExprEquals/Makefile.am: "Equality 1-1 -- graph" and
"Equality 1-2 -- graph" now fail
* tests/sparql/ValueTesting/Makefile.am: extendedType-ne-fail
extendedType-literal-ne now pass
* src/rasqal_literal.c: (rasqal_literal_string_to_native): Turn
"xx"^^xsd:string into "xx"
(rasqal_literal_string_equals): Added, pulled out of
rasqal_literal_equals_flags.
(rasqal_literal_equals_flags): Update SPARQL checks - do
promotions only for sparql. Give type error if have incompatible
types. Mov RASQAL_LITERAL_PATTERN and RASQAL_LITERAL_QNAME into
error case; these should never be compared.
* src/rasqal_expr.c: (rasqal_expression_evaluate): Use
rasqal_literal_equals_flags for RASQAL_EXPR_EQ and
RASQAL_EXPR_NEQ. Implement RASQAL_EXPR_SAMETERM with
rasqal_literal_equals_flags too.
* src/rdql_lexer.l: Double constant preserves the string using
rasqal_new_typed_literal
* tests/rdql/testsuite/check-rdql: (toDebug): Turn
"xx"^^xsd:string into "xx" Unidiffs
* tests/rdql/testsuite/Makefile.am: Failing tests now 1-09 B-17
* src/rasqal_raptor.c: (rasqal_raptor_triple_match): Match RDF
terms with rasqal_literal_equals_flags and RASQAL_COMPARE_RDF.
2007-10-28 Lauri Aalto <laalto@iki.fi>
* src/rasqal_expr.c: (rasqal_expression_evaluate) double var no
longer needed after unary minus changes in r13091
2007-10-28 Dave Beckett <dave@dajobe.org>
* src/rasqal_engine.c: (rasqal_query_result_literal_sequence_compare):
Revert: use query compare flags since that is based on the 'A < B'
operator which is value comparison.
* src/rasqal_engine.c: (rasqal_query_result_literal_sequence_compare):
Compare as RDF Terms always.
(rasqal_query_result_literal_sequence_equals): Equality as RDF
Terms always.
* src/rasqal_literal.c: (rasqal_literal_get_rdf_term_type): Added.
(rasqal_literal_compare): Do not always promote - saves copying
objects. Add RASQAL_COMPARE_RDF to compare as RDF terms.
(rasqal_literal_equals_flags): Add RASQAL_COMPARE_RDF to check for
equality as RDF terms. Uses rasqal_literal_get_rdf_term_type()
Add a quick check for string compares - not equal if lengths are
different.
* src/rasqal.h: Added rasqal_compare_flags enum RASQAL_COMPARE_RDF
for comparing as RDF terms.
2007-10-28 Lauri Aalto <laalto@iki.fi>
* tests/rdql/testsuite/Makefile.am,
tests/sparql/ExprBuiltins/Makefile.am: RDQL B-07 B-20 tests now
pass. SPARQL str-1 test now passes.
* src/rasqal_decimal.c: (rasqal_xsd_decimal_negate) Fix
RASQAL_DECIMAL_GMP negation.
2007-10-27 Dave Beckett <dave@dajobe.org>
* src/rasqal_literal.c: (rasqal_literal_as_node): Copy NUL when
stringifying.
* src/rasqal_xsd_datatypes.c: (rasqal_xsd_format_double): Correct len
* src/rasqal_literal.c: (rasqal_literal_set_typed_value): Do not
try to canonicalize DOUBLE values.
* src/rasqal_literal.c: (rasqal_literal_set_typed_value): Set
string len for dateTime
(rasqal_literal_as_node): strncpy
* src/sparql_lexer.l: Use rasqal_xsd_datatype_check to check for
decimal and double syntax rather than scanf.
* src/rasqal_literal.c: (rasqal_new_literal_from_promotion): less
debug output
* Last known good revision 13092: 'make check' succeeds.
* src/rasqal_literal.c: (rasqal_literal_negate): Init type
* src/rasqal_expr.c: (rasqal_expression_evaluate): For
RASQAL_EXPR_UMINUS use rasqal_literal_negate
* src/rasqal_internal.h: Added rasqal_literal_negate prototype
* src/rasqal_literal.c: (rasqal_literal_add,
rasqal_literal_subtract, rasqal_literal_multiply,
rasqal_literal_divide): Promote to get to decimals for evaluation.
(rasqal_literal_negate): Added.
* src/rasqal.h: Added rasqal_xsd_decimal_negate
* src/rasqal_decimal.c: (rasqal_xsd_decimal_negate): Added
* src/rasqal_literal.c: (rasqal_new_decimal_literal): Set literal type
* src/rasqal_literal.c: (rasqal_literal_string_to_native): Do not
call rasqal_free_literal here.
* src/rasqal_literal.c: (rasqal_literal_add,
rasqal_literal_subtract, rasqal_literal_multiply,
rasqal_literal_divide): Do calculations as integer, double or
decimal.
* src/rasqal_literal.c: (rasqal_new_decimal_literal): Add decimal
arg to construct a new decimal literal based on a string or XSD
Decimal.
* src/sparql_lexer.l: Update rasqal_new_decimal_literal call
* src/rasqal.h: rasqal_new_decimal_literal takes string / decimal.
* src/rasqal_literal.c: (rasqal_literal_set_typed_value): Allow
string to be NULL to use existing literal string.
(rasqal_literal_string_to_native): Use NULL above
* src/rasqal_literal.c: Everwhere: only write to *error if error
is not NULL.
(rasqal_literal_set_typed_value): Free any existing string before
overwriting.
* src/rasqal_literal.c: (rasqal_literal_set_typed_value): Copy NULL
* src/rasqal_literal.c: Fix casts
* src/sparql_lexer.l: Use rasqal_new_typed_literal for integer.
* src/rasqal_literal.c: (rasqal_literal_set_typed_value): Added,
pulled out of rasqal_literal_string_to_native.
(rasqal_new_typed_literal, rasqal_new_decimal_literal,
rasqal_literal_string_to_native): Altered to use
rasqal_literal_set_typed_value removing duplicate code for setting
decimals.
* src/rasqal.h: rasqal_new_typed_literal renamed from
rasqal_new_integer_literal_from_string
* src/rasqal_engine.c: (rasqal_query_result_literal_sequence_equals):
Pass on any type errors as not equal.
* src/rasqal_internal.h: rasqal_literal_equals_flags add error
pointer arg.
* src/rasqal_literal.c: (rasqal_literal_equals_flags): Add an
error pointer arg.
* docs/tmpl/section-xsd.sgml: XSD Decimals templaet
* src/rasqal_decimal.c: Autodocs
* docs/rasqal-sections.txt: Add new functions
* docs/rasqal-docs.xml: Added section-xsd
2007-10-27 Lauri Aalto <laalto@iki.fi>
* src/rasqal_literal.c: (rasqal_new_integer_literal_from_string)
Need to have literal usage and type set before calling
rasqal_free_literal() on failure.
2007-10-27 Dave Beckett <dave@dajobe.org>
* src/sparql_lexer.l: Use rasqal_new_integer_literal_from_string
for integer literal. Remove hex literals - they are not allowed in
SPARQL.
* src/rasqal.h,
src/rasqal_literal.c: (rasqal_new_integer_literal_from_string):
Added to preserve integer literal original lexical form.
* src/rasqal_internal.h,
src/rasqal_literal.c: (rasqal_literal_promote_numerics): Renamed
from rasqal_literal_promote_calculate
2007-10-25 Lauri Aalto <laalto@iki.fi>
* src/rasqal_query.c: (rasqal_query_prepare_count_graph_patterns)
Prevent a later lowmem crash caused by graph pattern count and
graph pattern sequence getting out of sync.
* src/rasqal_decimal.c: (rasqal_xsd_decimal_as_string) Better
formatting with RASQAL_DECIMAL_NONE
(main) Ignore rasqal_decimal_test failures with
RASQAL_DECIMAL_NONE - insufficient precision with doubles. Test
for <0, ==0 or >0 when testing rasqal_xsd_decimal_compare(), not
exact value like -1.
* src/rasqal_map.c: (rasqal_map_node_add_kv) Return error if
rasqal_new_map_node() failed
* src/rasqal_map.c: (rasqal_map_add_kv) Return error if
rasqal_new_map_node() failed
* src/rasqal_expr.c: (rasqal_expression_evaluate) Remove memset()
overhead - init vars when actually needed.
2007-10-24 Lauri Aalto <laalto@iki.fi>
* src/rasqal_expr.c: (rasqal_expression_evalate) Fix bug in
RASQAL_EXPR_OR and refactor RASQAL_EXPR_{AND,OR}.
* src/rasqal_expr.c: (rasqal_expression_evaluate_strmatch,
rasqal_expression_evaluate) Init error vars to zero
* src/rasqal_expr.c: (rasqal_expression_evaluate_strmatch) Pulled
function from rasqal_expression_evaluate().
(rasqal_expression_evaluate) Reduce stack consumption of a
recursive function by about 90% (depending on compiler and
architecture) - do not allocate separate variables for each switch
case and pack in unions variables that are not needed
simultaneously.
* src/rasqal_literal.c: (rasqal_literal_string_to_native) Lowmem
leak fix: make sure decimal literal string is not leaked.
* src/rasqal_literal.c: (rasqal_free_literal) Do not leak decimal
literal datatype uris.
2007-10-23 Dave Beckett <dave@dajobe.org>
* src/rasqal_literal.c: (rasqal_literal_print): Write URIs out
properly escaped Unicode.
2007-10-23 Lauri Aalto <laalto@iki.fi>
* src/rasqal_expr.c: (rasqal_expression_evaluate) Check for alloc
failures
2007-10-22 Lauri Aalto <laalto@iki.fi>
* src/rasqal_literal.c: (rasqal_new_literal_from_promotion) Fix
rasqal_new_integer_literal() params.
(rasqal_literal_rdql_promote_calculate) Fix lits array init.
2007-10-22 Dave Beckett <dave@dajobe.org>
* tests/sparql/check-sparql: fix curdir
* tests/sparql/check-sparql: Remove curdir from debug outputs
* docs/tmpl/section-triple.sgml: Added RASQAL_TRIPLE_GRAPH,
RASQAL_TRIPLE_SPO and RASQAL_TRIPLE_SPOG
* docs/tmpl/section-expression.sgml: Added RASQAL_EXPR_SAMETERM
* src/rasqal_literal.c: (rasqal_literal_compare): Restore d assignment
* src/rasqal_literal.c: Remove unused double_to_int
* src/rasqal_literal.c: (rasqal_literal_rdql_promote_calculate):
Pull out of rasqal_literal_compare
(rasqal_literal_compare): Use above.
* Last known good revision 13011: 'make check' succeeds.
* src/rasqal_literal.c: (rasqal_literal_compare): Fix xquery
compare ordering when types are different and cannot promote.
* src/rasqal_literal.c: (rasqal_literal_compare): Fix float/double
compare.
* src/rasqal_literal.c: (rasqal_literal_compare): Fix float/double
compare with fabs
* src/rasqal_literal.c: (rasqal_literal_compare): Return type
error if rasqal_new_literal_from_promotion fails
* src/rasqal_literal.c: (rasqal_new_literal_from_promotion):
Handle rasqal_new_literal_from_promotion failing.
* src/rasqal_literal.c: death in debug message
* src/rasqal_literal.c: casts for warnings
* src/rasqal_literal.c: (rasqal_new_literal_from_promotion): Do
not assume l->string is set.
* src/rasqal_literal.c: (rasqal_new_literal_from_promotion): Allow
nop promotion
* src/rasqal_literal.c: (rasqal_literal_compare): Fix error from
string compare.
* src/rasqal_literal.c: docs
(rasqal_literal_compare): Fix uri compare.
* src/rasqal_literal.c: (rasqal_literal_string_compare): Added,
pulled out of rasqal_literal_compare.
(rasqal_literal_compare): Call above.
* src/rasqal_literal.c: (rasqal_new_literal_from_promotion): Call
rasqal_new_string_literal with copy of string which is an input
parameter.
* src/rasqal_literal.c: (rasqal_new_literal_from_promotion):
Added, pulled out of rasqal_literal_compare.
(rasqal_literal_compare): Use above.
* src/rasqal_literal.c: (rasqal_literal_equals_flags): Start to
add XQuery/SPARQL promotions.
* src/rasqal_literal.c: (rasqal_literal_equals_flags): Added
* src/rasqal_engine.c:
(rasqal_query_result_literal_sequence_equals): Added to compare
two arrays of literal for equality
(rasqal_engine_query_result_row_compare): Use
rasqal_query_result_literal_sequence_equals when just doing
distinct, no sorting.
* src/rasqal_internal.h: Added rasqal_literal_equals_flags prototype
2007-10-21 Lauri Aalto <laalto@iki.fi>
* src/rasqal_decimal.c: Make rasqal_decimal.c compile with
RASQAL_DECIMAL_NONE
* src/rasqal_decimal.c: (rasqal_xsd_decimal_equals) Catch flagging
error and prevent warning about uninitialized rc variable.
2007-10-21 Dave Beckett <dave@dajobe.org>
* src/rasqal_literal.c: Switch rasqal_literal with type
RASQAL_LITERAL_DECIMAL from stored as a double stored as an
rasqal_xsd_decimal.
(rasqal_new_decimal_literal, rasqal_literal_string_to_native,
rasqal_free_literal, rasqal_literal_as_integer,
rasqal_literal_as_floating, rasqal_literal_equals): Use new fields
for decimal.
* src/rasqal_decimal.c: (rasqal_xsd_decimal_equals): Renamed from
rasqal_xsd_decimal_equal
* src/rasqal.h: rasqal_literal now stores decimals as
rasqal_xsd_decimal. rasqal_xsd_decimal_equals renamed from
rasqal_xsd_decimal_equal
* Last known good revision 12976: 'make check' succeeds.
* src/rasqal.h, src/rasqal_decimal.c, src/rasqal_internal.h: Move
rasqal_xsd_decimal prototypes to rasqal.h and rename
constructor/destructor to match convention
* src/rasqal_decimal.c, src/rasqal_internal.h: Move
rasqal_xsd_decimal prototypes to rasqal_internal.h
* src/rasqal_decimal.c: (main): Tests are silent on success
* src/rasqal_decimal.c: (rasqal_xsd_decimal_init): Set to 32
digits precision
* src/rasqal_decimal.c: (rasqal_xsd_decimal_as_string): less strlen
* src/rasqal_decimal.c: ;
* src/rasqal_decimal.c: (rasqal_xsd_decimal_clear_string): All
strings are rasqal alloced.
(rasqal_xsd_decimal_as_string): Handle zero better.
* src/rasqal_decimal.c: (rasqal_xsd_decimal_as_string): No longer
format as ints, always generate -?X.YeZ
* src/rasqal_decimal.c: Prevent 0.0e-1, make it 0.0e0
* src/rasqal_decimal.c: Ensure trailing zeroes are not all removed
in MPFR cleanup. Clear result strings when computing.
* src/rasqal_decimal.c: Catch malloc failures
* src/rasqal_decimal.c: (rasqal_xsd_decimal_as_string): Adjust
MPFR output to remove leading 0s and have 1 leading digit. Adjust
GMP output to have 1 leading digit.
(rasqal_xsd_decimal_print): Use string from
rasqal_xsd_decimal_as_string.
* src/rasqal_decimal.c: Flags made explicit.
Annotate free()
* src/rasqal_decimal.c: (rasqal_xsd_decimal_as_counted_string): Added.
* src/rasqal_decimal.c: Preserve original string as str. Fix
output formatting better for GMP
* src/rasqal_decimal.c: Added GMP
* configure.ac: Added --with-decimal to choose mpfr, gmp, none
Added --with-mpfr=DIR to set prefix for mpfr install.
Added MPFR and GMP presence tests.
Added decimal choice to summary
* src/Makefile.am: Added rasqal_decimal.c to library
* configure.ac: AC_MSG_RESULT
* src/Makefile.am: Added rasqal_decimal_test
* src/rasqal_decimal.c: Moved macros to ../configure.ac
* configure.ac: Add checks and defines for MPFR and decimal
* src/rasqal_decimal.c: XSD decimal via some external library
2007-10-18 Lauri Aalto <laalto@iki.fi>
* src/rasqal_engine.c: (rasqal_engine_query_result_row_update) Fix
SPARQL sort-3 segfault: Evaluating order condition expression may
return NULL.
* src/rasqal_engine.c: (rasqal_engine_query_result_row_to_nodes,
rasqal_engine_execute_run) Allow empty result sets - not an error.
* src/rasqal_literal.c: (rasqal_literal_cast) Check for new_string
alloc failure
* src/rasqal_result_formats.c: (rasqal_query_results_write_xml_result4)
Fix segfault when binding value literal is not a node type.
* src/rasqal_engine.c: (rasqal_engine_query_result_row_to_nodes)
Return an error if cannot convert a literal to node. Do not just
leave a non-node literal row values.
(rasqal_engine_execute_run) Check
rasqal_engine_query_result_row_to_nodes() return value.
* src/rasqal_engine.c: (rasqal_engine_query_result_row_update)
Free literal returned by evaluation of order condition
expressions.
2007-10-17 Lauri Aalto <laalto@iki.fi>
* src/rasqal_engine.c: (rasqal_free_gp_data) Remove unnecessary
start_column check - the root cause for start_column<0 was fixed
in r12884.
* tests/sparql/ExprBuiltins/Makefile.am: Expect SPARQL
ExprBuiltins str-1 to fail.
* src/fix-flex: (fix-flex) Also remove generated yy_fatal_error()
declaration to avoid warning about declared but non-defined static
function. Fix line offset off-by-one by not including $ in printed
match when patching lex_destroy(). Fix .h #line directives as
well.
* src/fix-flex: (fix-flex) Remove generated yy_fatal_error()
definition to avoid warnings about unused function.
* src/rdql_lexer.l, src/sparql_lexer.l: (sparql_lexer_fatal_error,
rdql_lexer_fatal_error) Portability: avoid depending on varargs
implementation internals.
* src/sparql_lexer.l: (sparql_lexer) Replace out-of-memory
yyterminate() calls with more informative SPARQL_LEXER_OOM macros.
* src/rdql_lexer.l,
src/sparql_lexer.l: (sparql_lexer_cleanup,rdql_lexer_cleanup) Does
not have to be non-static.
* src/fix-flex, src/rasqal_internal.h, src/rdql_lexer.l,
src/sparql_lexer.l: (rasqal_query_s) Added lexer_user_data for
storing re-entrant lexer internal data.
(fix-flex) Replace calls to yy_fatal_error() with YY_FATAL_ERROR
macro. Add alloc failure checks to generated ensure_stack().
Call custom cleanup() function in lex_destroy(). Removed
prefixing free(ptr) with NULL guard - rasqal lexers now have
yyfree replacements that check for NULL. Fix .c #line numbers.
(sparql_lexer) Specify noyyalloc, noyyrealloc, noyyfree options to
prevent flex from generating alloc/realloc/free functions. Define
YY_FATAL_ERROR macro to sparql_lexer_fatal_error().
Added experimental low-memory memory leak prevention code under
LEXER_ALLOC_TRACKING flag (disabled by default) - easier and
probably more failsafe than patching large amounts of generated C
in fix-flex. The leak itself is YY_BUFFER_STATE struct that is not
freed when ensure_stack() encounters an OOM fatal error -
previously ensure_stack() segfaulted but now fix-flex patches it
to just leak memory.
(sparql_lexer_fatal_error) Added replacement for default error
handler. Uses rasqal query fatal error reporting mechanisms if
possible. abort()s and does not exit() like the generated error
handler would do.
(sparql_lexer_cleanup) Added function that gets called by
sparql_lexer_lexer_destroy() patched by fix-flex. Cleans up memory
leaks (if any) when LEXER_ALLOC_TRACKING flag is enabled,
otherwise a no-op.
(sparql_lexer_alloc) Added allocator function as needed after the
noyyalloc option. If LEXER_ALLOC_TRACKING flag is disabled, it's
just the plain malloc(). Otherwise stores allocated pointer to an
alloc tracker stored in lexer_user_data in rasqal_query_s to allow
cleanup by sparql_lexer_cleanup().
(sparql_lexer_realloc) Added realloc function as needed after the
noyyrealloc option. If LEXER_ALLOC_TRACKING flag is disabled, it's
just the plain realloc(). Otherwise it uses the alloc tracker in
lexer_user_data.
(sparql_lexer_free) Added free function as needed after the
noyyfree option. If LEXER_ALLOC_TRACKING flag is disabled, it's
just the plain free() with NULL check. Otherwise it uses the alloc
tracker in lexer_user_data.
(rdql_lexer) Specify noyyalloc, noyyrealloc, noyyfree options to
prevent flex from generating alloc/realloc/free functions. Define
YY_FATAL_ERROR macro to rdql_lexer_fatal_error().
(rdql_lexer_fatal_error) Added replacement for default error
handler. Uses rasqal query fatal error reporting mechanisms if
possible. abort()s and does not exit() like the generated error
handler would do.
(rdql_lexer_cleanup) Added empty function that gets called by
rdql_lexer_lex_destroy() patched by fix-flex.
(rdql_lexer_alloc,rdql_lexer_realloc) Added functions as needed
after noyyalloc and noyyrealloc options.
(rdql_lexer_free) Added function as needed after noyyfree
option. Checks for NULL ptr unlike the generated yyfree().
2007-10-16 Lauri Aalto <laalto@iki.fi>
* src/fix-bison: (fix-bison) Fix .c #line references - was still
off by one.
* src/fix-bison: (fix-bison) Fix .c #line references. Fix script indent.
* src/sparql_parser.y: (sparql_parse) Check lexer init return code.
2007-10-15 Dave Beckett <dave@dajobe.org>
* tests/rdql/testsuite/Makefile.am: Document B-07 B-20 as failing
since core changes to normalize xsd:double format for SPARQL cause
these to fail now
2007-10-15 Lauri Aalto <laalto@iki.fi>
* src/rasqal_literal.c: (rasqal_new_string_literal) Free datatype
as uri and not as cstring on error.
* src/rasqal_xsd_datatypes.c: (rasqal_xsd_datatype_uri_parent_type)
fix comments
* src/sparql_parser.y: Memory leak fix: add %destructor for Object
* src/rasqal_engine.c: (rasqal_engine_convert_blank_node_to_anonymous_variable)
Fix low memory crashes due to variable literals with NULL
value. Changed function to return an int error code.
(rasqal_engine_build_anonymous_variables) Bubble up errors from
rasqal_engine_convert_blank_node_to_anonymous_variable().
(rasqal_engine_prepare) Bubble up errors from
rasqal_engine_build_anonymous_variables().
* src/rasqal_xsd_datatypes.c: (rasqal_xsd_datetime_normalize) Fix
bugs in day normalization: uninitialized var t in y2 expression;
add the correct number of days when going down a month
boundary (and not the number of days next month).
(test_datetimes) Add tests to catch the bug. Was not caught before
because January and December both have 31 days.
(test_datetime_parser_tostring) Print relevant information to
stderr on test failure.
* src/rasqal_literal.c: (rasqal_literal_string_to_native) Remove
unnecessary if
2007-10-15 Dave Beckett <dave@dajobe.org>
* src/rasqal_literal.c: docs
2007-10-14 Dave Beckett <dave@dajobe.org>
* src/rasqal_literal.c: (rasqal_new_double_literal): Use
rasqal_xsd_format_double to format a double.
(rasqal_literal_string_to_native): Use rasqal_xsd_format_double to
format a new double.
* src/rasqal_internal.h: Added rasqal_xsd_format_double prototype
* src/rasqal_xsd_datatypes.c: (rasqal_xsd_format_double): Added to
properly format an xsd:double
* src/sparql_lexer.l: Added SPARQL_NAME_CHECK_ALLOW_09_FIRST
NCNAME2: Added allowing 0-9
(QNAME,BNAME,BNAME2): Use NCNAME2 instead of NCNAME to allow 0-9
first.
(rasqal_sparql_name_check): Use SPARQL_NAME_CHECK_ALLOW_09_FIRST
to allow 0-9 as the first character.
* tests/sparql/ValueTesting/Makefile.am:
typePromotion-decimal-decimal-fail passes again
* src/rasqal_literal.c: (rasqal_literal_cast): Use
rasqal_xsd_datatype_check() to check if a cast from string is
allowed.
* src/rasqal_xsd_datatypes.c: (rasqal_xsd_init,
rasqal_xsd_finish): Do not try to init, free NULL names.
* src/rasqal_expr.c: (rasqal_expression_evaluate): Moved
RASQAL_EXPR_PLUS, RASQAL_EXPR_MINUS, RASQAL_EXPR_STAR and
RASQAL_EXPR_SLASH evaluation to rasqal_literal_add,
rasqal_literal_subtract, rasqal_literal_multiply,
rasqal_literal_divide respectively.
* src/rasqal_xsd_datatypes.c: table sparql_xsd_names now includes
the types that promote to xsd:integer
(rasqal_xsd_init): Init the URIs of the types above.
(rasqal_xsd_datatype_uri_parent_type): Added to get the parent
type of a datatype URI.
(rasqal_xsd_datatype_is_numeric): Added to check if an XSD type is
numeric.
* src/rasqal_literal.c: (rasqal_new_integer_literal): Initialise
parent_type to decimal.
(rasqal_literal_string_to_native): Native integers have a decimal
parent.
(rasqal_new_string_literal): Initialise parent type.
(rasqal_literal_promote_calculate): Added to calculate XSD type
promotions.
(rasqal_literal_is_numeric): Added to determine a numeric literal.
(rasqal_literal_add, rasqal_literal_subtract,
rasqal_literal_multiply, rasqal_literal_divide): Added based on
the expression code for literals.
* src/rasqal_internal.h: Added prototypes for rasqal_literal_is_numeric,
rasqal_literal_promote_calculate, rasqal_literal_add,
rasqal_literal_subtract, rasqal_literal_multiply,
rasqal_literal_divide, rasqal_xsd_datatype_uri_parent_type and
rasqal_xsd_datatype_is_numeric
* src/rasqal.h: rasqal_literal_s gains field parent_type for XSD
type hierarchy.
* Last known good revision 12894: 'make check' succeeds.
* tests/sparql/SyntaxDev/Syntax-SPARQL2/Makefile.am,
tests/sparql/SyntaxDev/Syntax-SPARQL2/manifest.ttl,
tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-graph-02.rq,
tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-graph-06.rq: Removed
tests syntax-graph-02.rq syntax-graph-06.rq with GRAPH blank nodes
which are no longer legal SPARQL
* tests/sparql/SyntaxDev/Syntax-SPARQL/Makefile.am,
tests/sparql/SyntaxDev/Syntax-SPARQL/manifest.ttl,
tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-bnodes-03.rq,
tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-bnodes-04.rq: Removed
tests syntax-bnodes-03.rq syntax-bnodes-04.rq with blank nodes in
predicate which are no longer legal SPARQL
* tests/sparql/ValueTesting/Makefile.am: Add
typePromotion-decimal-decimal-fail to failures until type
promotions are fixed.
* tests/sparql/syntax/Makefile.am,
tests/sparql/syntax/construct0.rq: Removed construct0.rq test
since CONSTRUCT * is no longer legal sparql
* src/rasqal_literal.c: (rasqal_literal_compare): Use
raptor_uri_compare from raptor 1.4.16 instead of strcmp. Protect
checking rdf literal language and datatypes in a comparison to
only happen when both literals were originally strings.
* src/rasqal_raptor.c: (rasqal_raptor_triple_match): Debug
messages
(rasqal_raptor_triple_present): Set the match parts dependent of
whether the triple has an origin.
* src/rasqal_xsd_datatypes.c: (rasqal_xsd_datetime_to_string):