Skip to content

Commit e8546bf

Browse files
committed
Merge remote-tracking branch 'origin/master' into add_fast_search_to_tempspace
2 parents 2a84b70 + 6d0f533 commit e8546bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+2319
-546
lines changed

.github/workflows/increment-build-number.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515
with:
1616
token: ${{ secrets.FIREBIRD_INC_BUILDNUM }}
1717
persist-credentials: true

.github/workflows/qa.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
steps:
1717
- name: Checkout firebird-qa
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919
with:
2020
fetch-depth: 1
2121
repository: FirebirdSQL/firebird-qa

.github/workflows/trim-trailing-spaces.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- v4.0-release
1818

1919
steps:
20-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
2121
with:
2222
ref: ${{ matrix.branch }}
2323
persist-credentials: false

builds/install/misc/replication.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ database
155155
# password_env = FB_REPL_PWD
156156
# }
157157
#
158-
# If username_file / password_file is specified, the first non-empty line
158+
# If username_file / password_file is specified, the first line
159159
# of the provided file is used as the parameter value.
160160
#
161161
# If username_file or password_file values represent a relative pathname,

builds/make.new/config/install-sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22
# install - install a program, script, or datafile
33

4-
scriptversion=2020-11-14.01; # UTC
4+
scriptversion=2023-11-23.18; # UTC
55

66
# This originates from X11R5 (mit/util/scripts/install.sh), which was
77
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -124,9 +124,9 @@ it's up to you to specify -f if you want it.
124124
125125
If -S is not specified, no backups are attempted.
126126
127-
Email bug reports to [email protected].
128-
Automake home page: https://www.gnu.org/software/automake/
129-
"
127+
Report bugs to <[email protected]>.
128+
GNU Automake home page: <https://www.gnu.org/software/automake/>.
129+
General help using GNU software: <https://www.gnu.org/gethelp/>."
130130

131131
while test $# -ne 0; do
132132
case $1 in

doc/README.isql_enhancements.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ It is set to OFF by default. The name WIRE_STATS could be shortened up to WIRE.
337337
The statistics counters shown in two groups: 'logical' and 'physical':
338338
- logical counters show numbers of packets in terms of Firebird wire protocol
339339
and number of bytes send before compression and received after decompression;
340-
- physical counters show number of physical packets and bytes send and
341-
received over the wire, number of bytes could be affected by wire compression,
340+
- physical counters show number of physical packets and bytes send and
341+
received over the wire, number of bytes could be affected by wire compression,
342342
if present. Also, number of network roundtrips is shown: it is number of
343343
changes of IO direction from 'send' to 'receive'.
344344

@@ -489,7 +489,9 @@ If engine prepares the statement correctly, it's run and ISQL is put in new stat
489489
mode.
490490

491491
If engine returns error isc_command_end_err2, then ISQL is put in statement
492-
continuation mode and asks for another line, repeating the process.
492+
continuation mode and asks for another line, repeating the process. When this error
493+
happens together with IStatement::PREPARE_REQUIRE_SEMICOLON, trace does not log the
494+
error.
493495

494496
If engine returns a different error, the error is shown and ISQL is put in new statement
495497
mode.

doc/Using_OO_API.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3629,13 +3629,24 @@ <h1><font size="4" style="font-size: 14pt">Database encryption
36293629
<p style="margin-bottom: 0cm"><font size="4" style="font-size: 14pt">DO_RETRY -
36303630
retry attach (ignored when function was called without attStatus).</font></p>
36313631
</font></p>
3632+
<li><p style="margin-bottom: 0cm"><font size="4" style="font-size: 14pt">
3633+
int getHashLength(StatusType* status) - returns length of hash of the keys provided by interface.
3634+
Hash is needed to let caller compare interfaces for equality. Empty (no keys)
3635+
interface should return hash length equal to zero.
3636+
</font></p>
3637+
<li><p style="margin-bottom: 0cm"><font size="4" style="font-size: 14pt">
3638+
void getHashData(StatusType* status, void* hash) - places hash of the keys provided by interface
3639+
into memory location defined by parameter <i>hash</i>. Should copy exact number of bytes
3640+
returned by getHashLength() call. Hash algorithm is chosen by plugin author
3641+
(in year 2024 SHA256 appears reasonable choice).
3642+
</font></p>
36323643
</ol>
36333644
<p style="margin-bottom: 0cm"><br/>
36343645

36353646
</p>
36363647
<p style="margin-bottom: 0cm"><a name="DbCryptInfo"></a><font size="4" style="font-size: 14pt">DbCryptInfo
36373648
interface is passed to DbCryptPlugin by engine. Plugin may save this
3638-
interface and use when needed to obtain additional informatio about
3649+
interface and use when needed to obtain additional information about
36393650
database.</font></p>
36403651
<ol>
36413652
<li><p style="margin-bottom: 0cm"><font size="4" style="font-size: 14pt">const

