mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 19:23:03 +01:00
Add support for explicit difference file name in scripts.
This commit is contained in:
parent
2380ff8572
commit
3d93cbdd52
@ -2248,14 +2248,7 @@ static void list_create_db()
|
|||||||
FOR FIL IN RDB$FILES
|
FOR FIL IN RDB$FILES
|
||||||
SORTED BY FIL.RDB$SHADOW_NUMBER, FIL.RDB$FILE_SEQUENCE
|
SORTED BY FIL.RDB$SHADOW_NUMBER, FIL.RDB$FILE_SEQUENCE
|
||||||
|
|
||||||
if (first)
|
|
||||||
{
|
|
||||||
isqlGlob.printf("%s/* Add secondary files in comments %s", NEWLINE, NEWLINE);
|
|
||||||
}
|
|
||||||
|
|
||||||
first = false;
|
|
||||||
// reset nulls to zero
|
// reset nulls to zero
|
||||||
|
|
||||||
if (FIL.RDB$FILE_FLAGS.NULL)
|
if (FIL.RDB$FILE_FLAGS.NULL)
|
||||||
FIL.RDB$FILE_FLAGS = 0;
|
FIL.RDB$FILE_FLAGS = 0;
|
||||||
if (FIL.RDB$FILE_LENGTH.NULL)
|
if (FIL.RDB$FILE_LENGTH.NULL)
|
||||||
@ -2264,11 +2257,18 @@ static void list_create_db()
|
|||||||
FIL.RDB$FILE_SEQUENCE = 0;
|
FIL.RDB$FILE_SEQUENCE = 0;
|
||||||
if (FIL.RDB$FILE_START.NULL)
|
if (FIL.RDB$FILE_START.NULL)
|
||||||
FIL.RDB$FILE_START = 0;
|
FIL.RDB$FILE_START = 0;
|
||||||
fb_utils::exact_name(FIL.RDB$FILE_NAME);
|
if (!FIL.RDB$FILE_NAME.NULL)
|
||||||
|
fb_utils::exact_name(FIL.RDB$FILE_NAME);
|
||||||
|
|
||||||
// Pure secondary files
|
// Pure secondary files
|
||||||
if (FIL.RDB$FILE_FLAGS == 0)
|
if (FIL.RDB$FILE_FLAGS == 0)
|
||||||
{
|
{
|
||||||
|
if (first)
|
||||||
|
{
|
||||||
|
isqlGlob.printf("%s/* Add secondary files in comments %s", NEWLINE, NEWLINE);
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
|
||||||
isqlGlob.printf("%sALTER DATABASE ADD FILE '%s'", NEWLINE, FIL.RDB$FILE_NAME);
|
isqlGlob.printf("%sALTER DATABASE ADD FILE '%s'", NEWLINE, FIL.RDB$FILE_NAME);
|
||||||
if (FIL.RDB$FILE_START)
|
if (FIL.RDB$FILE_START)
|
||||||
{
|
{
|
||||||
@ -2278,11 +2278,16 @@ static void list_create_db()
|
|||||||
{
|
{
|
||||||
isqlGlob.printf(" LENGTH %ld", FIL.RDB$FILE_LENGTH);
|
isqlGlob.printf(" LENGTH %ld", FIL.RDB$FILE_LENGTH);
|
||||||
}
|
}
|
||||||
isqlGlob.printf(NEWLINE);
|
isqlGlob.printf("%s%s", isqlGlob.global_Term, NEWLINE);
|
||||||
}
|
}
|
||||||
|
else if (FIL.RDB$FILE_FLAGS & FILE_shadow)
|
||||||
if (FIL.RDB$FILE_FLAGS & FILE_shadow)
|
|
||||||
{
|
{
|
||||||
|
if (first)
|
||||||
|
{
|
||||||
|
isqlGlob.printf("%s/* Add secondary files in comments %s", NEWLINE, NEWLINE);
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (FIL.RDB$FILE_SEQUENCE)
|
if (FIL.RDB$FILE_SEQUENCE)
|
||||||
{
|
{
|
||||||
isqlGlob.printf("%sFILE '%s' ", TAB_AS_SPACES, FIL.RDB$FILE_NAME);
|
isqlGlob.printf("%sFILE '%s' ", TAB_AS_SPACES, FIL.RDB$FILE_NAME);
|
||||||
@ -2310,7 +2315,19 @@ static void list_create_db()
|
|||||||
{
|
{
|
||||||
isqlGlob.printf("STARTING %ld ", FIL.RDB$FILE_START);
|
isqlGlob.printf("STARTING %ld ", FIL.RDB$FILE_START);
|
||||||
}
|
}
|
||||||
isqlGlob.printf(NEWLINE);
|
isqlGlob.printf("%s%s", isqlGlob.global_Term, NEWLINE);
|
||||||
|
}
|
||||||
|
else if ((FIL.RDB$FILE_FLAGS & FILE_difference) && !FIL.RDB$FILE_NAME.NULL)
|
||||||
|
{
|
||||||
|
if (first)
|
||||||
|
{
|
||||||
|
isqlGlob.printf("%s/* Add secondary files in comments %s", NEWLINE, NEWLINE);
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is an explicit name for the difference file typically named <db_name>.delta
|
||||||
|
isqlGlob.printf("%sALTER DATABASE ADD DIFFERENCE FILE '%s'", NEWLINE, FIL.RDB$FILE_NAME);
|
||||||
|
isqlGlob.printf("%s%s", isqlGlob.global_Term, NEWLINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_FOR
|
END_FOR
|
||||||
@ -2321,14 +2338,8 @@ static void list_create_db()
|
|||||||
|
|
||||||
if (!first)
|
if (!first)
|
||||||
{
|
{
|
||||||
if (nodb)
|
isqlGlob.printf("%s */%s", NEWLINE, NEWLINE);
|
||||||
{
|
//isqlGlob.printf("%s%s%s", isqlGlob.global_Term, NEWLINE, NEWLINE);
|
||||||
isqlGlob.printf("%s */%s", NEWLINE, NEWLINE);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
isqlGlob.printf("%s%s%s", isqlGlob.global_Term, NEWLINE, NEWLINE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2673,8 +2673,8 @@ static void show_db()
|
|||||||
|
|
||||||
// Query for files
|
// Query for files
|
||||||
|
|
||||||
FOR FIL IN RDB$FILES SORTED BY FIL.RDB$SHADOW_NUMBER, FIL.RDB$FILE_SEQUENCE,
|
FOR FIL IN RDB$FILES
|
||||||
FIL.RDB$FILE_SEQUENCE
|
SORTED BY FIL.RDB$SHADOW_NUMBER, FIL.RDB$FILE_SEQUENCE
|
||||||
|
|
||||||
// reset nulls to zero
|
// reset nulls to zero
|
||||||
|
|
||||||
@ -2686,8 +2686,8 @@ static void show_db()
|
|||||||
FIL.RDB$FILE_SEQUENCE = 0;
|
FIL.RDB$FILE_SEQUENCE = 0;
|
||||||
if (FIL.RDB$FILE_START.NULL)
|
if (FIL.RDB$FILE_START.NULL)
|
||||||
FIL.RDB$FILE_START = 0;
|
FIL.RDB$FILE_START = 0;
|
||||||
|
if (!FIL.RDB$FILE_NAME.NULL)
|
||||||
fb_utils::exact_name(FIL.RDB$FILE_NAME);
|
fb_utils::exact_name(FIL.RDB$FILE_NAME);
|
||||||
|
|
||||||
if (FIL.RDB$FILE_FLAGS == 0)
|
if (FIL.RDB$FILE_FLAGS == 0)
|
||||||
{
|
{
|
||||||
@ -2695,8 +2695,7 @@ static void show_db()
|
|||||||
FIL.RDB$FILE_SEQUENCE, FIL.RDB$FILE_NAME,
|
FIL.RDB$FILE_SEQUENCE, FIL.RDB$FILE_NAME,
|
||||||
FIL.RDB$FILE_LENGTH, FIL.RDB$FILE_START, NEWLINE);
|
FIL.RDB$FILE_LENGTH, FIL.RDB$FILE_START, NEWLINE);
|
||||||
}
|
}
|
||||||
|
else if (FIL.RDB$FILE_FLAGS & FILE_shadow)
|
||||||
if (FIL.RDB$FILE_FLAGS & FILE_shadow)
|
|
||||||
{
|
{
|
||||||
if (FIL.RDB$FILE_SEQUENCE) {
|
if (FIL.RDB$FILE_SEQUENCE) {
|
||||||
isqlGlob.printf("%sfile %s ", TAB_AS_SPACES, FIL.RDB$FILE_NAME);
|
isqlGlob.printf("%sfile %s ", TAB_AS_SPACES, FIL.RDB$FILE_NAME);
|
||||||
@ -2725,6 +2724,12 @@ static void show_db()
|
|||||||
}
|
}
|
||||||
isqlGlob.printf(NEWLINE);
|
isqlGlob.printf(NEWLINE);
|
||||||
}
|
}
|
||||||
|
else if ((FIL.RDB$FILE_FLAGS & FILE_difference) && !FIL.RDB$FILE_NAME.NULL)
|
||||||
|
{
|
||||||
|
// This is an explicit name for the difference file typically named <db_name>.delta
|
||||||
|
isqlGlob.printf("Explicit physical backup difference file: \"%s\"%s",
|
||||||
|
FIL.RDB$FILE_NAME, NEWLINE);
|
||||||
|
}
|
||||||
|
|
||||||
END_FOR
|
END_FOR
|
||||||
ON_ERROR
|
ON_ERROR
|
||||||
|
Loading…
Reference in New Issue
Block a user