8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 09:23:03 +01:00

-Code format

This commit is contained in:
brodsom 2003-09-12 01:58:51 +00:00
parent ef4a97ed9f
commit 4a15406cd0
5 changed files with 74 additions and 63 deletions

View File

@ -492,10 +492,11 @@ void AIL_enable(
/* check if journal is already enabled */ /* check if journal is already enabled */
if (PAG_get_clump if (PAG_get_clump(HEADER_PAGE, HDR_journal_server, &jd_len,
(HEADER_PAGE, HDR_journal_server, &jd_len, reinterpret_cast <UCHAR *>(journal_dir)))
reinterpret_cast < {
UCHAR * >(journal_dir))) ERR_post(gds_jrn_present, 0); ERR_post(gds_jrn_present, 0);
}
/* /*
* check if we are trying to enable long term journaling without * check if we are trying to enable long term journaling without

View File

@ -33,7 +33,7 @@
* *
*/ */
/* /*
$Id: blb.cpp,v 1.35 2003-09-01 07:58:04 brodsom Exp $ $Id: blb.cpp,v 1.36 2003-09-12 01:58:51 brodsom Exp $
*/ */
#include "firebird.h" #include "firebird.h"
@ -852,9 +852,10 @@ void BLB_move(TDBB tdbb, DSC * from_desc, DSC * to_desc, JRD_NOD field)
BUGCHECK(199); /* msg 199 expected field node */ BUGCHECK(199); /* msg 199 expected field node */
if (from_desc->dsc_dtype != dtype_quad if (from_desc->dsc_dtype != dtype_quad
&& from_desc->dsc_dtype != dtype_blob) ERR_post(gds_convert_error, && from_desc->dsc_dtype != dtype_blob)
gds_arg_string, {
"BLOB", 0); ERR_post(gds_convert_error, gds_arg_string, "BLOB", 0);
}
request = tdbb->tdbb_request; request = tdbb->tdbb_request;
source = (BID) from_desc->dsc_address; source = (BID) from_desc->dsc_address;
@ -920,12 +921,13 @@ void BLB_move(TDBB tdbb, DSC * from_desc, DSC * to_desc, JRD_NOD field)
break; break;
} }
if (!blob || if (!blob || MemoryPool::blk_type(blob) != type_blb ||
MemoryPool::blk_type(blob) != type_blb ||
blob->blb_attachment != tdbb->tdbb_attachment || blob->blb_attachment != tdbb->tdbb_attachment ||
!(blob->blb_flags & BLB_closed) || !(blob->blb_flags & BLB_closed) ||
(blob->blb_request && blob->blb_request != request)) (blob->blb_request && blob->blb_request != request))
{
ERR_post(gds_bad_segstr_id, 0); ERR_post(gds_bad_segstr_id, 0);
}
if (materialized_blob && !(blob->blb_flags & BLB_temporary)) { if (materialized_blob && !(blob->blb_flags & BLB_temporary)) {
refetch_flag = TRUE; refetch_flag = TRUE;

View File

@ -4364,57 +4364,57 @@ static JRD_NOD pass2(TDBB tdbb, CSB csb, JRD_NOD node, JRD_NOD parent)
case nod_find: case nod_find:
stream = base_stream(csb, &node->nod_arg[e_find_stream], TRUE); stream = base_stream(csb, &node->nod_arg[e_find_stream], TRUE);
if (! if (!(node->nod_arg[e_find_rsb] =
(node->nod_arg[e_find_rsb] = (JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
(JRD_NOD) csb-> {
csb_rpt[stream].csb_rsb_ptr)) ERR_post(gds__stream_not_defined, ERR_post(gds__stream_not_defined, 0);
0); }
break; break;
case nod_find_dbkey: case nod_find_dbkey:
case nod_find_dbkey_version: case nod_find_dbkey_version:
stream = base_stream(csb, &node->nod_arg[e_find_dbkey_stream], TRUE); stream = base_stream(csb, &node->nod_arg[e_find_dbkey_stream], TRUE);
if (! if (!(node->nod_arg[e_find_dbkey_rsb] =
(node->nod_arg[e_find_dbkey_rsb] = (JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
(JRD_NOD) csb-> {
csb_rpt[stream].csb_rsb_ptr)) ERR_post(gds__stream_not_defined, ERR_post(gds__stream_not_defined, 0);
0); }
break; break;
case nod_set_index: case nod_set_index:
stream = base_stream(csb, &node->nod_arg[e_index_stream], TRUE); stream = base_stream(csb, &node->nod_arg[e_index_stream], TRUE);
if (! if (!(node->nod_arg[e_index_rsb] =
(node->nod_arg[e_index_rsb] = (JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
(JRD_NOD) csb-> {
csb_rpt[stream].csb_rsb_ptr)) ERR_post(gds__stream_not_defined, ERR_post(gds__stream_not_defined, 0);
0); }
break; break;
case nod_get_bookmark: case nod_get_bookmark:
stream = base_stream(csb, &node->nod_arg[e_getmark_stream], TRUE); stream = base_stream(csb, &node->nod_arg[e_getmark_stream], TRUE);
if (! if (!(node->nod_arg[e_getmark_rsb] =
(node->nod_arg[e_getmark_rsb] = (JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
(JRD_NOD) csb-> {
csb_rpt[stream].csb_rsb_ptr)) ERR_post(gds__stream_not_defined, ERR_post(gds__stream_not_defined, 0);
0); }
break; break;
case nod_set_bookmark: case nod_set_bookmark:
stream = base_stream(csb, &node->nod_arg[e_setmark_stream], TRUE); stream = base_stream(csb, &node->nod_arg[e_setmark_stream], TRUE);
if (! if (!(node->nod_arg[e_setmark_rsb] =
(node->nod_arg[e_setmark_rsb] = (JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
(JRD_NOD) csb-> {
csb_rpt[stream].csb_rsb_ptr)) ERR_post(gds__stream_not_defined, ERR_post(gds__stream_not_defined, 0);
0); }
break; break;
case nod_lock_record: case nod_lock_record:
stream = base_stream(csb, &node->nod_arg[e_lockrec_stream], TRUE); stream = base_stream(csb, &node->nod_arg[e_lockrec_stream], TRUE);
if (! if (!(node->nod_arg[e_lockrec_rsb] =
(node->nod_arg[e_lockrec_rsb] = (JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
(JRD_NOD) csb-> {
csb_rpt[stream].csb_rsb_ptr)) ERR_post(gds__stream_not_defined, ERR_post(gds__stream_not_defined, 0);
0); }
break; break;
case nod_crack: case nod_crack:
@ -4426,20 +4426,20 @@ static JRD_NOD pass2(TDBB tdbb, CSB csb, JRD_NOD node, JRD_NOD parent)
case nod_reset_stream: case nod_reset_stream:
stream = base_stream(csb, &node->nod_arg[e_reset_from_stream], TRUE); stream = base_stream(csb, &node->nod_arg[e_reset_from_stream], TRUE);
if (! if (!(node->nod_arg[e_reset_from_rsb] =
(node->nod_arg[e_reset_from_rsb] = (JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
(JRD_NOD) csb-> {
csb_rpt[stream].csb_rsb_ptr)) ERR_post(gds__stream_not_defined, ERR_post(gds__stream_not_defined, 0);
0); }
break; break;
case nod_cardinality: case nod_cardinality:
stream = base_stream(csb, &node->nod_arg[e_card_stream], TRUE); stream = base_stream(csb, &node->nod_arg[e_card_stream], TRUE);
if (! if (!(node->nod_arg[e_card_rsb] =
(node->nod_arg[e_card_rsb] = (JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
(JRD_NOD) csb-> {
csb_rpt[stream].csb_rsb_ptr)) ERR_post(gds__stream_not_defined, ERR_post(gds__stream_not_defined, 0);
0); }
break; break;
/* the following DML nodes need to have their rsb's stored when /* the following DML nodes need to have their rsb's stored when

View File

@ -19,7 +19,7 @@
* *
* All Rights Reserved. * All Rights Reserved.
* Contributor(s): ______________________________________. * Contributor(s): ______________________________________.
* $Id: evl.cpp,v 1.38 2003-08-30 16:45:05 dimitr Exp $ * $Id: evl.cpp,v 1.39 2003-09-12 01:58:51 brodsom Exp $
*/ */
/* /*
@ -982,7 +982,9 @@ DSC* DLL_EXPORT EVL_expr(TDBB tdbb, JRD_NOD node)
if (extract_part != blr_extract_hour && if (extract_part != blr_extract_hour &&
extract_part != blr_extract_minute && extract_part != blr_extract_minute &&
extract_part != blr_extract_second) extract_part != blr_extract_second)
{
ERR_post(gds_expression_eval_err, 0); ERR_post(gds_expression_eval_err, 0);
}
break; break;
case dtype_sql_date: case dtype_sql_date:
timestamp.timestamp_date = *(GDS_DATE *) value->dsc_address; timestamp.timestamp_date = *(GDS_DATE *) value->dsc_address;
@ -991,7 +993,9 @@ DSC* DLL_EXPORT EVL_expr(TDBB tdbb, JRD_NOD node)
if (extract_part == blr_extract_hour || if (extract_part == blr_extract_hour ||
extract_part == blr_extract_minute || extract_part == blr_extract_minute ||
extract_part == blr_extract_second) extract_part == blr_extract_second)
{
ERR_post(gds_expression_eval_err, 0); ERR_post(gds_expression_eval_err, 0);
}
break; break;
case dtype_timestamp: case dtype_timestamp:
timestamp = *((GDS_TIMESTAMP *) value->dsc_address); timestamp = *((GDS_TIMESTAMP *) value->dsc_address);
@ -2655,9 +2659,11 @@ static DSC *add_sql_date(DSC * desc, JRD_NOD node, VLU value)
isc_decode_timestamp(&new_date, &times); isc_decode_timestamp(&new_date, &times);
if ((times.tm_year + 1900) < MIN_YEAR if ((times.tm_year + 1900) < MIN_YEAR
|| (times.tm_year) + 1900 > || (times.tm_year) + 1900 > MAX_YEAR)
MAX_YEAR) ERR_post(gds_expression_eval_err, gds_arg_gds, {
ERR_post(gds_expression_eval_err, gds_arg_gds,
isc_date_range_exceeded, 0); isc_date_range_exceeded, 0);
}
value->vlu_misc.vlu_sql_date = d2; value->vlu_misc.vlu_sql_date = d2;
@ -2857,7 +2863,9 @@ static DSC *add_timestamp(DSC * desc, JRD_NOD node, VLU value)
if (!((value->vlu_desc.dsc_dtype == dtype_timestamp) || if (!((value->vlu_desc.dsc_dtype == dtype_timestamp) ||
DTYPE_IS_TEXT(value->vlu_desc.dsc_dtype))) DTYPE_IS_TEXT(value->vlu_desc.dsc_dtype)))
{
ERR_post(gds_expression_eval_err, 0); ERR_post(gds_expression_eval_err, 0);
}
d1 = get_timestamp_to_isc_ticks(&value->vlu_desc); d1 = get_timestamp_to_isc_ticks(&value->vlu_desc);
d2 = get_timestamp_to_isc_ticks(desc); d2 = get_timestamp_to_isc_ticks(desc);
@ -2970,10 +2978,8 @@ static DSC *add_timestamp(DSC * desc, JRD_NOD node, VLU value)
new_date.timestamp_date = value->vlu_misc.vlu_timestamp.timestamp_date; new_date.timestamp_date = value->vlu_misc.vlu_timestamp.timestamp_date;
isc_decode_timestamp(&new_date, &times); isc_decode_timestamp(&new_date, &times);
if ((times.tm_year + 1900) < MIN_YEAR if ((times.tm_year + 1900) < MIN_YEAR || (times.tm_year) + 1900 > MAX_YEAR)
|| (times.tm_year) + 1900 > ERR_post(gds_expression_eval_err, gds_arg_gds, isc_date_range_exceeded, 0);
MAX_YEAR) ERR_post(gds_expression_eval_err, gds_arg_gds,
isc_date_range_exceeded, 0);
/* Make sure the TIME portion is non-negative */ /* Make sure the TIME portion is non-negative */

View File

@ -205,9 +205,11 @@ BOOLEAN NAV_find_record(RSB rsb,
idx = idx =
(IDX *) ((SCHAR *) impure + (SLONG) rsb->rsb_arg[RSB_NAV_idx_offset]); (IDX *) ((SCHAR *) impure + (SLONG) rsb->rsb_arg[RSB_NAV_idx_offset]);
if ((idx == NULL) || if ((idx == NULL) || (find_key->nod_count == 0) ||
(find_key->nod_count == 0) || (find_key->nod_count > idx->idx_count))
(find_key->nod_count > idx->idx_count)) ERR_post(gds__invalid_key, 0); {
ERR_post(gds__invalid_key, 0);
}
if (find_key->nod_count < idx->idx_count) if (find_key->nod_count < idx->idx_count)
search_flags |= irb_partial; search_flags |= irb_partial;