examples/dbcrypt/CryptApplication.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,28 @@ class CryptKey : public ICryptKeyCallbackImpl<CryptKey, CheckStatusWrapper>
3636
{
3737
if (length > 0 && buffer)
3838
{
39-
char k = 0x5a;
4039
memcpy(buffer, &k, 1);
4140
fprintf(stderr, "\nTransfered key to server\n");
4241
}
4342
return 1;
4443
}
44+
45+
int getHashLength(Firebird::CheckStatusWrapper* status) override
46+
{
47+
return 1;
48+
}
49+
50+
void getHashData(Firebird::CheckStatusWrapper* status, void* h) override
51+
{
52+
memcpy(h, &k, 1);
53+
}
54+
55+
private:
56+
static const char k;
4557
};
4658

59+
const char CryptKey::k = 0x5a;
60+
4761
class App
4862
{
4963
public:

examples/dbcrypt/CryptKeyHolder.cpp

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class CryptKeyHolder : public IKeyHolderPluginImpl<CryptKeyHolder, CheckStatusWr
7070
public:
7171
explicit CryptKeyHolder(IPluginConfig* cnf) noexcept
7272
: callbackInterface(this), named(NULL), tempStatus(master->getStatus()),
73-
config(cnf), key(0), owner(NULL)
73+
config(cnf), key(0), init(false), owner(NULL)
7474
{
7575
config->addRef();
7676
}
@@ -111,10 +111,13 @@ class CryptKeyHolder : public IKeyHolderPluginImpl<CryptKeyHolder, CheckStatusWr
111111
return owner;
112112
}
113113

114-
ISC_UCHAR getKey()
114+
const ISC_UCHAR& getKey()
115115
{
116-
if (!key)
116+
if (!init)
117+
{
117118
keyCallback(&tempStatus, NULL);
119+
init = true;
120+
}
118121

119122
return key;
120123
}
@@ -140,7 +143,7 @@ class CryptKeyHolder : public IKeyHolderPluginImpl<CryptKeyHolder, CheckStatusWr
140143

141144
unsigned int callback(unsigned int, const void*, unsigned int length, void* buffer) override
142145
{
143-
ISC_UCHAR k = holder->getKey();
146+
const ISC_UCHAR& k = holder->getKey();
144147
if (!k)
145148
{
146149
return 0;
@@ -153,6 +156,36 @@ class CryptKeyHolder : public IKeyHolderPluginImpl<CryptKeyHolder, CheckStatusWr
153156
return 1;
154157
}
155158

159+
int getHashLength(Firebird::CheckStatusWrapper* status) override
160+
{
161+
const ISC_UCHAR& k = holder->getKey();
162+
if (!k)
163+
{
164+
ISC_STATUS err[] = {isc_arg_gds, isc_wish_list};
165+
status->setErrors2(2, err);
166+
167+
return -1;
168+
}
169+
170+
return 1;
171+
}
172+
173+
void getHashData(Firebird::CheckStatusWrapper* status, void* h) override
174+
{
175+
// here key value is returned by hash function as is
176+
// do not do it in production - use some hash function
177+
const ISC_UCHAR& k = holder->getKey();
178+
if (!k)
179+
{
180+
ISC_STATUS err[] = {isc_arg_gds, isc_wish_list};
181+
status->setErrors2(2, err);
182+
183+
return;
184+
}
185+
186+
memcpy(h, &k, 1);
187+
}
188+
156189
private:
157190
CryptKeyHolder* holder;
158191
};
@@ -173,6 +206,18 @@ class CryptKeyHolder : public IKeyHolderPluginImpl<CryptKeyHolder, CheckStatusWr
173206
return 1;
174207
}
175208

209+
int getHashLength(Firebird::CheckStatusWrapper* status) override
210+
{
211+
return 1;
212+
}
213+
214+
void getHashData(Firebird::CheckStatusWrapper* status, void* h) override
215+
{
216+
// here key value is returned by hash function as is
217+
// do not do it in production - use some hash function
218+
memcpy(h, &key, 1);
219+
}
220+
176221
~NamedCallback()
177222
{
178223
delete next;
@@ -189,6 +234,7 @@ class CryptKeyHolder : public IKeyHolderPluginImpl<CryptKeyHolder, CheckStatusWr
189234

190235
IPluginConfig* config;
191236
ISC_UCHAR key;
237+
bool init;
192238

193239
std::atomic_int refCounter;
194240
IReferenceCounted* owner;

extern/icu/tzdata/be.zip

50 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)