Skip to content

Commit 419a3ca

Browse files
committed
Fix output errors and warnings to stderr in gbak utility
1 parent c77fbdd commit 419a3ca

File tree

4 files changed

+33
-34
lines changed

4 files changed

+33
-34
lines changed

src/burp/backup.epp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ void put_array( burp_fld* field, burp_rel* relation, ISC_QUAD* blob_id)
11301130
if (!status_vector.isSuccess())
11311131
{
11321132
BurpMaster master;
1133-
BURP_print(false, 81, field->fld_name);
1133+
BURP_print(true, 81, field->fld_name);
11341134
// msg 81 error accessing blob field %s -- continuing
11351135
BURP_print_status(false, &status_vector);
11361136
#ifdef DEBUG
@@ -1235,7 +1235,7 @@ void put_asciz( const att_type attribute, const TEXT* string)
12351235
// We can't honor operating systems that allow longer file names.
12361236
if (len >= MAX_FILE_NAME_SIZE)
12371237
{
1238-
BURP_print(false, 343, SafeArg() << int(attribute) << "put_asciz()" << (MAX_FILE_NAME_SIZE - 1));
1238+
BURP_print(true, 343, SafeArg() << int(attribute) << "put_asciz()" << (MAX_FILE_NAME_SIZE - 1));
12391239
// msg 343: text for attribute @1 is too large in @2, truncating to @3 bytes
12401240
len = MAX_FILE_NAME_SIZE - 1;
12411241
}
@@ -1276,7 +1276,7 @@ void put_blob( burp_fld* field, ISC_QUAD& blob_id)
12761276
if (!blob.open(DB, gds_trans, blob_id))
12771277
{
12781278
BurpMaster master;
1279-
BURP_print(false, 81, field->fld_name);
1279+
BURP_print(true, 81, field->fld_name);
12801280
// msg 81 error accessing blob field %s -- continuing
12811281
BURP_print_status(false, &status_vector);
12821282
return;

src/burp/burp.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,19 +1795,19 @@ void BURP_print_status(bool err, const Firebird::IStatus* status_vector, USHORT
17951795
SCHAR s[1024];
17961796
if (fb_interpret(s, sizeof(s), &vector))
17971797
{
1798-
BURP_msg_partial(err, 256); // msg 256: gbak: ERROR:
1799-
burp_output(err, "%s\n", s);
1798+
BURP_msg_partial(true, 256); // msg 256: gbak: ERROR:
1799+
burp_output(true, "%s\n", s);
18001800

18011801
while (fb_interpret(s, sizeof(s), &vector))
18021802
{
1803-
BURP_msg_partial(err, 256); // msg 256: gbak: ERROR:
1804-
burp_output(err, " %s\n", s);
1803+
BURP_msg_partial(true, 256); // msg 256: gbak: ERROR:
1804+
burp_output(true, " %s\n", s);
18051805
}
18061806
}
18071807

18081808
if (secondNumber)
18091809
{
1810-
BURP_msg_partial(err, 169); // msg 169: gbak:
1810+
BURP_msg_partial(true, 169); // msg 169: gbak:
18111811
BURP_msg_put(true, secondNumber, SafeArg());
18121812
}
18131813
}
@@ -1850,13 +1850,13 @@ void BURP_print_warning(const Firebird::IStatus* status, bool printErrorAsWarnin
18501850

18511851
if (fb_interpret(s, sizeof(s), &vector))
18521852
{
1853-
BURP_msg_partial(false, 255); // msg 255: gbak: WARNING:
1854-
burp_output(false, "%s\n", s);
1853+
BURP_msg_partial(true, 255); // msg 255: gbak: WARNING:
1854+
burp_output(true, "%s\n", s);
18551855

18561856
while (fb_interpret(s, sizeof(s), &vector))
18571857
{
1858-
BURP_msg_partial(false, 255); // msg 255: gbak: WARNING:
1859-
burp_output(false, " %s\n", s);
1858+
BURP_msg_partial(true, 255); // msg 255: gbak: WARNING:
1859+
burp_output(true, " %s\n", s);
18601860
}
18611861
}
18621862
}

src/burp/mvol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1713,7 +1713,7 @@ static void put_asciz(SCHAR attribute, const TEXT* str)
17131713
USHORT l = static_cast<USHORT>(strlen(str));
17141714
if (l > MAX_UCHAR)
17151715
{
1716-
BURP_print(false, 343, SafeArg() << int(attribute) << "put_asciz()" << USHORT(MAX_UCHAR));
1716+
BURP_print(true, 343, SafeArg() << int(attribute) << "put_asciz()" << USHORT(MAX_UCHAR));
17171717
// msg 343: text for attribute @1 is too large in @2, truncating to @3 bytes
17181718
l = MAX_UCHAR;
17191719
}

src/burp/restore.epp

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ void activateIndex(BurpGlobals* tdgbl, const QualifiedMetaString& indexName)
317317

318318
if (fError)
319319
{
320-
BURP_print(false, 173, indexName.toQuotedString().c_str());
320+
BURP_print(true, 173, indexName.toQuotedString().c_str());
321321
BURP_print_status(false, &local_status_vector);
322322
tdgbl->flag_on_line = false;
323323

@@ -378,25 +378,25 @@ int RESTORE_restore (const TEXT* file_name, const TEXT* database_name)
378378
MODIFY IDX USING
379379
IDX.RDB$INDEX_INACTIVE = TRUE;
380380
END_MODIFY;
381-
BURP_print(false, 240, indexName.toQuotedString().c_str());
381+
BURP_print(true, 240, indexName.toQuotedString().c_str());
382382
// msg 240 Index \"%s\" failed to activate because:
383383

384384
if (error_code == isc_no_dup)
385385
{
386-
BURP_print(false, 241);
386+
BURP_print(true, 241);
387387
// msg 241 The unique index has duplicate values or NULLs
388-
BURP_print(false, 242);
388+
BURP_print(true, 242);
389389
// msg 242 Delete or Update duplicate values or NULLs, and activate index with
390390
}
391391
else
392392
{
393-
BURP_print(false, 244);
393+
BURP_print(true, 244);
394394
// msg 244 Not enough disk space to create the sort file for an index
395-
BURP_print(false, 245);
395+
BURP_print(true, 245);
396396
// msg 245 Set the TMP environment variable to a directory on a filesystem that does have enough space, and activate index with
397397
}
398398

399-
BURP_print(false, 243, indexName.toQuotedString().c_str());
399+
BURP_print(true, 243, indexName.toQuotedString().c_str());
400400
// msg 243 ALTER INDEX \"%s\" ACTIVE;
401401
}
402402
END_FOR
@@ -765,7 +765,7 @@ void add_files(BurpGlobals* tdgbl, const char* file_name)
765765
COMMIT
766766
// existing ON_ERROR continues past error, beck
767767
ON_ERROR
768-
BURP_print (false, 174);
768+
BURP_print (true, 174);
769769
// msg 174 cannot commit files
770770
BURP_print_status (false, &tdgbl->status_vector);
771771
ROLLBACK;
@@ -2116,7 +2116,7 @@ void get_array(BurpGlobals* tdgbl, burp_rel* relation, UCHAR* record_buffer)
21162116
elements_written * field->fld_length, (*buffer) + data_at);
21172117
if (status_vector->hasData())
21182118
{
2119-
BURP_print (false, 81, field->fld_name);
2119+
BURP_print (true, 81, field->fld_name);
21202120
// msg 81 error accessing blob field %s -- continuing
21212121
BURP_print_status (true, &status_vector);
21222122
#ifdef DEBUG
@@ -3143,9 +3143,9 @@ static void check_data_error(BurpGlobals* tdgbl, IStatus* status_vector, const b
31433143
{
31443144
if (tdgbl->gbl_sw_incremental)
31453145
{
3146-
BURP_print(false, 138, relation->rel_name.toQuotedString().c_str());
3146+
BURP_print(true, 138, relation->rel_name.toQuotedString().c_str());
31473147
// msg 138 validation error on field in relation %s
3148-
BURP_print_status (false, status_vector);
3148+
BURP_print_status(false, status_vector);
31493149
}
31503150
else
31513151
BURP_error_redirect(status_vector, 47);
@@ -3155,9 +3155,8 @@ static void check_data_error(BurpGlobals* tdgbl, IStatus* status_vector, const b
31553155
{
31563156
if (tdgbl->gbl_sw_incremental)
31573157
{
3158+
BURP_print(true, 114, relation->rel_name.toQuotedString().c_str());
31583159
// msg 114 restore failed for record in relation %s
3159-
BURP_print(false, 114, relation->rel_name.toQuotedString().c_str());
3160-
31613160
BURP_print_status(false, status_vector, 342); // isc_gbak_invalid_data
31623161
}
31633162
else
@@ -3167,7 +3166,7 @@ static void check_data_error(BurpGlobals* tdgbl, IStatus* status_vector, const b
31673166
{
31683167
if (tdgbl->gbl_sw_incremental && isc_sqlcode(status_vector->getErrors()) != -902)
31693168
{
3170-
BURP_print (false, 114, relation->rel_name.toQuotedString().c_str());
3169+
BURP_print(true, 114, relation->rel_name.toQuotedString().c_str());
31713170
// msg 114 restore failed for record in relation %s
31723171
BURP_print_status(false, status_vector);
31733172
}
@@ -3214,25 +3213,25 @@ static void commit_relation_data(BurpGlobals* tdgbl, burp_rel* relation)
32143213
{
32153214
IDX.RDB$INDEX_INACTIVE = TRUE;
32163215

3217-
BURP_print(false, 240, indexName.toQuotedString().c_str());
3216+
BURP_print(true, 240, indexName.toQuotedString().c_str());
32183217
// msg 240 Index \"%s\" failed to activate because:
32193218

32203219
if (error_code == isc_no_dup)
32213220
{
3222-
BURP_print(false, 241);
3221+
BURP_print(true, 241);
32233222
// msg 241 The unique index has duplicate values or NULLs
3224-
BURP_print(false, 242);
3223+
BURP_print(true, 242);
32253224
// msg 242 Delete or Update duplicate values or NULLs, and activate index with
32263225
}
32273226
else
32283227
{
3229-
BURP_print(false, 244);
3228+
BURP_print(true, 244);
32303229
// msg 244 Not enough disk space to create the sort file for an index
3231-
BURP_print(false, 245);
3230+
BURP_print(true, 245);
32323231
// msg 245 Set the TMP environment variable to a directory on a filesystem that does have enough space, and activate index with
32333232
}
32343233

3235-
BURP_print(false, 243, indexName.toQuotedString().c_str());
3234+
BURP_print(true, 243, indexName.toQuotedString().c_str());
32363235
// msg 243 ALTER INDEX \"%s\" ACTIVE
32373236
}
32383237
END_MODIFY
@@ -3246,7 +3245,7 @@ static void commit_relation_data(BurpGlobals* tdgbl, burp_rel* relation)
32463245
break;
32473246

32483247
default:
3249-
BURP_print(false, 69, relation->rel_name.toQuotedString().c_str());
3248+
BURP_print(true, 69, relation->rel_name.toQuotedString().c_str());
32503249
// msg 69 commit failed on relation %s
32513250
BURP_print_status(false, &tdgbl->status_vector);
32523251
ROLLBACK;

0 commit comments

Comments
 (0)