Skip to content

Commit 0adc6a4

Browse files
committed
Merge branch 'B3_0_Release' of https://github.com/FirebirdSQL/firebird into B3_0_Release
2 parents b6b33e1 + 2d83890 commit 0adc6a4

File tree

7 files changed

+57
-31
lines changed

7 files changed

+57
-31
lines changed

doc/WhatsNew

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
* v3.0 Final Release
33
**************************
44

5+
* Bugfix CORE-5194
6+
Invalid COMPUTED BY definition generated by ISQL (extract metadata)
7+
Contributor(s):
8+
Adriano dos Santos Fernandes <adrianosf at gmail.com>
9+
510
* Bugfix CORE-5189
611
Codes of operation of user management plugin are missing in public API
712
Contributor(s):

src/dsql/DdlNodes.epp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,27 @@ void defineComputed(DsqlCompilerScratch* dsqlScratch, RelationSourceNode* relati
390390
field->subType = desc.dsc_sub_type;
391391
}
392392

393+
if (field->precision == 0 && field->scale != 0)
394+
{
395+
switch (field->dtype)
396+
{
397+
case dtype_short:
398+
field->precision = 4;
399+
break;
400+
401+
case dtype_long:
402+
field->precision = 9;
403+
break;
404+
405+
case dtype_int64:
406+
field->precision = 18;
407+
break;
408+
409+
default:
410+
fb_assert(!DTYPE_IS_EXACT(field->dtype));
411+
}
412+
}
413+
393414
dsqlScratch->resetContextStack();
394415

395416
// Generate the source text.

src/isql/isql.epp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,7 +1816,7 @@ bool ISQL_printNumericType(const char* fieldName, const int fieldType, const int
18161816
// We are ODS >= 10 and could be any Dialect
18171817
FOR FLD1 IN RDB$FIELDS WITH
18181818
FLD1.RDB$FIELD_NAME EQ fieldName
1819-
AND FLD1.RDB$FIELD_PRECISION NOT MISSING
1819+
AND NOT FLD1.RDB$FIELD_PRECISION EQ 0
18201820

18211821
// We are Dialect >=3 since FIELD_PRECISION is non-NULL
18221822
if (FLD1.RDB$FIELD_SUB_TYPE > 0 && FLD1.RDB$FIELD_SUB_TYPE <= MAX_INTSUBTYPES)
@@ -1847,13 +1847,13 @@ bool ISQL_printNumericType(const char* fieldName, const int fieldType, const int
18471847
case INTEGER:
18481848
isqlGlob.printf("NUMERIC(9, %d)", -fieldScale);
18491849
break;
1850+
case BIGINT:
1851+
isqlGlob.printf("NUMERIC(18, %d)", -fieldScale);
1852+
break;
18501853
case DOUBLE_PRECISION:
18511854
isqlGlob.printf("NUMERIC(15, %d)", -fieldScale);
18521855
break;
18531856
default:
1854-
// BIGINT can't happen there because it would have an explicit field_precision
1855-
// and then would be caught by the previous if().
1856-
fb_assert(fieldType != BIGINT);
18571857
isqlGlob.printf("%s", Column_types[i].type_name);
18581858
}
18591859
}

src/jrd/Optimizer.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,15 +263,14 @@ class InnerJoinStreamInfo
263263
return (baseSelectivity < MAXIMUM_SELECTIVITY);
264264
}
265265

266+
IndexedRelationships indexedRelationships;
266267
StreamType stream;
267268
bool baseUnique;
268269
double baseCost;
269270
double baseSelectivity;
270271
int baseIndexes;
271272
bool baseNavigated;
272273
bool used;
273-
274-
IndexedRelationships indexedRelationships;
275274
int previousExpectedStreams;
276275
};
277276

src/jrd/TempSpace.cpp

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333

3434
#include "../jrd/TempSpace.h"
3535

36-
using Firebird::TempFile;
36+
using namespace Firebird;
3737

3838
// Static definitions/initializations
3939

4040
const size_t MIN_TEMP_BLOCK_SIZE = 64 * 1024;
4141

42-
Firebird::GlobalPtr<Firebird::Mutex> TempSpace::initMutex;
43-
Firebird::TempDirectoryList* TempSpace::tempDirs = NULL;
42+
GlobalPtr<Mutex> TempSpace::initMutex;
43+
TempDirectoryList* TempSpace::tempDirs = NULL;
4444
FB_SIZE_T TempSpace::minBlockSize = 0;
4545
offset_t TempSpace::globalCacheUsage = 0;
4646

