Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental pull request - DO NOT MERGE #4832

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 18 additions & 23 deletions bdb/bdb_fetch.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,6 @@ int bdb_fetch_nodta_genid_by_recnum(bdb_state_type *bdb_state, int ixnum,
unsigned long long *genid,
bdb_fetch_args_t *arg, int *bdberr);

int bdb_fetch_next_genid(bdb_state_type *bdb_handle, void *ix, int ixnum,
int ixlen, void *lastix, int lastrrn,
unsigned long long lastgenid, void *dta, int dtalen,
int *reqdtalen, void *ixfound, int *rrn,
unsigned long long *genid, bdb_fetch_args_t *arg,
int *bdberr);

int bdb_fetch_next_genid_nl_ser(bdb_state_type *bdb_state, void *ix, int ixnum,
int ixlen, void *lastix, int lastrrn,
unsigned long long lastgenid, void *dta,
Expand All @@ -277,11 +270,12 @@ int bdb_fetch_next_genid_tran(bdb_state_type *bdb_handle, void *ix, int ixnum,
int *rrn, unsigned long long *genid, void *tran,
bdb_fetch_args_t *arg, int *bdberr);

int bdb_fetch_next_nodta_genid(bdb_state_type *bdb_handle, void *ix, int ixnum,
int ixlen, void *lastix, int lastrrn,
unsigned long long lastgenid, void *ixfound,
int *rrn, unsigned long long *genid,
bdb_fetch_args_t *arg, int *bdberr);
int bdb_fetch_next_nodta_genid_tran(bdb_state_type *bdb_handle, void *ix,
int ixnum, int ixlen, void *lastix,
int lastrrn, unsigned long long lastgenid,
void *ixfound, int *rrn,
unsigned long long *genid, void *tran,
bdb_fetch_args_t *arg, int *bdberr);

int bdb_fetch_next_nodta_genid_tran(bdb_state_type *bdb_state, void *ix,
int ixnum, int ixlen, void *lastix,
Expand All @@ -298,12 +292,12 @@ int bdb_fetch_next_nodta_genid_nl_ser(bdb_state_type *bdb_state, void *ix,
bdb_cursor_ser_t *cur_ser,
bdb_fetch_args_t *arg, int *bdberr);

int bdb_fetch_prev_genid(bdb_state_type *bdb_handle, void *ix, int ixnum,
int ixlen, void *lastix, int lastrrn,
unsigned long long lastgenid, void *dta, int dtalen,
int *reqdtalen, void *ixfound, int *rrn,
unsigned long long *genid, bdb_fetch_args_t *arg,
int *bdberr);
int bdb_fetch_prev_genid_tran(bdb_state_type *bdb_handle, void *ix, int ixnum,
int ixlen, void *lastix, int lastrrn,
unsigned long long lastgenid, void *dta,
int dtalen, int *reqdtalen, void *ixfound,
int *rrn, unsigned long long *genid, void *tran,
bdb_fetch_args_t *arg, int *bdberr);

int bdb_fetch_prev_genid_nl_ser(bdb_state_type *bdb_state, void *ix, int ixnum,
int ixlen, void *lastix, int lastrrn,
Expand All @@ -313,11 +307,12 @@ int bdb_fetch_prev_genid_nl_ser(bdb_state_type *bdb_state, void *ix, int ixnum,
bdb_cursor_ser_t *cur_ser,
bdb_fetch_args_t *arg, int *bdberr);

int bdb_fetch_prev_nodta_genid(bdb_state_type *bdb_handle, void *ix, int ixnum,
int ixlen, void *lastix, int lastrrn,
unsigned long long lastgenid, void *ixfound,
int *rrn, unsigned long long *genid,
bdb_fetch_args_t *arg, int *bdberr);
int bdb_fetch_prev_nodta_genid_tran(bdb_state_type *bdb_handle, void *ix,
int ixnum, int ixlen, void *lastix,
int lastrrn, unsigned long long lastgenid,
void *ixfound, int *rrn,
unsigned long long *genid, void *tran,
bdb_fetch_args_t *arg, int *bdberr);

int bdb_fetch_prev_nodta_genid_nl_ser(bdb_state_type *bdb_state, void *ix,
int ixnum, int ixlen, void *lastix,
Expand Down
97 changes: 19 additions & 78 deletions bdb/fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -3213,35 +3213,6 @@ int bdb_fetch_nodta_genid_by_recnum(bdb_state_type *bdb_state, int ixnum,
return outrc;
}

int bdb_fetch_next_genid(bdb_state_type *bdb_state, void *ix, int ixnum,
int ixlen, void *lastix, int lastrrn,
unsigned long long lastgenid, void *dta, int dtalen,
int *reqdtalen, void *ixfound, int *rrn,
unsigned long long *genid, bdb_fetch_args_t *args,
int *bdberr)
{
int outrc;

*bdberr = BDBERR_NOERROR;

BDB_READLOCK("bdb_fetch_next_genid");

outrc =
bdb_fetch_int(1, /* return data */
FETCH_INT_NEXT, /* next */
1, /* lookahead */
bdb_state, ix, ixnum, ixlen, lastix, lastrrn, lastgenid,
dta, dtalen, reqdtalen, ixfound, rrn, NULL, /* recnum */
genid, 0, NULL, NULL, NULL, NULL, /* no blobs */
0, NULL, /* no txn */
NULL, /* no cur_ser */
args, bdberr);

BDB_RELLOCK();

return outrc;
}

int bdb_fetch_next_genid_nl_ser(bdb_state_type *bdb_state, void *ix, int ixnum,
int ixlen, void *lastix, int lastrrn,
unsigned long long lastgenid, void *dta,
Expand Down Expand Up @@ -3282,7 +3253,7 @@ int bdb_fetch_next_genid_tran(bdb_state_type *bdb_state, void *ix, int ixnum,

*bdberr = BDBERR_NOERROR;

BDB_READLOCK("bdb_fetch_next_genid");
BDB_READLOCK(__func__);

outrc =
bdb_fetch_int(1, /* return data */
Expand Down Expand Up @@ -3328,34 +3299,6 @@ int bdb_fetch_next_blobs_genid(
return outrc;
}

int bdb_fetch_next_nodta_genid(bdb_state_type *bdb_state, void *ix, int ixnum,
int ixlen, void *lastix, int lastrrn,
unsigned long long lastgenid, void *ixfound,
int *rrn, unsigned long long *genid,
bdb_fetch_args_t *args, int *bdberr)
{
int outrc;

*bdberr = BDBERR_NOERROR;

BDB_READLOCK("bdb_fetch_next_nodta_genid");

outrc = bdb_fetch_int(0, /* return no data */
FETCH_INT_NEXT, /* next */
1, /* lookahead */
bdb_state, ix, ixnum, ixlen, lastix, lastrrn,
lastgenid, NULL, 0, NULL, /* dta, dtalen, reqdtalen */
ixfound, rrn, NULL, /* recnum */
genid, 0, NULL, NULL, NULL, NULL, /* no blobs */
0, NULL, /* no txn */
NULL, /* no cur_ser */
args, bdberr);

BDB_RELLOCK();

return outrc;
}

int bdb_fetch_next_nodta_genid_tran(bdb_state_type *bdb_state, void *ix,
int ixnum, int ixlen, void *lastix,
int lastrrn, unsigned long long lastgenid,
Expand All @@ -3367,7 +3310,7 @@ int bdb_fetch_next_nodta_genid_tran(bdb_state_type *bdb_state, void *ix,

*bdberr = BDBERR_NOERROR;

BDB_READLOCK("bdb_fetch_next_nodta_genid");
BDB_READLOCK("bdb_fetch_next_nodta_genid_tran");

outrc = bdb_fetch_int(0, /* return no data */
FETCH_INT_NEXT, /* next */
Expand All @@ -3376,8 +3319,7 @@ int bdb_fetch_next_nodta_genid_tran(bdb_state_type *bdb_state, void *ix,
lastgenid, NULL, 0, NULL, /* dta, dtalen, reqdtalen */
ixfound, rrn, NULL, /* recnum */
genid, 0, NULL, NULL, NULL, NULL, /* no blobs */
0, tran, /* no txn */
NULL, /* no cur_ser */
0, tran, NULL, /* no cur_ser */
args, bdberr);

BDB_RELLOCK();
Expand Down Expand Up @@ -3414,18 +3356,18 @@ int bdb_fetch_next_nodta_genid_nl_ser(bdb_state_type *bdb_state, void *ix,
return outrc;
}

int bdb_fetch_prev_genid(bdb_state_type *bdb_state, void *ix, int ixnum,
int ixlen, void *lastix, int lastrrn,
unsigned long long lastgenid, void *dta, int dtalen,
int *reqdtalen, void *ixfound, int *rrn,
unsigned long long *genid, bdb_fetch_args_t *args,
int *bdberr)
int bdb_fetch_prev_genid_tran(bdb_state_type *bdb_state, void *ix, int ixnum,
int ixlen, void *lastix, int lastrrn,
unsigned long long lastgenid, void *dta,
int dtalen, int *reqdtalen, void *ixfound,
int *rrn, unsigned long long *genid, void *tran,
bdb_fetch_args_t *args, int *bdberr)
{
int outrc;

*bdberr = BDBERR_NOERROR;

BDB_READLOCK("bdb_fetch_prev_genid");
BDB_READLOCK("bdb_fetch_prev_genid_tran");

outrc =
bdb_fetch_int(1, /* return data */
Expand All @@ -3434,8 +3376,7 @@ int bdb_fetch_prev_genid(bdb_state_type *bdb_state, void *ix, int ixnum,
bdb_state, ix, ixnum, ixlen, lastix, lastrrn, lastgenid,
dta, dtalen, reqdtalen, ixfound, rrn, NULL, /* recnum */
genid, 0, NULL, NULL, NULL, NULL, /* no blobs */
0, NULL, /* no txn */
NULL, /* no cur_ser */
0, tran, NULL, /* no cur_ser */
args, bdberr);

BDB_RELLOCK();
Expand Down Expand Up @@ -3501,17 +3442,18 @@ int bdb_fetch_prev_blobs_genid(
return outrc;
}

int bdb_fetch_prev_nodta_genid(bdb_state_type *bdb_state, void *ix, int ixnum,
int ixlen, void *lastix, int lastrrn,
unsigned long long lastgenid, void *ixfound,
int *rrn, unsigned long long *genid,
bdb_fetch_args_t *args, int *bdberr)
int bdb_fetch_prev_nodta_genid_tran(bdb_state_type *bdb_state, void *ix,
int ixnum, int ixlen, void *lastix,
int lastrrn, unsigned long long lastgenid,
void *ixfound, int *rrn,
unsigned long long *genid, void *tran,
bdb_fetch_args_t *args, int *bdberr)
{
int outrc;

*bdberr = BDBERR_NOERROR;

BDB_READLOCK("bdb_fetch_prev_nodta_genid");
BDB_READLOCK(__func__);

outrc = bdb_fetch_int(0, /* return no data */
FETCH_INT_PREV, /* prev */
Expand All @@ -3520,8 +3462,7 @@ int bdb_fetch_prev_nodta_genid(bdb_state_type *bdb_state, void *ix, int ixnum,
lastgenid, NULL, 0, NULL, /* dta, dtalen, reqdtalen */
ixfound, rrn, NULL, /* recnum */
genid, 0, NULL, NULL, NULL, NULL, /* no blobs */
0, NULL, /* no txn */
NULL, /* no cur_ser */
0, tran, NULL, /* no cur_ser */
args, bdberr);

BDB_RELLOCK();
Expand Down
5 changes: 4 additions & 1 deletion cdb2api/cdb2api.c
Original file line number Diff line number Diff line change
Expand Up @@ -4358,10 +4358,13 @@ static int process_set_command(cdb2_hndl_tp *hndl, const char *sql)
char *rest = NULL;
char *set_tok = strtok_r(dup_sql, " ", &rest);
if (set_tok) {
/* special case for spversion */
/* special case for spversion and temporal */
if (strcasecmp(set_tok, "spversion") == 0) {
skip_len += 10;
set_tok = strtok_r(rest, " ", &rest);
} else if (set_tok && strcasecmp(set_tok, "temporal") == 0) {
skip_len += 9;
set_tok = strtok_r(rest, " ", &rest);
/* special case for transaction chunk */
} else if (strncasecmp(set_tok, "transaction", 11) == 0) {
char *set_tok2 = strtok_r(rest, " ", &rest);
Expand Down
3 changes: 3 additions & 0 deletions csc2/dynschemaload.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ int dyns_get_table_count(void);
int dyns_get_table_tag_size(char *tabletag);
int dyns_get_table_field_count(char *tabletag);

/* period accessors */
int dyns_get_period(int period, int *start, int *end);

/* constraint accessors */
int dyns_get_constraint_count(void);
int dyns_get_constraint_at(int idx, char **consname, char **keyname,
Expand Down
15 changes: 14 additions & 1 deletion csc2/macc.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,19 @@ struct fieldopt {
} value;
};

enum pd_flags { PERIOD_SYSTEM = 0, PERIOD_BUSINESS = 1, PERIOD_MAX = 2 };

struct period {
int enable;
int start;
int end;
};

enum ct_flags {
CT_UPD_CASCADE = 0x00000001,
CT_DEL_CASCADE = 0x00000002,
CT_DEL_SETNULL = 0x00000008,
CT_NO_OVERLAP = 0x00000010,
};

enum ct_type { CT_FKEY, CT_CHECK };
Expand Down Expand Up @@ -188,6 +197,8 @@ enum INDEXFLAGS {
};

typedef struct macc_globals_t {
struct period periods[PERIOD_MAX];
int nperiods;
struct constraint constraints[MAXCNSTRTS];
struct check_constraint check_constraints[MAXCNSTRTS];
struct symbol symb[MAX];
Expand Down Expand Up @@ -297,7 +308,9 @@ int numix();
void resolve_case_names();
void set_constraint_mod(int start, int op, int type);
void set_constraint_name(char *name, enum ct_type type);
void start_constraint_list(char *keyname);
void start_constraint_list(char *keyname, int no_overlap);
void start_periods_list(void);
void add_period(char *name, char *start, char *end);
void add_constraint(char *tbl, char *key);
void add_check_constraint(char *expr);
void add_constant(char *name, int value, short type);
Expand Down
Loading