Changeset: c4be5a7db233 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c4be5a7db233
Modified Files:
monetdb5/modules/atoms/str.c
Branch: Aug2024
Log Message:
make sure all ignore case values are equal.
diffs (33 lines):
diff --git a/monetdb5/modules/atoms/str.c b/monetdb5/modules/atoms/str.c
--- a/monetdb5/modules/atoms/str.c
+++ b/monetdb5/modules/atoms/str.c
@@ -2875,19 +2875,22 @@ ignorecase(const bat *ic_id, bool *icase
if ((c = BATdescriptor(*ic_id)) == NULL)
throw(MAL, fname, SQLSTATE(HY002) RUNTIME_OBJECT_MISSING);
- if (BATcount(c) != 1) {
- BUN cnt = BATcount(c);
+ BUN cnt = BATcount(c);
+ if (cnt < 1) {
BBPreclaim(c);
- if (cnt == 0)
- throw(MAL, fname, SQLSTATE(42000) "Missing ignore case
value\n");
- else
- throw(MAL, fname, SQLSTATE(42000) "Multiple ignore case
values passed, only one expected\n");
+ throw(MAL, fname, SQLSTATE(42000) "Missing ignore case
value\n");
}
BATiter bi = bat_iterator(c);
*icase = *(bit *) BUNtloc(bi, 0);
+ for(BUN i = 1; i<cnt; i++) {
+ if (*icase != *(bit*)BUNtloc(bi, i)) {
+ bat_iterator_end(&bi);
+ BBPreclaim(c);
+ throw(MAL, fname, SQLSTATE(42000) "Multiple ignore case
values passed, only one expected\n");
+ }
+ }
bat_iterator_end(&bi);
-
BBPreclaim(c);
return MAL_SUCCEED;
}
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]