Changeset: 2f3f9300e8eb for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2f3f9300e8eb
Removed Files:
monetdb5/modules/atoms/identifier.c
Modified Files:
clients/Tests/MAL-signatures-hge.test
clients/Tests/MAL-signatures.test
gdk/gdk_logger.c
monetdb5/ChangeLog
monetdb5/modules/atoms/CMakeLists.txt
Branch: default
Log Message:
Removed MAL type "identifier".
diffs (192 lines):
diff --git a/clients/Tests/MAL-signatures-hge.test
b/clients/Tests/MAL-signatures-hge.test
--- a/clients/Tests/MAL-signatures-hge.test
+++ b/clients/Tests/MAL-signatures-hge.test
@@ -46088,11 +46088,6 @@ subgroupdone
command group.subgroupdone(X_0:bat[:any_1], X_1:bat[:oid], X_2:bat[:oid],
X_3:bat[:oid], X_4:bat[:lng]) (X_5:bat[:oid], X_6:bat[:oid])
GRPsubgroup9;
(empty)
-identifier
-identifier
-command identifier.identifier(X_0:str):identifier
-IDentifier;
-Cast a string to an identifier
inet
!=
command inet.!=(X_0:inet, X_1:inet):bit
diff --git a/clients/Tests/MAL-signatures.test
b/clients/Tests/MAL-signatures.test
--- a/clients/Tests/MAL-signatures.test
+++ b/clients/Tests/MAL-signatures.test
@@ -34588,11 +34588,6 @@ subgroupdone
command group.subgroupdone(X_0:bat[:any_1], X_1:bat[:oid], X_2:bat[:oid],
X_3:bat[:oid], X_4:bat[:lng]) (X_5:bat[:oid], X_6:bat[:oid])
GRPsubgroup9;
(empty)
-identifier
-identifier
-command identifier.identifier(X_0:str):identifier
-IDentifier;
-Cast a string to an identifier
inet
!=
command inet.!=(X_0:inet, X_1:inet):bit
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -1062,6 +1062,10 @@ log_read_types_file(logger *lg, FILE *fp
*needsnew = true;
continue;
}
+ if (version < 52304 && strcmp(atom_name, "identifier") == 0) {
+ *needsnew = true;
+ continue;
+ }
int i = ATOMindex(atom_name);
if (id < -127 || id > 127 || i < 0) {
diff --git a/monetdb5/ChangeLog b/monetdb5/ChangeLog
--- a/monetdb5/ChangeLog
+++ b/monetdb5/ChangeLog
@@ -2,6 +2,8 @@
# This file is updated with Maddlog
* Fri Nov 22 2024 Sjoerd Mullender <[email protected]>
+- Removed the MAL type "identifier" and supporting functions. There has
+ never been an SQL interface to this type.
- Removed the MAL type "color" and supporting functions. There has
never been an SQL interface to this type.
diff --git a/monetdb5/modules/atoms/CMakeLists.txt
b/monetdb5/modules/atoms/CMakeLists.txt
--- a/monetdb5/modules/atoms/CMakeLists.txt
+++ b/monetdb5/modules/atoms/CMakeLists.txt
@@ -23,7 +23,6 @@ target_sources(atoms
json.c
mtime.c mtime.h
inet.c
- identifier.c
xml.c xml.h
batxml.c)
diff --git a/monetdb5/modules/atoms/identifier.c
b/monetdb5/modules/atoms/identifier.c
deleted file mode 100644
--- a/monetdb5/modules/atoms/identifier.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * SPDX-License-Identifier: MPL-2.0
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * Copyright 2024 MonetDB Foundation;
- * Copyright August 2008 - 2023 MonetDB B.V.;
- * Copyright 1997 - July 2008 CWI.
- */
-
-/*
- * @f identifier
- * @a Fabian Groffen, Martin Kersten
- * @+ Identifier Wrapper
- * The identifier atom is a shallow wrapper that contains an object's id.
- * Due to it being wrapped by this atom, methods can distinguish
- * it from a normal string.
- * The variable of this time can be further extended with properties
- * to further qualify the identifier referenced.
- *
- */
-#include "monetdb_config.h"
-#include "mal.h"
-#include "mal_exception.h"
-
-typedef str identifier;
-
-static int TYPE_identifier;
-
-static str
-IDprelude(void)
-{
- TYPE_identifier = ATOMindex("identifier");
- return MAL_SUCCEED;
-}
-
-/**
- * Creates a new identifier from the given string (stupid string copy).
- * Warning: GDK function, does NOT pass a string by reference, and wants
- * a pointer to a pointer for the retval!
- * Returns the number of chars read
- */
-static ssize_t
-IDfromString(const char *src, size_t *len, void **RETVAL, bool external)
-{
- identifier *retval = (identifier *) RETVAL;
- size_t l = strlen(src) + 1;
- if (*retval == NULL || *len < l) {
- GDKfree(*retval);
- *retval = GDKmalloc(l);
- if (*retval == NULL)
- return -1;
- *len = l;
- }
- if (external && strncmp(src, "nil", 3) == 0) {
- memcpy(*retval, str_nil, 2);
- return 3;
- }
- memcpy(*retval, src, l);
- return (ssize_t) l - 1;
-}
-
-/**
- * Returns the string representation of the given identifier.
- * Warning: GDK function
- * Returns the length of the string
- */
-static ssize_t
-IDtoString(char **retval, size_t *len, const void *HANDLE, bool external)
-{
- const char *handle = HANDLE;
- size_t hl = strlen(handle) + 1;
- if (external && strNil(handle))
- hl = 4;
- if (*len < hl || *retval == NULL) {
- GDKfree(*retval);
- *retval = GDKmalloc(hl);
- if (*retval == NULL)
- return -1;
- *len = hl;
- }
- if (external && strNil(handle))
- strcpy(*retval, "nil");
- else
- memcpy(*retval, handle, hl);
- return (ssize_t) hl - 1;
-}
-
-/**
- * Returns an identifier, parsed from a string. The fromStr function is used
- * to parse the string.
- */
-static str
-IDentifier(identifier *retval, const char *const *in)
-{
- size_t len = 0;
-
- if (IDfromString(*in, &len, (void **) retval, false) < 0)
- throw(PARSE, "identifier.identifier", "Error while parsing %s",
*in);
-
- return (MAL_SUCCEED);
-}
-
-#include "mel.h"
-mel_atom identifier_init_atoms[] = {
- { .name="identifier", .basetype="str", .fromstr=IDfromString,
.tostr=IDtoString, }, { .cmp=NULL }
-};
-mel_func identifier_init_funcs[] = {
- command("identifier", "identifier", IDentifier, false, "Cast a string to an
identifier ", args(1,2, arg("",identifier),arg("s",str))),
- { .imp=NULL }
-};
-#include "mal_import.h"
-#ifdef _MSC_VER
-#undef read
-#pragma section(".CRT$XCU",read)
-#endif
-LIB_STARTUP_FUNC(init_identifier_mal)
-{ mal_module2("identifier", identifier_init_atoms, identifier_init_funcs,
IDprelude, NULL); }
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]