@@ -98,7 +98,7 @@ FB_SIZE_T TempSpace::FileBlock::write(offset_t offset, const void* buffer, FB_SI
9898
// Constructor
9999
//
100100

101-
TempSpace::TempSpace(MemoryPool& p, const Firebird::PathName& prefix, bool dynamic)
101+
TempSpace::TempSpace(MemoryPool& p, const PathName& prefix, bool dynamic)
102102
: pool(p), filePrefix(p, prefix),
103103
logicalSize(0), physicalSize(0), localCacheUsage(0),
104104
head(NULL), tail(NULL), tempFiles(p),
@@ -107,11 +107,11 @@ TempSpace::TempSpace(MemoryPool& p, const Firebird::PathName& prefix, bool dynam
107107
{
108108
if (!tempDirs)
109109
{
110-
Firebird::MutexLockGuard guard(initMutex, FB_FUNCTION);
110+
MutexLockGuard guard(initMutex, FB_FUNCTION);
111111
if (!tempDirs)
112112
{
113113
MemoryPool& def_pool = *getDefaultMemoryPool();
114-
tempDirs = FB_NEW_POOL(def_pool) Firebird::TempDirectoryList(def_pool);
114+
tempDirs = FB_NEW_POOL(def_pool) TempDirectoryList(def_pool);
115115
minBlockSize = Config::getTempBlockSize();
116116

117117
if (minBlockSize < MIN_TEMP_BLOCK_SIZE)
@@ -284,7 +284,7 @@ void TempSpace::extend(FB_SIZE_T size)
284284
localCacheUsage += size;
285285
globalCacheUsage += size;
286286
}
287-
catch (const Firebird::BadAlloc&)
287+
catch (const BadAlloc&)
288288
{
289289
// not enough memory
290290
}
@@ -371,18 +371,19 @@ TempSpace::Block* TempSpace::findBlock(offset_t& offset) const
371371

372372
TempFile* TempSpace::setupFile(FB_SIZE_T size)
373373
{
374-
Firebird::StaticStatusVector status_vector;
374+
LocalStatus ls;
375+
CheckStatusWrapper localStatus(&ls);
375376

376377
for (FB_SIZE_T i = 0; i < tempDirs->getCount(); i++)
377378
{
378379
TempFile* file = NULL;
379380

380-
Firebird::PathName directory = (*tempDirs)[i];
381+
PathName directory = (*tempDirs)[i];
381382
PathUtils::ensureSeparator(directory);
382383

383384
for (FB_SIZE_T j = 0; j < tempFiles.getCount(); j++)
384385
{
385-
Firebird::PathName dirname, filename;
386+
PathName dirname, filename;
386387
PathUtils::splitLastComponent(dirname, filename, tempFiles[j]->getName());
387388
PathUtils::ensureSeparator(dirname);
388389
if (!directory.compare(dirname))
@@ -402,20 +403,20 @@ TempFile* TempSpace::setupFile(FB_SIZE_T size)
402403

403404
file->extend(size);
404405
}
405-
catch (const Firebird::system_error& ex)
406+
catch (const system_error& ex)
406407
{
407-
ex.stuffException(status_vector);
408+
ex.stuffException(&localStatus);
408409
continue;
409410
}
410411

411412
return file;
412413
}
413414

414415
// no room in all directories
415-
Firebird::Arg::Gds status(isc_out_of_temp_space);
416-
status.append(Firebird::Arg::StatusVector(status_vector.begin()));
417-
iscLogStatus(NULL, status.value());
418-
status.raise();
416+
Arg::Gds status_vector(isc_out_of_temp_space);
417+
status_vector.append(Arg::StatusVector(&localStatus));
418+
iscLogStatus(NULL, &localStatus);
419+
status_vector.raise();
419420

420421
return NULL; // compiler silencer
421422
}
@@ -480,7 +481,7 @@ void TempSpace::releaseSpace(offset_t position, FB_SIZE_T size)
480481
const offset_t end = position + size;
481482
fb_assert(end <= getSize()); // Block ends in file
482483

483-
if (freeSegments.locate(Firebird::locEqual, end))
484+
if (freeSegments.locate(locEqual, end))
484485
{
485486
// The next segment is found to be adjacent
486487
Segment* const next_seg = &freeSegments.current();
@@ -502,7 +503,7 @@ void TempSpace::releaseSpace(offset_t position, FB_SIZE_T size)
502503
return;
503504
}
504505

505-
if (freeSegments.locate(Firebird::locLess, position))
506+
if (freeSegments.locate(locLess, position))
506507
{
507508
// Check the prior segment for being adjacent
508509
Segment* const prior_seg = &freeSegments.current();

src/jrd/build_no.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
*** DO NOT EDIT ***
44
TO CHANGE ANY INFORMATION IN HERE PLEASE
55
EDIT src/misc/writeBuildNum.sh
6-
FORMAL BUILD NUMBER:32474
6+
FORMAL BUILD NUMBER:32480
77
*/
88

9-
#define PRODUCT_VER_STRING "3.0.0.32474"
10-
#define FILE_VER_STRING "WI-V3.0.0.32474"
11-
#define LICENSE_VER_STRING "WI-V3.0.0.32474"
12-
#define FILE_VER_NUMBER 3, 0, 0, 32474
9+
#define PRODUCT_VER_STRING "3.0.0.32480"
10+
#define FILE_VER_STRING "WI-V3.0.0.32480"
11+
#define LICENSE_VER_STRING "WI-V3.0.0.32480"
12+
#define FILE_VER_NUMBER 3, 0, 0, 32480
1313
#define FB_MAJOR_VER "3"
1414
#define FB_MINOR_VER "0"
1515
#define FB_REV_NO "0"
16-
#define FB_BUILD_NO "32474"
16+
#define FB_BUILD_NO "32480"
1717
#define FB_BUILD_TYPE "V"
1818
#define FB_BUILD_SUFFIX "Firebird 3.0"

src/misc/writeBuildNum.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ BuildType=V
99
MajorVer=3
1010
MinorVer=0
1111
RevNo=0
12-
BuildNum=32474
12+
BuildNum=32480
1313

1414
NowAt=`pwd`
1515
cd `dirname $0`

0 commit comments

Comments
 (0)