Changeset: c0ee82940887 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c0ee82940887
Modified Files:
sql/storage/store.c
Branch: iso
Log Message:
BAT lookups are done by id in the logger, so the name conflict is not needed
anymore
diffs (122 lines):
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -3277,99 +3277,6 @@ sql_trans_copy_trigger( sql_trans *tr, s
return res;
}
-static int
-sql_trans_cname_conflict(sql_table *t, const char *extra, const char *cname)
-{
- int res = 0;
- const char *tmp = cname;
-
- if (extra) {
- tmp = sql_message("%s_%s", extra, cname);
- } else {
- tmp = cname;
- }
- if (find_sql_column(t, tmp))
- res = 1;
- if (tmp != cname) {
- char *ntmp = (char*)tmp;
- _DELETE(ntmp);
- }
- return res;
-}
-
-static int
-sql_trans_tname_conflict( sql_trans *tr, sql_schema *s, const char *extra,
const char *tname, const char *cname)
-{
- char *tp;
- char *tmp;
- sql_table *t = NULL;
-
- if (extra) {
- tmp = sql_message("%s_%s", extra, tname);
- } else {
- tmp = _STRDUP(tname);
- }
- tp = tmp;
- while ((tp = strchr(tp, '_')) != NULL) {
- *tp = 0;
- t = find_sql_table(tr, s, tmp);
- if (t && sql_trans_cname_conflict(t, tp+1, cname)) {
- _DELETE(tmp);
- return 1;
- }
- *tp++ = '_';
- }
- _DELETE(tmp);
- tmp = _STRDUP(cname);
- tp = tmp;
- while ((tp = strchr(tp, '_')) != NULL) {
- char *ntmp;
- *tp = 0;
- ntmp = sql_message("%s_%s", tname, tmp);
- t = find_sql_table(tr, s, ntmp);
- if (t && sql_trans_cname_conflict(t, NULL, tp+1)) {
- _DELETE(ntmp);
- _DELETE(tmp);
- return 1;
- }
- _DELETE(ntmp);
- *tp++ = '_';
- }
- _DELETE(tmp);
- t = find_sql_table(tr, s, tname);
- if (t && sql_trans_cname_conflict(t, NULL, cname))
- return 1;
- return 0;
-}
-
-static int
-sql_trans_name_conflict( sql_trans *tr, const char *sname, const char *tname,
const char *cname)
-{
- char *sp;
- sql_schema *s = NULL;
-
- sp = strchr(sname, '_');
- if (!sp && strchr(tname, '_') == 0 && strchr(cname, '_') == 0)
- return 0;
-
- if (sp) {
- char *tmp = SA_STRDUP(tr->sa, sname);
- sp = tmp;
- while ((sp = strchr(sp, '_')) != NULL) {
- *sp = 0;
- s = find_sql_schema(tr, tmp);
- if (s && sql_trans_tname_conflict(tr, s, sp+1, tname,
cname))
- return 1;
- *sp++ = '_';
- }
- } else {
- s = find_sql_schema(tr, sname);
- if (s)
- return sql_trans_tname_conflict(tr, s, NULL, tname,
cname);
- }
- return 0;
-}
-
int
sql_trans_copy_column( sql_trans *tr, sql_table *t, sql_column *c, sql_column
**cres)
{
@@ -3379,9 +3286,6 @@ sql_trans_copy_column( sql_trans *tr, sq
sql_table *dup = NULL;
int res = 0;
- if (t->system && sql_trans_name_conflict(tr, t->s->base.name,
t->base.name, c->base.name))
- return -2;
-
if ((res = new_table(tr, t, &dup)))
return res;
t = dup;
@@ -5681,8 +5585,6 @@ sql_trans_create_column(sql_trans *tr, s
if (!tpe)
return NULL;
- if (t->system && sql_trans_name_conflict(tr, t->s->base.name,
t->base.name, name))
- return NULL;
col = create_sql_column_with_id(tr->sa, next_oid(tr->store), t, name,
tpe);
if (isTable(col->t))
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list