Skip to content

Commit 10c2e8e

Browse files
committed
Merged with v4.0-release
1 parent 3dba22b commit 10c2e8e

28 files changed

+473
-282
lines changed

CHANGELOG.md

+76
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,79 @@
1+
# v4.0.4
2+
3+
## Improvements
4+
5+
* [#7818](https://github.com/FirebirdSQL/firebird/issues/7818): Extend `RDB$GET_CONTEXT('SYSTEM', '***')` with other info from `MON$ATTACHMENTS`
6+
Contributor(s): Vlad Khorsun
7+
8+
* [#7755](https://github.com/FirebirdSQL/firebird/issues/7755): Update Windows distribution with new _zlib_ version 1.3 (released 2023-08-18)
9+
Contributor(s): Vlad Khorsun
10+
11+
## Bugfixes
12+
13+
* [#7817](https://github.com/FirebirdSQL/firebird/issues/7817): Memory leak is possible for UDF array arguments
14+
Contributor(s): Dmitry Yemanov
15+
16+
* [#7812](https://github.com/FirebirdSQL/firebird/issues/7812): Service backup does not work in multiple engines configuration
17+
Contributor(s): Alexander Peshkov
18+
19+
* [#7779](https://github.com/FirebirdSQL/firebird/issues/7779): Firebird 4.0.3 is constantly crashing with the same symptoms (fbclient.dll)
20+
Contributor(s): Vlad Khorsun
21+
22+
* [#7772](https://github.com/FirebirdSQL/firebird/issues/7772): Blob corruption in FB4.0.3 (embedded)
23+
Contributor(s): Vlad Khorsun
24+
25+
* [#7770](https://github.com/FirebirdSQL/firebird/issues/7770): Restore takes 25% more time vs 4.0.0
26+
Contributor(s): Vlad Khorsun
27+
28+
* [#7766](https://github.com/FirebirdSQL/firebird/issues/7766): Firebird 4 Windows Installer omits DLLs during custom installation mode
29+
Contributor(s): Paul Reeves
30+
31+
* [#7762](https://github.com/FirebirdSQL/firebird/issues/7762): Crash on "Operating system call pthread_mutex_destroy failed. Error code 16" in log
32+
Contributor(s): Alexander Peshkov
33+
34+
* [#7761](https://github.com/FirebirdSQL/firebird/issues/7761): Regression when displaying line number of errors in _ISQL_ scripts
35+
Contributor(s): Adriano dos Santos Fernandes
36+
37+
* [#7759](https://github.com/FirebirdSQL/firebird/issues/7759): Routine calling overhead increased by factor 6 vs Firebird 4.0.0
38+
Contributor(s): Adriano dos Santos Fernandes
39+
40+
* [#7747](https://github.com/FirebirdSQL/firebird/pull/7747): Fix an issue where the garbage collection in indexes and blobs is not performed in _VIO_backout_
41+
Contributor(s): Ilya Eremin
42+
43+
* [#7745](https://github.com/FirebirdSQL/firebird/issues/7745): Error restoring database which has system domains in user table with BLOBs using embedded connection
44+
Contributor(s): Alexander Peshkov
45+
46+
* [#7738](https://github.com/FirebirdSQL/firebird/issues/7738): Crash on multiple connections/disconnections
47+
Contributor(s): Alexander Peshkov
48+
49+
* [#7737](https://github.com/FirebirdSQL/firebird/pull/7737): Fix cases where the precedence relationship between a record page and a blob page is not set
50+
Contributor(s): Ilya Eremin
51+
52+
* [#7731](https://github.com/FirebirdSQL/firebird/issues/7731): Display length of `TIMESTAMP WITH TIME ZONE` is wrong in dialect 1
53+
Contributor(s): Alexander Peshkov
54+
55+
* [#7730](https://github.com/FirebirdSQL/firebird/issues/7730): Server ignores the size of `VARCHAR` when performing `SET BIND ... TO VARCHAR(N)`
56+
Contributor(s): Alexander Peshkov
57+
58+
* [#7729](https://github.com/FirebirdSQL/firebird/issues/7729): `SET BIND OF TS WITH TZ TO VARCHAR(128)` uses the date format of dialect 1
59+
Contributor(s): Alexander Peshkov
60+
61+
* [#7727](https://github.com/FirebirdSQL/firebird/issues/7727): Index for integer column cannot be used when `INT128/DECFLOAT` value is being searched
62+
Contributor(s): Dmitry Yemanov
63+
64+
* [#7723](https://github.com/FirebirdSQL/firebird/issues/7723): Wrong error message on login if the user doesn't exist and _WireCrypt_ is disabled
65+
Contributor(s): Alexander Peshkov
66+
67+
* [#7713](https://github.com/FirebirdSQL/firebird/issues/7713): `FOR SELECT` statement can not see any changes made inside the `DO` block
68+
Contributor(s): Vlad Khorsun
69+
70+
* [#7691](https://github.com/FirebirdSQL/firebird/issues/7691): `WITH CALLER PRIVILEGES` has no effect in triggers
71+
Contributor(s): Alexander Peshkov
72+
73+
* [#7480](https://github.com/FirebirdSQL/firebird/issues/7480): Firebird server stops accepting new connections after some time
74+
Contributor(s): Alexander Peshkov
75+
76+
177
# v4.0.3
278

379
## Improvements

builds/install/arch-specific/win32/FirebirdInstall.iss

+46-38
Original file line numberDiff line numberDiff line change
@@ -612,10 +612,14 @@ program Setup;
612612
// Some global variables are also in FirebirdInstallEnvironmentChecks.inc
613613
// This is not ideal, but then this scripting environment is not ideal, either.
614614
// The basic point of the include files is to isolate chunks of code that are
615-
// a) Form a module or have common functionality
615+
// a) From a module or have common functionality
616616
// b) Debugged.
617617
// This hopefully keeps the main script simpler to follow.
618618
619+
620+
const
621+
UNDEFINED = -1;
622+
619623
Var
620624
InstallRootDir: String;
621625
FirebirdConfSaved: String;
@@ -631,6 +635,8 @@ Var
631635
632636
SYSDBAPassword: String; // SYSDBA password
633637
638+
init_secdb: integer; // Is set to UNDEFINED by default in InitializeSetup
639+
634640
#ifdef setuplogging
635641
// Not yet implemented - leave log in %TEMP%
636642
// OkToCopyLog : Boolean; // Set when installation is complete.
@@ -681,7 +687,7 @@ begin
681687
// or
682688
// (pos('/?',Uppercase(CommandLine)) > 0) or // InnoSetup displays its own help if these switches are passed.
683689
// (pos('/H',Uppercase(CommandLine)) > 0) ) // Note also that our help scren only appears after the Choose Language dialogue :-(
684-
then begin
690+
then begin
685691
ShowHelpDlg;
686692
result := False;
687693
Exit;
@@ -713,7 +719,7 @@ begin
713719
exit;
714720
end;
715721
716-
//By default we want to install and confugure,
722+
//By default we want to install and configure,
717723
//unless subsequent analysis suggests otherwise.
718724
InstallAndConfigure := Install + Configure;
719725
@@ -722,6 +728,7 @@ begin
722728
InitExistingInstallRecords;
723729
AnalyzeEnvironment;
724730
result := AnalysisAssessment;
731+
init_secdb := UNDEFINED;
725732
726733
end;
727734
@@ -851,26 +858,25 @@ begin
851858
end;
852859
853860
854-
855-
856861
function InitSecurityDB: Boolean;
857862
var
858863
AStringList: TStringList;
859864
TempDir: String;
860-
ResultCode: Integer;
861-
CmdStr: string;
865+
ResultCode: Integer;
866+
CmdStr: string;
862867
begin
863-
TempDir := ExpandConstant( '{tmp}' );
864-
CmdStr := ExpandConstant( '{app}\isql.exe' );
865-
AStringList := TStringList.create;
866-
with AStringList do begin
867-
Add( 'create user ' + GetAdminUserName + ' password ''' + GetAdminUserPassword + ''' using plugin Srp;' );
868-
Add( 'commit;' ); //Technically exit implies a commit so this not necessary. OTOH, explicitly committing makes for more readable code.
869-
Add( 'exit;' );
870-
SaveToFile( Tempdir +'\temp.sql' );
871-
end;
872-
Result := Exec( CmdStr , ' -m -m2 -user SYSDBA -i ' + TempDir + '\temp.sql -o ' + TempDir + '\temp.sql.txt employee ' , TempDir, SW_HIDE, ewWaitUntilTerminated, ResultCode );
873-
DeleteFile( TempDir + +'\temp.sql ');
868+
TempDir := ExpandConstant( '{tmp}' );
869+
CmdStr := ExpandConstant( '{app}\isql.exe' );
870+
AStringList := TStringList.create;
871+
with AStringList do begin
872+
Add( 'create user ' + GetAdminUserName + ' password ''' + GetAdminUserPassword + ''' using plugin Srp;' );
873+
Add( 'commit;' ); //Technically exit implies a commit so this not necessary. OTOH, explicitly committing makes for more readable code.
874+
Add( 'exit;' );
875+
SaveToFile( Tempdir +'\temp.sql' );
876+
end;
877+
Result := Exec( CmdStr , ' -m -m2 -user SYSDBA -i ' + TempDir + '\temp.sql -o ' + TempDir + '\temp.sql.txt employee ' , TempDir, SW_HIDE, ewWaitUntilTerminated, ResultCode );
878+
DeleteFile( TempDir + '\temp.sql');
879+
DeleteFile( TempDir + '\temp.sql.txt');
874880
end;
875881
876882
@@ -954,16 +960,16 @@ begin
954960
955961
// These attempts to modify firebird.conf may not survice repeated installs.
956962
957-
if WizardIsTaskSelected('UseClassicServerTask') then
958-
ReplaceLine(GetAppPath+'\firebird.conf','ServerMode = ','ServerMode = Classic','#');
963+
if WizardIsTaskSelected('UseClassicServerTask') then
964+
ReplaceLine(GetAppPath+'\firebird.conf','ServerMode = ','ServerMode = Classic','#');
959965
960966
if WizardIsTaskSelected('UseSuperClassicTask') then
961-
ReplaceLine(GetAppPath+'\firebird.conf','ServerMode = ','ServerMode = SuperClassic','#');
967+
ReplaceLine(GetAppPath+'\firebird.conf','ServerMode = ','ServerMode = SuperClassic','#');
962968
963-
if WizardIsTaskSelected('UseSuperServerTask') then
964-
ReplaceLine(GetAppPath+'\firebird.conf','ServerMode = ','ServerMode = Super','#');
969+
if WizardIsTaskSelected('UseSuperServerTask') then
970+
ReplaceLine(GetAppPath+'\firebird.conf','ServerMode = ','ServerMode = Super','#');
965971
966-
end;
972+
end;
967973
968974
end;
969975
end;
@@ -986,16 +992,16 @@ var
986992
begin
987993
//Do resize only once!
988994
if wizardform.height = initWizardHeight then begin
989-
AHeight := HEIGHT_INCREASE;
990-
AWidth := WIDTH_INCREASE;
995+
AHeight := HEIGHT_INCREASE;
996+
AWidth := WIDTH_INCREASE;
991997
992-
if not Increase then begin
993-
AHeight := (AHeight * (-1));
994-
AWidth := (AWidth * (-1));
995-
end;
998+
if not Increase then begin
999+
AHeight := (AHeight * (-1));
1000+
AWidth := (AWidth * (-1));
1001+
end;
9961002
997-
SetupWizardFormComponentsArrays;
998-
ResizeWizardFormHeight(AHeight);
1003+
SetupWizardFormComponentsArrays;
1004+
ResizeWizardFormHeight(AHeight);
9991005
// ResizeWizardFormWidth(AWidth);
10001006
end;
10011007
end;
@@ -1019,9 +1025,8 @@ var
10191025
AppStr: String;
10201026
ReadMeFileStr: String;
10211027
begin
1022-
case CurStep of
1028+
case CurStep of
10231029
ssInstall: begin
1024-
// RenamePreFB3RC1Files;
10251030
SetupSharedFilesArray;
10261031
GetSharedLibCountBeforeCopy;
10271032
end;
@@ -1035,7 +1040,8 @@ begin
10351040
IncrementSharedCount(Is64BitInstallMode, GetAppPath+'\security4.fdb', false);
10361041
IncrementSharedCount(Is64BitInstallMode, GetAppPath+'\replication.conf', false);
10371042
1038-
InitSecurityDB;
1043+
if init_secdb = 1 then
1044+
InitSecurityDB;
10391045
10401046
//Fix up conf file
10411047
UpdateFirebirdConf;
@@ -1080,7 +1086,7 @@ end;
10801086
// # FIXME - we can probably remove this function
10811087
function ChooseUninstallIcon(Default: String): String;
10821088
begin
1083-
result := GetAppPath+'\firebird.exe';
1089+
result := GetAppPath+'\firebird.exe';
10841090
end;
10851091
10861092
//InnoSetup has a Check Parameter that allows installation if the function returns true.
@@ -1203,12 +1209,12 @@ end;
12031209
12041210
function NextButtonClick(CurPageID: Integer): Boolean;
12051211
var
1206-
i: integer;
1212+
i: integer;
12071213
begin
12081214
Result := True;
12091215
case CurPageID of
12101216
AdminUserPage.ID : begin
1211-
{ check user has entered new sysdba password correctly. }
1217+
{ check user has entered new sysdba password correctly. }
12121218
i := CompareStr(AdminUserPage.Values[0],AdminUserPage.Values[1]);
12131219
If not (i = 0) then begin
12141220
Result := False;
@@ -1222,3 +1228,5 @@ end;
12221228
12231229
begin
12241230
end.
1231+
1232+
; kate: replace-tabs on; indent-width 2; tab-width 2; replace-tabs-save on; syntax Pascal;

builds/install/arch-specific/win32/FirebirdInstallEnvironmentChecks.inc

+21-25
Original file line numberDiff line numberDiff line change
@@ -387,11 +387,9 @@ var
387387
product: Integer;
388388
gds32VersionString: String;
389389
VerInt: Array of Integer;
390-
// BoolOne, BoolTwo, BoolEval: Boolean;
391-
// EvalOne, EvalTwo: Integer;
390+
392391
dbg_ProductPath, dbg_BinPath, dbg_ClientVersion, dbg_GBAKVersion, dbg_Server: String;
393392
dbg_InstallType : Integer;
394-
// eval_bool: boolean;
395393

396394

397395
begin
@@ -1181,32 +1179,28 @@ begin
11811179
end;
11821180

11831181

1184-
{ procedure RenamePreFB3RC1Files;
1185-
//The method of specifying the architecture used changed after Beta 2
1186-
//Detect this old config and rename it.
1187-
var
1188-
FirebirdConfStr: AnsiString;
1182+
function ConfigureAuthentication: boolean;
1183+
// This function should only be called once - when the innosetup installer tries to
1184+
// install the secdb. If it is called a second time it will always find the secdb
1185+
// exists, even if it hasn't been configured. The only real way to test whether we
1186+
// should configure authentication is to actually _open_ a database and read the
1187+
// sec$users table. Except we cannot do that as we need this information before we
1188+
// install the files needed to read the database.
11891189
begin
1190-
if FileExists(GetAppPath+'\firebird.conf') then begin
1191-
LoadStringFromFile( GetAppPath+'\firebird.conf', FirebirdConfStr );
1192-
if pos('SharedDatabase', FirebirdConfStr) > 0 then begin
1193-
RenameFile(GetAppPath+'\firebird.conf', GetAppPath+'\firebird.conf.preRC1');
1194-
RenameFile(GetAppPath+'\security4.fdb', GetAppPath+'\security4.fdb.preRC1');
1190+
// if it is the first time we are called test for existence of the security db
1191+
if init_secdb = UNDEFINED then begin
1192+
if FileExists(WizardDirValue + '\security4.fdb') then
1193+
Result := false
1194+
else
1195+
Result := true
11951196
end
1196-
end
1197-
end;
1198-
}
1197+
else
1198+
// else the result is the current setting of init_secdb
1199+
Result := Boolean(init_secdb);
11991200

1201+
// Whatever the result, cast it to an integer and update init_secdb
1202+
init_secdb := Integer(Result);
12001203

1201-
function ConfigureAuthentication: boolean;
1202-
begin
1203-
if IsNotServerInstall then
1204-
Result := false
1205-
else
1206-
if FileExists(WizardDirValue + '\security4.fdb') then
1207-
Result := false
1208-
else
1209-
Result := true;
12101204
end;
12111205

12121206

@@ -1231,3 +1225,5 @@ begin
12311225
result := NOT HasWI30;
12321226
end;
12331227

1228+
// kate: replace-tabs on; indent-width 2; tab-width 2; replace-tabs-save on; syntax Pascal;
1229+

builds/posix/postfix.darwin

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ framework:
3030
mkdir -p $(FB_FW)/Versions/A/Libraries
3131

3232
cp $(ICU_LOC)*.dylib ../gen/$(TARGET)/firebird/lib/
33-
34-
ln -s Versions/Current/Firebird $(FB_FW)/Firebird
33+
ln -s Versions/Current/Libraries/libfbclient.dylib $(FB_FW)/Firebird
3534
ln -s Versions/Current/Headers $(FB_FW)/Headers
3635
ln -s Versions/Current/Resources $(FB_FW)/Resources
3736
ln -s Versions/Current/Libraries $(FB_FW)/Libraries

configure.ac

+4-4
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ AC_CHECK_FUNCS(sem_init)
10551055
if test "$ac_cv_func_sem_init" = "yes"; then
10561056
AC_MSG_CHECKING(for working sem_init())
10571057
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <semaphore.h>
1058-
main () {
1058+
int main () {
10591059
sem_t s;
10601060
return sem_init(&s,0,0);
10611061
}
@@ -1096,7 +1096,7 @@ AC_SYS_LARGEFILE
10961096
if test "$ac_cv_sys_file_offset_bits" = "no"; then
10971097
AC_MSG_CHECKING(for native large file support)
10981098
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <unistd.h>
1099-
main () {
1099+
int main () {
11001100
return !(sizeof(off_t) == 8);
11011101
}]])],[ac_cv_sys_file_offset_bits=64; AC_DEFINE(_FILE_OFFSET_BITS,64)
11021102
AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)],[])
@@ -1143,7 +1143,7 @@ dnl EKU: try to determine the alignment of long and double
11431143
dnl replaces FB_ALIGNMENT and FB_DOUBLE_ALIGN in src/jrd/common.h
11441144
AC_MSG_CHECKING(alignment of long)
11451145
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <semaphore.h>
1146-
main () {
1146+
int main () {
11471147
struct s {
11481148
char a;
11491149
union { long long x; sem_t y; } b;
@@ -1154,7 +1154,7 @@ AC_MSG_RESULT($ac_cv_c_alignment)
11541154
AC_DEFINE_UNQUOTED(FB_ALIGNMENT, $ac_cv_c_alignment, [Alignment of long])
11551155

11561156
AC_MSG_CHECKING(alignment of double)
1157-
AC_RUN_IFELSE([AC_LANG_SOURCE([[main () {
1157+
AC_RUN_IFELSE([AC_LANG_SOURCE([[int main () {
11581158
struct s {
11591159
char a;
11601160
double b;

doc/README.replication.md

+4
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ In the Beta 1 release, any physical copying method can be used:
115115
* nbackup -l + file-level copy + nbackup -n
116116
* nbackup -b 0
117117

118+
If _nbackup_ was used, restore or fixup operation should be performed to complete the replica creation. Note that if you're recreating a priorly working replica, then `-seq[uence]` option of _nbackup_ must be used during restore/fixup to preserve the replication sequence counter inside the database, so that replication could continue from the moment when the primary database was copied:
119+
120+
* nbackup -f &lt;database&gt; -seq
121+
118122
Then the replica mode must be activated for the database copy. Two options are possible:
119123

120124
* gfix -replica read\_only &lt;database&gt; -- set up database as read-only replica

0 commit comments

Comments
 (0)