Changeset: 5bffa065ea2c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5bffa065ea2c
Modified Files:
        sql/backends/monet5/sql_upgrades.c
        sql/server/rel_schema.c
        sql/storage/store.c
Branch: Mar2018
Log Message:

Use is_oid_nil() consistently.


diffs (72 lines):

diff --git a/sql/backends/monet5/sql_upgrades.c 
b/sql/backends/monet5/sql_upgrades.c
--- a/sql/backends/monet5/sql_upgrades.c
+++ b/sql/backends/monet5/sql_upgrades.c
@@ -867,7 +867,7 @@ sql_update_jul2017_sp3(Client c, mvc *sq
        tab = find_sql_table(sys, "functions");
        col = find_sql_column(tab, "name");
        rid = table_funcs.column_find_row(sql->session->tr, col, 
"sys_update_schemas", NULL);
-       if (rid == oid_nil) {
+       if (is_oid_nil(rid)) {
                err = sql_fix_system_tables(c, sql);
                if (err != NULL)
                        return err;
@@ -877,7 +877,7 @@ sql_update_jul2017_sp3(Client c, mvc *sq
        tab = find_sql_table(sys, "triggers");
        col = find_sql_column(tab, "name");
        rid = table_funcs.column_find_row(sql->session->tr, col, 
"system_update_schemas", NULL);
-       if (rid == oid_nil) {
+       if (is_oid_nil(rid)) {
                char *schema = stack_get_string(sql, "current_schema");
                size_t bufsize = 1024, pos = 0;
                char *buf = GDKmalloc(bufsize);
diff --git a/sql/server/rel_schema.c b/sql/server/rel_schema.c
--- a/sql/server/rel_schema.c
+++ b/sql/server/rel_schema.c
@@ -2253,7 +2253,7 @@ rel_comment_on(mvc *sql, sqlid obj_id, s
                return NULL; 
        rid = table_funcs.column_find_row(tx, id_col, &obj_id, NULL);
        if (remark != NULL && *remark) {
-               if (rid != oid_nil) {
+               if (!is_oid_nil(rid)) {
                        // have new remark and found old one, so update field
                        table_funcs.column_update_value(tx, remark_col, rid, 
remark);
                } else {
@@ -2261,7 +2261,7 @@ rel_comment_on(mvc *sql, sqlid obj_id, s
                        table_funcs.table_insert(tx, comments, &obj_id, remark);
                }
        } else {
-               if (rid != oid_nil) {
+               if (!is_oid_nil(rid)) {
                        // have no remark but found one, so delete row
                        table_funcs.table_delete(tx, comments, rid);
                }
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -1054,7 +1054,7 @@ sql_trans_update_schemas(sql_trans* tr)
        if (bs_debug)
                fprintf(stderr, "#update schemas\n");
 
-       for(rid = table_funcs.rids_next(schemas); rid != oid_nil; rid = 
table_funcs.rids_next(schemas)) {
+       for(rid = table_funcs.rids_next(schemas); !is_oid_nil(rid); rid = 
table_funcs.rids_next(schemas)) {
                sql_trans_update_schema(tr, rid);
        }
        table_funcs.rids_destroy(schemas);
@@ -3856,7 +3856,7 @@ sys_drop_statistics(sql_trans *tr, sql_c
 
                oid rid = table_funcs.column_find_row(tr, 
find_sql_column(sysstats, "column_id"), &col->base.id, NULL);
 
-               if (rid == oid_nil)
+               if (is_oid_nil(rid))
                        return ;
 
                table_funcs.table_delete(tr, sysstats, rid);
@@ -5675,7 +5675,7 @@ sql_trans_drop_any_comment(sql_trans *tr
        assert(id_col);
 
        row = table_funcs.column_find_row(tr, id_col, &id, NULL);
-       if (row != oid_nil) {
+       if (!is_oid_nil(row)) {
                table_funcs.table_delete(tr, comments, row);
        }
 }
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to