Changeset: 44b5b48fa44d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/44b5b48fa44d
Modified Files:
clients/Tests/exports.stable.out
monetdb5/mal/mal_import.c
monetdb5/mal/mal_import.h
Branch: Dec2025
Log Message:
Remove unused function compileString.
diffs (132 lines):
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -886,7 +886,6 @@ void clrFunction(InstrPtr p);
void clrInstruction(InstrPtr p);
const char columnBindRef[];
const char comment_onRef[];
-str compileString(Symbol *fcn, Client c, str s);
const char compressRef[];
char *concatErrors(const char *err1, const char *err2)
__attribute__((__nonnull__(1, 2))) __attribute__((__returns_nonnull__));
const char connectRef[];
diff --git a/monetdb5/mal/mal_import.c b/monetdb5/mal/mal_import.c
--- a/monetdb5/mal/mal_import.c
+++ b/monetdb5/mal/mal_import.c
@@ -264,107 +264,3 @@ malInclude(Client c, const char *name, i
restoreClient;
return msg;
}
-
-
-/* patch a newline character if needed */
-static str
-mal_cmdline(char *s, size_t *len)
-{
- if (*len && s[*len - 1] != '\n') {
- char *n = GDKmalloc(*len + 2);
- if (n == NULL)
- return s;
- memcpy(n, s, *len);
- n[*len] = '\n';
- n[*len + 1] = 0;
- (*len)++;
- return n;
- }
- return s;
-}
-
-str
-compileString(Symbol *fcn, Client cntxt, str s)
-{
- Client c;
- QryCtx *qc_old;
- size_t len = strlen(s);
- buffer *b;
- str msg = MAL_SUCCEED;
- str qry;
- str old = s;
- stream *bs;
- bstream *fdin = NULL;
-
- s = mal_cmdline(s, &len);
- qry = s;
- if (old == s) {
- qry = GDKstrdup(s);
- if (!qry)
- throw(MAL, "mal.eval", SQLSTATE(HY013) MAL_MALLOC_FAIL);
- }
-
- mal_unquote(qry);
- b = (buffer *) GDKmalloc(sizeof(buffer));
- if (b == NULL) {
- GDKfree(qry);
- throw(MAL, "mal.eval", SQLSTATE(HY013) MAL_MALLOC_FAIL);
- }
-
- buffer_init(b, qry, len);
- bs = buffer_rastream(b, "compileString");
- if (bs == NULL) {
- GDKfree(qry);
- GDKfree(b);
- throw(MAL, "mal.eval", SQLSTATE(HY013) MAL_MALLOC_FAIL);
- }
- fdin = bstream_create(bs, b->len);
- if (fdin == NULL) {
- GDKfree(qry);
- GDKfree(b);
- throw(MAL, "mal.eval", SQLSTATE(HY013) MAL_MALLOC_FAIL);
- }
- strncpy(fdin->buf, qry, len + 1);
-
- qc_old = MT_thread_get_qry_ctx();
- // compile in context of called for
- c = MCinitClient(MAL_ADMIN, fdin, 0);
- if (c == NULL) {
- GDKfree(qry);
- GDKfree(b);
- MT_thread_set_qry_ctx(qc_old);
- throw(MAL, "mal.eval", "Can not create user context");
- }
- c->curmodule = c->usermodule = cntxt->usermodule;
- c->promptlength = 0;
- c->listing = 0;
-
- if ((msg = defaultScenario(c))) {
- GDKfree(qry);
- GDKfree(b);
- c->usermodule = 0;
- MCcloseClient(c);
- MT_thread_set_qry_ctx(qc_old);
- return msg;
- }
-
- msg = MSinitClientPrg(c, userRef, mainRef); /* create new context */
- if (msg == MAL_SUCCEED)
- msg = MALparser(c);
- /*
- if(msg == MAL_SUCCEED && c->phase[MAL_SCENARIO_PARSER])
- msg = (str) (*c->phase[MAL_SCENARIO_PARSER])(c);
- if(msg == MAL_SUCCEED && c->phase[MAL_SCENARIO_OPTIMIZE])
- msg = (str) (*c->phase[MAL_SCENARIO_OPTIMIZE])(c);
- */
-
- *fcn = c->curprg;
- c->curprg = 0;
- c->usermodule = 0;
- /* restore IO channel */
- MCcloseClient(c);
- MT_thread_set_qry_ctx(qc_old);
- GDKfree(qry);
- GDKfree(b);
- return msg;
-}
diff --git a/monetdb5/mal/mal_import.h b/monetdb5/mal/mal_import.h
--- a/monetdb5/mal/mal_import.h
+++ b/monetdb5/mal/mal_import.h
@@ -22,5 +22,5 @@ mal_export str malIncludeString(Client c
mal_export str malInclude(Client c, const char *name, int listing);
mal_export void slash_2_dir_sep(str fname);
-mal_export str compileString(Symbol *fcn, Client c, str s);
+
#endif /* _MAL_IMPORT_H */
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]