Re: [Firebird-devel] Smart end of statement detection in ISQL

2018-06-24 Thread Dimitry Sibiryakov
24.06.2018 20:09, Adriano dos Santos Fernandes wrote: Here is a valid ISQL code with "TERM ;" and "AUTOTERM ON": Check it with packages. -- WBR, SD. -- Check out the vibrant tech community on one of the world's m

Re: [Firebird-devel] Services version 1 cleanup

2018-06-19 Thread Dimitry Sibiryakov
19.06.2018 15:42, Alex Peshkoff via Firebird-devel wrote: I plan to clean up support of them except anonymous (it may be used to ping server) in HEAD. Any objections? I would vote to clean out "service_mgr" as well and either to ignore this part of connection string completely or threat it a

Re: [Firebird-devel] Listing all SYSTEM context variable names

2018-06-15 Thread Dimitry Sibiryakov
15.06.2018 20:33, Leyne, Sean wrote: I see it similar to the list of KEYWORDS -- it is not something that is SELECTable In Firebird - yes. But Oracle, for example, has V$RESERVED_WORDS. -- WBR, SD. -- Check out

Re: [Firebird-devel] Listing all SYSTEM context variable names

2018-06-15 Thread Dimitry Sibiryakov
15.06.2018 17:19, Mark Rotteveel wrote: Having to rely on external lists like the Firebird 2.5 language reference is a bit too brittle for my tastes, I'd like the truth according to the Firebird itself. But documentation is the only place where you can see name of variable and its meaning. K

Re: [Firebird-devel] Write to firebird log file from plugin

2018-06-14 Thread Dimitry Sibiryakov
14.06.2018 17:47, Alex Peshkoff via Firebird-devel wrote: Can you explain a reason why your plugin can not use functions exported from some library? I prefer not to add another dependency layer without extreme need. Synchronization of internal thread during library unload is already tricky,

Re: [Firebird-devel] Write to firebird log file from plugin

2018-06-14 Thread Dimitry Sibiryakov
14.06.2018 17:20, Dmitry Yemanov wrote: IIRC, gds__log() is exported from fbclient. Yes, but everything that a plugin has is IMaster. I can get log dir from it, so I can write my own log alongside to firebird.log, but writing into firebird.log itself could provide more consistent picture of

[Firebird-devel] Write to firebird log file from plugin

2018-06-14 Thread Dimitry Sibiryakov
Hello, All. In my plugin I start a thread that do some internal work common for all plugin's instances. If this thread encountered some errors, I would like to log them somehow to let administrator a hint what is wrong before killing whole process. Is there a way for a plugin to write a

Re: [Firebird-devel] Support for XTS mode of operation in DbCrypt plugins

2018-06-08 Thread Dimitry Sibiryakov
08.06.2018 17:47, Hristo Stefanov wrote: It has 4 cores but the openssl benchmark is single threaded. Here are the repeated benchmarks with the openssl process pinned to a single core on the Intel(R) Core(TM) i5-2500 CPU: It doesn't matter for speculative execution. Run 4 benchmarks in parall

Re: [Firebird-devel] Support for XTS mode of operation in DbCrypt plugins

2018-06-08 Thread Dimitry Sibiryakov
08.06.2018 17:19, Hristo Stefanov wrote: After running some benchmarks of CBC and XTS mode it turns out XTS is about 4 times faster on the following hardware: Intel(R) Core(TM) i5-2500 CPU There is no wonder at: your CPU has 4 cores and CBC cannot be parallelized. The difference should be l

Re: [Firebird-devel] Support for XTS mode of operation in DbCrypt plugins

2018-06-08 Thread Dimitry Sibiryakov
08.06.2018 15:44, Hristo Stefanov wrote: With future ODS changes this may not be the case. Any ODS will have some kind of internal headers in the beginning of data just because there is no way to get rid of them. -- WBR, SD. -

Re: [Firebird-devel] Support for XTS mode of operation in DbCrypt plugins

2018-06-08 Thread Dimitry Sibiryakov
08.06.2018 14:25, Hristo Stefanov wrote: Yes CBC mode does that but since it is applied using the same IV and the same key multiple times it is open to chosen-plaintext attacks as noted here: https://defuse.ca/cbcmodeiv.htm A more real world example is given here: https://stackoverflow.com/que

Re: [Firebird-devel] TRANSACTION START trigger

2018-06-08 Thread Dimitry Sibiryakov
08.06.2018 11:01, Vlad Khorsun via Firebird-devel wrote:   Another question is how to handle rollback error. I mean rollback that run at catch block. I offer to ignore rollback error (maybe log it into firebird.log, if database is not bug-checked) - we can do nothing with it anyway. I'd pre

Re: [Firebird-devel] Support for XTS mode of operation in DbCrypt plugins

2018-06-07 Thread Dimitry Sibiryakov
07.06.2018 22:52, Hristo Stefanov wrote: I started the discussion because of this presentation: https://www.firebirdsql.org/file/community/conference-2016/encrypting-firebird-databases.pdf with the following quote: Known issue: – Encrypted size == initial size I don't understand why this i

Re: [Firebird-devel] Support for XTS mode of operation in DbCrypt plugins

2018-06-07 Thread Dimitry Sibiryakov
07.06.2018 19:47, Alex Peshkoff via Firebird-devel wrote: Access to server's file system and server's RAM are rather different things. Not quite so. If someone can write a library into plugins subdir - memory is accessible. Of course, no write access to FS makes things a little harder. --

Re: [Firebird-devel] Support for XTS mode of operation in DbCrypt plugins

2018-06-07 Thread Dimitry Sibiryakov
07.06.2018 19:08, Alex Peshkoff via Firebird-devel wrote: As I've already said if one has access to server's RAM there are a lot of ways to get both unencrypted data & keys. But that's 'slightly' different level compared with intercepting of network messages. Yes, but this is exactly what H

Re: [Firebird-devel] Support for XTS mode of operation in DbCrypt plugins

2018-06-07 Thread Dimitry Sibiryakov
07.06.2018 18:40, Alex Peshkoff via Firebird-devel wrote: Ability to easily get ncryption key from working connections mean badly written KeyHolder. No matter how well is written KeyHolder, thanks to CLOOP signatures it is very easy to identify and hijack encrypt/decrypt routines of crypt p

Re: [Firebird-devel] Support for XTS mode of operation in DbCrypt plugins

2018-06-07 Thread Dimitry Sibiryakov
07.06.2018 18:19, Hristo Stefanov wrote: For example you have reached a server in corporate network At this point encryption cannot protect database anymore because you can easily get unencrypted data or even encryption key from working connections no matter what block chaining is used. -

Re: [Firebird-devel] Support for XTS mode of operation in DbCrypt plugins

2018-06-07 Thread Dimitry Sibiryakov
07.06.2018 17:30, Hristo Stefanov wrote: Record compression is RLE based (AFAIK) and doesn't fuzz the data if there are no successive repetitions in the same field which I imagine is mostly true for some kinds of data including English text. English text has no patterns divisible to 16 bytes,

Re: [Firebird-devel] Support for XTS mode of operation in DbCrypt plugins

2018-06-07 Thread Dimitry Sibiryakov
07.06.2018 16:29, Hristo Stefanov wrote: I meant primarily patterns in the data pages of a database file. Patterns in data are fuzzed by record compression. BLOBs may be troublesome if someone is stupid enough to keep in a database bitmaps instead of JPEGs. -- WBR, SD. -

Re: [Firebird-devel] Support for XTS mode of operation in DbCrypt plugins

2018-06-07 Thread Dimitry Sibiryakov
07.06.2018 16:11, Hristo Stefanov wrote: The main advantage of using XTS would be that the ciphertext would be bound to its location which eliminates repeating ciphertext which otherwise helps for identifying patterns within the database file. Patterns of encrypted pages are well known from s

Re: [Firebird-devel] Support for XTS mode of operation in DbCrypt plugins

2018-06-07 Thread Dimitry Sibiryakov
07.06.2018 14:37, Hristo Stefanov wrote: [*] Not always true currently. There is a DbCrypt plugin sanity routine that passes a 16 byte chunk to test encryption and decryption and a routine for calculating a digital signature which passes a multiple of 16 byte chunk that is way shorter than the mi

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-28 Thread Dimitry Sibiryakov
28.05.2018 16:45, Vlad Khorsun via Firebird-devel wrote:    On one hand third option would be consistent with behavior of isc_detach_database() on client. On the other hand server cannot handle such error and it will result in endless transaction with all consequences.   Not sure i understand

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-28 Thread Dimitry Sibiryakov
28.05.2018 14:13, Vlad Khorsun via Firebird-devel wrote: - forcebly rollback active transactions and reset connection   same as if connection was broken - raise error and don't reset connection.   Obviously, first case is not an option and we must choose between second and third. So far i pre

Re: [Firebird-devel] System procedures

2018-05-28 Thread Dimitry Sibiryakov
28.05.2018 12:32, Adriano dos Santos Fernandes wrote: On 28/05/2018 07:30, Dimitry Sibiryakov wrote:   I mean: during creation of database already created many definitions for tables, generators and so on. It is easy to add definition for couple of UDRs the same way. Where did you read I&#

Re: [Firebird-devel] System procedures

2018-05-28 Thread Dimitry Sibiryakov
28.05.2018 12:27, Dimitry Sibiryakov wrote: 28.05.2018 12:21, Adriano dos Santos Fernandes wrote:    What's the difference between built-in UDR and "system procedure coded in C++"? *U*  stands for User. Need to have metadata manually created. Cannot access engine internals if

Re: [Firebird-devel] System procedures

2018-05-28 Thread Dimitry Sibiryakov
28.05.2018 12:21, Adriano dos Santos Fernandes wrote:   What's the difference between built-in UDR and "system procedure coded in C++"? *U* stands for User. Need to have metadata manually created. Cannot access engine internals if needed. In SysFunction.cpp there is a lot of system functi

Re: [Firebird-devel] System procedures

2018-05-28 Thread Dimitry Sibiryakov
28.05.2018 12:16, Adriano dos Santos Fernandes wrote: On 28/05/2018 06:16, Dimitry Sibiryakov wrote: 28.05.2018 3:04, Adriano dos Santos Fernandes wrote: I'm adding system procedure support, coded in C++, initially for list time zone rule transition, as it can't be done with vir

Re: [Firebird-devel] System procedures

2018-05-28 Thread Dimitry Sibiryakov
28.05.2018 3:04, Adriano dos Santos Fernandes wrote: I'm adding system procedure support, coded in C++, initially for list time zone rule transition, as it can't be done with virtual table (needs parameters). Aren't UDRs already implemented? -- WBR, SD. --

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-25 Thread Dimitry Sibiryakov
25.05.2018 17:51, Vlad Khorsun via Firebird-devel wrote: I.e. all works a bit slower than before v4.    I think that it can be a good motivation to upgrade remote server to v4.   Bad joke I was serious. I see people still use old Firebird versions. IMHO, it would be good to offer them s

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-25 Thread Dimitry Sibiryakov
25.05.2018 17:26, Vlad Khorsun via Firebird-devel wrote: I.e. all works a bit slower than before v4. I think that it can be a good motivation to upgrade remote server to v4. All works much faster than before v4. Do you have some numbers for this "much" to see if speed overweight support

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-25 Thread Dimitry Sibiryakov
25.05.2018 15:53, Vlad Khorsun via Firebird-devel wrote:   Remote statement could check some context variable and run this or that branch of code in dependence of variable value. Then it could assign another value to this context variable. It all could be done in the single stored procedure cal

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-25 Thread Dimitry Sibiryakov
25.05.2018 15:45, Vlad Khorsun via Firebird-devel wrote: 1. Always reset external connection when it gets out of use. Close connection if any kind of error happens.    It actually disables connections pool for pre-v4 remote servers. It could be done by disabling pool in config. I think we can

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-25 Thread Dimitry Sibiryakov
25.05.2018 15:28, Vlad Khorsun via Firebird-devel wrote: We have local server v4 and remote server v3. v4 runs external statements against v3 and remote sessions have some context that is re-used by remote statements somehow. Then remote server is upgraded to v4 and remote sessions gets rese

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-24 Thread Dimitry Sibiryakov
24.05.2018 10:50, Vlad Khorsun via Firebird-devel wrote:    From reading documentation I have a feeling that currently external connection is reused only within transaction. When local transaction ends, connection is disconnected.   Yes, almost    Am I wrong?   Yes. Above i speak about v4

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-24 Thread Dimitry Sibiryakov
24.05.2018 1:08, Vlad Khorsun via Firebird-devel wrote: 24.05.2018 0:39, Dimitry Sibiryakov wrote:    What visible changes can happen after upgrade of server version?   We have local server v4 and remote server v3. v4 runs external statements against v3 and remote sessions have some context

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-23 Thread Dimitry Sibiryakov
23.05.2018 21:18, Vlad Khorsun via Firebird-devel wrote: At second, there is no way to upgrade server without breaking established connection (obviously). Nobody tell about it. And it change nothing. Then could you, please, explain what you have on mind when said "remote server coul

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-23 Thread Dimitry Sibiryakov
23.05.2018 14:40, Mark Rotteveel wrote: I think it should unconditionally do a session reset on return to the pool if the protocol is v16 or higher (assuming v16 is the Firebird 4 protocol version).    This is not truly unconditionally :)    But relying on protocol version is also not perfect

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-23 Thread Dimitry Sibiryakov
23.05.2018 13:51, Vlad Khorsun via Firebird-devel wrote:   I strongly suggest to consider existing DISCONNECT\CONNECT triggers also. I think, most of the code will be the same in both set of events therefore it is very questionable if we need another pair of triggers. I agree, existing trigg

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-23 Thread Dimitry Sibiryakov
23.05.2018 11:58, Dmitry Yemanov wrote: Wouldn't it make sense to call ON DISCONNECT triggers when the connection is released into the pool and ON CONNECT triggers when the connection gets reused from the pool? Do you mean that ALTER SESSION RESET should call them instead of inventing new typ

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-23 Thread Dimitry Sibiryakov
23.05.2018 11:39, Vlad Khorsun via Firebird-devel wrote:    What useful could such trigger do?   I suppose - the most of the thing that users do on CONNECT (init some context variables, for example) and DISCONNECT (free some resources). In this case I guess there must be two triggers: BEFO

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-23 Thread Dimitry Sibiryakov
23.05.2018 11:24, Vlad Khorsun via Firebird-devel wrote: - At tracker there was proposition to add new database trigger ON RESET which should   fire when ALTER SESSION RESET is run. Should we implement it ? What useful could such trigger do? -- WBR, SD.

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-21 Thread Dimitry Sibiryakov
21.05.2018 10:13, Mark Rotteveel wrote:   if pool contain connection to database 1 and user try to connect to also database 1 he can use pool instead normal connection. That wouldn't really work Yes, that wouldn't work. But generally speaking pools in Y-valve could be potentially a little

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-20 Thread Dimitry Sibiryakov
20.05.2018 17:29, Vlad Khorsun via Firebird-devel wrote:   Where do you see it ? You are right, it is nowhere in main tree. Sorry, I missed it up with one of my branches. In any case it is easy to add cache object to ConfigImpl constructor. ConfigFile is ready for that. -- WBR, SD.

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-20 Thread Dimitry Sibiryakov
20.05.2018 16:25, Adriano dos Santos Fernandes wrote: Isn't (some parts of) the config file already reloaded sometimes (timeout)? Firebird.conf is reloaded when its timestamp changed. Plugins' configs are not reloaded. -- WBR, SD.

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-20 Thread Dimitry Sibiryakov
20.05.2018 13:11, liviuslivius wrote: can i ask why this is only for external connections? 2 databases. One user run execute statement on database 1 from 2 second on database 2 from 1. Third connect simply to database 1 why it can not benefit from pool? For achieving that the implementations

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-20 Thread Dimitry Sibiryakov
20.05.2018 13:00, Vlad Khorsun via Firebird-devel wrote:    I'd suggest to add to EDS an option to use "isolated" connection, which is guaranteed the connection to be new and after use to be deleted, not returned to pool.   Why one should need it ? If one don't want to use pool - just disable

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-20 Thread Dimitry Sibiryakov
19.05.2018 18:44, Vlad Khorsun via Firebird-devel wrote:   Nothing special was done in this area - GTT contents will be preserved. The same for context variables.   So, we have a question - should we clear session-level state when connection become unused (or when it about to be re-used) ?

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-19 Thread Dimitry Sibiryakov
"SET ROLE" statement issued in EDS is not handled in any way, right? -- WBR, SD. -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot Firebir

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-19 Thread Dimitry Sibiryakov
19.05.2018 18:25, Vlad Khorsun via Firebird-devel wrote:   We have single engine instance (local) which handle connections to two databases each of them have own security database. Both security databases contains user John. Both John's established own connection to the different databases and

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-19 Thread Dimitry Sibiryakov
19.05.2018 17:11, Vlad Khorsun via Firebird-devel wrote:   Also, i want to speak about possible extension of the feature. I think it would be good to have new monitoring table with list of all external connections. Not sure if we should allow to DELETE here but it should be at least considered

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-18 Thread Dimitry Sibiryakov
18.05.2018 21:30, Vlad Khorsun via Firebird-devel wrote:   So far there is no such decision (to consider engine13.conf as a "right place" and that firebird.conf is legacy). And I see no reason to discuss it in this thread. README.plugins clearly state this: when plugin PlugName is needed

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-18 Thread Dimitry Sibiryakov
18.05.2018 20:49, Vlad Khorsun via Firebird-devel wrote:   Whole EDS feature is implemented as part of engine. Shouldn't new configuration parameters to be in the right place for plugin's parameters: engine13.conf instead of legacy pile firebird.conf?.. -- WBR, SD. ---

Re: [Firebird-devel] RFC: External Connections Pool

2018-05-18 Thread Dimitry Sibiryakov
18.05.2018 18:44, Vlad Khorsun via Firebird-devel wrote:   Please, read and comment: Is the connection pool an "engine thing" or it is at server/Y-valve level? Isn't password redundant in search? -- WBR, SD. -

Re: [Firebird-devel] MessageBuffer vs C struct alignment

2018-05-15 Thread Dimitry Sibiryakov
15.05.2018 11:58, Alex Peshkoff via Firebird-devel wrote:   Do alignment of fields in C struct matches alignment of the same fields in MessageBuffer?   If at compile/preprocess time construct a struct to be used directly in OO API, will it be reliable? Not always.  For example, on 32-bit linu

[Firebird-devel] MessageBuffer vs C struct alignment

2018-05-15 Thread Dimitry Sibiryakov
Hello, All. Do alignment of fields in C struct matches alignment of the same fields in MessageBuffer? If at compile/preprocess time construct a struct to be used directly in OO API, will it be reliable? -- WBR, SD. -

[Firebird-devel] [FB-Tracker] Created: (CORE-5824) Segmentation fault during install on Linux

2018-05-14 Thread Dimitry Sibiryakov (JIRA)
Versions: 3.0.3 Environment: Ubuntu 14.04, any bitness Reporter: Dimitry Sibiryakov Attachments: bt.txt.bz2 During install gsec crash with segmentation fault error. Backtraces of all threads is attached. It looks like engine gets unloaded while service thread is not

Re: [Firebird-devel] Virtual table for time zones

2018-05-14 Thread Dimitry Sibiryakov
14.05.2018 14:55, Vlad Khorsun via Firebird-devel wrote: Can I register a new rule for time zones without updating Firebird and the backup/restore process? If so, is there a DLL syntax for registering a new time zone rule?   This is interesting and valid question (as for me). With such possib

Re: [Firebird-devel] Key holder is not used if keyCallback() returned 0

2018-05-14 Thread Dimitry Sibiryakov
14.05.2018 14:28, Alex Peshkoff via Firebird-devel wrote:   Number of combination growth as N^2 at least. Writing of separate plugins for each possible use case is... boring. What combinations? Key holder may need to establish connection to client or may not. I see 2 cases here. Ok, you ar

Re: [Firebird-devel] Key holder is not used if keyCallback() returned 0

2018-05-14 Thread Dimitry Sibiryakov
14.05.2018 11:57, Alex Peshkoff via Firebird-devel wrote: If key holder is expected to work with both types of keys secrtainly it should try to talk to client. One written only for use of non-client keys should not. Wjat a problem? Number of combination growth as N^2 at least. Writing of sepa

Re: [Firebird-devel] Key holder is not used if keyCallback() returned 0

2018-05-14 Thread Dimitry Sibiryakov
14.05.2018 11:42, Alex Peshkoff via Firebird-devel wrote: Returning to your cases: a) ICryptKeyCallback::callback() returned zero because application key not needed Well written key holder will not try to talk to client at all if it already has a key... No matter how key holder is written

Re: [Firebird-devel] Time zone feature documentation

2018-05-12 Thread Dimitry Sibiryakov
12.05.2018 16:24, Adriano dos Santos Fernandes wrote:   In decode/encode functions what fractions are used? Is it Firebird legacy fractions in 1/1 of a second or standard fractions in 1/10 of a second? Same as with the WITHOUT tz types. Isn't it better to support a standard nin

Re: [Firebird-devel] Time zone feature documentation

2018-05-12 Thread Dimitry Sibiryakov
11.05.2018 18:31, Adriano dos Santos Fernandes wrote: Here is the first README version for the time zone feature. In decode/encode functions what fractions are used? Is it Firebird legacy fractions in 1/1 of a second or standard fractions in 1/10 of a second? I see no mention

Re: [Firebird-devel] Virtual table for time zones

2018-05-11 Thread Dimitry Sibiryakov
11.05.2018 13:22, Adriano dos Santos Fernandes wrote: I do not thought about it, but would be very good to put them in another virtual table if possible. May be a package with a set of procedures would be better then?.. -- WBR, SD.

Re: [Firebird-devel] Virtual table for time zones

2018-05-10 Thread Dimitry Sibiryakov
10.05.2018 19:14, Adriano dos Santos Fernandes wrote:   IMHO, one of advantages of using UDR for subj is that much more fields can be added any time as needed by upgrading a single library while a virtual table is fixed to ODS and has to be decided once and forever. UDR needs metadata too, so

Re: [Firebird-devel] Virtual table for time zones

2018-05-10 Thread Dimitry Sibiryakov
10.05.2018 18:44, Vlad Khorsun via Firebird-devel wrote:   Is it possible\make sence to add a datetime field with "valid from" mark ? Or something like that, some kind of version mark. IMHO, one of advantages of using UDR for subj is that much more fields can be added any time as needed by

Re: [Firebird-devel] Virtual table for time zones

2018-05-10 Thread Dimitry Sibiryakov
10.05.2018 17:57, Adriano dos Santos Fernandes wrote: May make sense, but I think we didn't defined what is the difference between a virtual table and these things, specially that a view would also accept update/delete that triggers an action, a thing currently used in virtual tables. The UDR

Re: [Firebird-devel] Virtual table for time zones

2018-05-10 Thread Dimitry Sibiryakov
10.05.2018 17:21, Adriano dos Santos Fernandes wrote: I want to create a virtual table that lists available time zones. Why a virtual table instead of UDR or a view based on UDR? Using of UDR would provide more flexibility and guarantee that data are actual. -- WBR, SD. ---

Re: [Firebird-devel] Key holder is not used if keyCallback() returned 0

2018-05-10 Thread Dimitry Sibiryakov
10.05.2018 17:20, Alex Peshkoff via Firebird-devel wrote:   BTW, is there a way to distinguish cases when a) ICryptKeyCallback::callback() returned zero because application key not needed b) Application callback is not set Both cases are normal - return non-zro here. Not in the case if an

Re: [Firebird-devel] Two fbclient.dll with embedded connection (or remote + embedded) in one process

2018-05-05 Thread Dimitry Sibiryakov
05.05.2018 19:03, fbbt wrote: The problem: engine12.dll (loaded by fbclient.dll in second attach) tries to use foreign fbclient.dll (loaded on first attach). Because of static linking. This is known issue since 3.0 RC2:http://tracker.firebirdsql.org/browse/CORE-5123 Can this be fixed? The

Re: [Firebird-devel] SET DECFLOAT command

2018-05-03 Thread Dimitry Sibiryakov
03.05.2018 12:58, Alex Peshkoff via Firebird-devel wrote: The decision should be taken. Prior fb4 session control statement SET ROLE was treated as DDL. Now we have rather lot of such statements, separate type of node for them, and adding them to procedures/triggers bodies is not big technical p

Re: [Firebird-devel] SET DECFLOAT command

2018-05-03 Thread Dimitry Sibiryakov
03.05.2018 12:55, Mark Rotteveel wrote: I'm not sure I understand to use cases of needing/wanting to do that in an ON CONNECT trigger? It would seem that it would be a purely client-side decision which mode to use. Legacy applications without sources cannot issue new queries but can be recogn

Re: [Firebird-devel] SET DECFLOAT command

2018-05-03 Thread Dimitry Sibiryakov
03.05.2018 12:29, Alex Peshkoff via Firebird-devel wrote:   Is subj allowed in ON CONNECT triggers? Directly not - but one can run it via EXECUTE STATEMENT. What's the point for such complication? It is not a DDL. -- WBR, SD. -

[Firebird-devel] SET DECFLOAT command

2018-05-03 Thread Dimitry Sibiryakov
Hello, All. Is subj allowed in ON CONNECT triggers? -- WBR, SD. -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot Firebird-Devel mailing

Re: [Firebird-devel] Time zones

2018-05-03 Thread Dimitry Sibiryakov
01.05.2018 16:19, Adriano dos Santos Fernandes wrote:   What should be used by default ? It should match functionality and default of SET DECFLOAT, i.e., be default the new behavior (describe types with TZ as types with TZ). IMHO, default should be backward-compatible behavior. Actually,

Re: [Firebird-devel] Time zones

2018-05-02 Thread Dimitry Sibiryakov
02.05.2018 20:20, Adriano dos Santos Fernandes wrote:   Client library can add a timezone item into DPB if it is not provided by application, as it is done for application name now. Midware can set this value to whatever they like. Do not work that way. Web applications and middlewares works

Re: [Firebird-devel] Time zones

2018-05-02 Thread Dimitry Sibiryakov
01.05.2018 16:19, Adriano dos Santos Fernandes wrote:   What should be used by default ? It should match functionality and default of SET DECFLOAT, i.e., be default the new behavior (describe types with TZ as types with TZ). Problematic clients will use the legacy option. How? Legacy appli

Re: [Firebird-devel] Time zones

2018-05-02 Thread Dimitry Sibiryakov
30.04.2018 4:50, Adriano dos Santos Fernandes wrote: It was been created four new datatypes: - TIME WITH TIME ZONE - TIMESTAMP WITH TIME ZONE Do these contain time/timestamp in UTC and time zone, or time/timestamp in local time and time zone? So the first compatibility problem is when cli

Re: [Firebird-devel] Time zones

2018-05-01 Thread Dimitry Sibiryakov
01.05.2018 12:45, Vlad Khorsun wrote:   I'd add it into 2.5.9 also, as many users will upgrade from per-v3 versions.   BTW, we could (should ?) add more such forward-compatibility features into last release of 2.5 I'm not sure if adding new features into stable branches match project's rel

Re: [Firebird-devel] Time zones

2018-04-30 Thread Dimitry Sibiryakov
30.04.2018 4:50, Adriano dos Santos Fernandes wrote: Time zones branch is almost feature complete. EXTRACT(TIME ZONE FROM value). Does it work? What is type of result? Subtraction and comparison of TS WITH TZ from TS WITHOUT TZ and vice versa? Changing of TZ of value? CAST? Literals?

Re: [Firebird-devel] CHAR fields in system tables

2018-04-28 Thread Dimitry Sibiryakov
28.04.2018 13:44, Mark Rotteveel wrote: Sure, but is there any reason why this couldn't be changed with a new ODS? GPRE started to support VARCHAR in v4 only (and even there the support is limited) and a lot of code will have to be rewritten for such change. Core team have no time for clean

Re: [Firebird-devel] CHAR fields in system tables

2018-04-28 Thread Dimitry Sibiryakov
28.04.2018 13:38, fbbt wrote: select RDB$RELATION_NAME F from RDB$RELATIONS where RDB$RELATION_NAME like 'RDB$RELATIONS' Use '=' instead of 'LIKE', Luke! -- WBR, SD. -- Check out the vibrant tech community on on

Re: [Firebird-devel] Handling of database encryption callback for service operations

2018-04-26 Thread Dimitry Sibiryakov
26.04.2018 15:14, Mark Rotteveel wrote: I repeat that I find that odd. So do I. But that's the way it works in Firebird. Before 3.0.2 it worked in a little different way and key holder could delay calling of application's callback until it is really needed. Now it is impossible. -- WBR

Re: [Firebird-devel] Handling of database encryption callback for service operations

2018-04-26 Thread Dimitry Sibiryakov
26.04.2018 15:01, Mark Rotteveel wrote: Do you mean to say that the database encryption plugin doesn't know about the keyname used for encryption? That seems rather odd. At the point when encryption plugin knows database key, no application callback is possible: callback function is replaced

Re: [Firebird-devel] Handling of database encryption callback for service operations

2018-04-26 Thread Dimitry Sibiryakov
26.04.2018 14:52, Mark Rotteveel wrote: I'm not sure if that may also lead to problems for database encryption plugins that need database-specific information to correctly perform the callback (eg the keyname used?). It is impossible in any case. No encryption plugin that use database info fo

Re: [Firebird-devel] Handling of database encryption callback for service operations

2018-04-26 Thread Dimitry Sibiryakov
26.04.2018 14:09, Mark Rotteveel wrote: Encryption keys can be (or IMO should be) database specific, so the callback will need to have database-specific information. Let me explain: the callback is set by an application. The application must know exactly which database it will work with and

Re: [Firebird-devel] "Postfix for CORE-5791. Sorry to snapshot builds users..."

2018-04-17 Thread Dimitry Sibiryakov
17.04.2018 12:50, Jiří Činčura wrote: And more importantly, what's "Skipped due to Avalerion's blunder" about? It is supposed to be an insult to my side. Yes, I made a stupid mistake when believed to "we will release often, no minor ODS changes anymore". -- WBR, SD.

Re: [Firebird-devel] Legacy API functions for new features?

2018-04-16 Thread Dimitry Sibiryakov
16.04.2018 17:52, Adriano dos Santos Fernandes wrote: Should exist isc encode/decode time/timestamp tz (with time zone) API functions? Or could this be only in IUtil? I would say that it depends on how data types with time zones are represented at API level. Is there any description? --

[Firebird-devel] [FB-Tracker] Created: (CORE-5793) Error returned from DbCryptPlugin::setKey() is not shown

2018-04-14 Thread Dimitry Sibiryakov (JIRA)
Components: Engine Affects Versions: 3.0.3, 4.0 Alpha 1 Reporter: Dimitry Sibiryakov Meaningless error text "Missing correct crypt key" is returned to application in this case. It makes diagnostic of a problem harder than necessary. I'd suggest to append status returned fro

[Firebird-devel] Key holder is not used if keyCallback() returned 0

2018-04-14 Thread Dimitry Sibiryakov
Hello, All. What is a meaning of return value of keyCallback() routine? It is declared as int, not FB_BOOLEAN, so I guess it is not a flag "use me". But it looks like the engine give up if zero is returned even if no error is set in status. Documentation tells nothing about that. BTW

Re: [Firebird-devel] Suppress database encryption callback

2018-04-13 Thread Dimitry Sibiryakov
13.04.2018 17:01, Mark Rotteveel wrote: Let me rephrase: exactly what causes Firebird to perform a callback to the client, and what must a KeyHolderPlugin do to make sure no callback is performed. Firebird calls client callback when key holder in keyCallback() calls the callback received in

Re: [Firebird-devel] Suppress database encryption callback

2018-04-13 Thread Dimitry Sibiryakov
13.04.2018 16:47, Mark Rotteveel wrote: The person reporting the problem indicates a different plugin did not have this problem, which would indicate there is a way to suppress the callback. What does the plugin need to do to not perform a callback? It must be a plugin that never call the ca

Re: [Firebird-devel] Protocol for database encryption callback

2018-04-12 Thread Dimitry Sibiryakov
12.04.2018 17:51, Alex Peshkoff via Firebird-devel wrote: Other question: how does this work with named keys? Is it still a responsibility from the server-side plugin to communicate this in a implementation specific way? Yes. A little problem here: when key holder plugin can call callback i

Re: [Firebird-devel] Protocol for database encryption callback

2018-04-12 Thread Dimitry Sibiryakov
12.04.2018 16:51, Alex Peshkoff via Firebird-devel wrote: For example - KeyHolder has a private key of RSA pair, client software - a public one. Before sending something over the wire it's encrypted with public RSA, to decrypt it private part of pair is needed. Servers that do not have right pri

Re: [Firebird-devel] Protocol for database encryption callback

2018-04-12 Thread Dimitry Sibiryakov
12.04.2018 15:31, Alex Peshkoff via Firebird-devel wrote: In native API it's provider-specific - after getting an instance of provider one (who needs to use database encryption) should pass callback interface to that provider. Not provider, but dispatcher. You still cannot predict what provid

Re: [Firebird-devel] Database encryption

2018-04-02 Thread Dimitry Sibiryakov
02.04.2018 18:40, Alex Peshkoff via Firebird-devel wrote: It does not receive key name. chainHandle does transfer all keys application wants to send to the server. I see. It does that a way before server get to know if the database is encrypted at all. Wonderful: one key holder can get app

Re: [Firebird-devel] Database encryption

2018-04-02 Thread Dimitry Sibiryakov
02.04.2018 17:43, Alex Peshkoff via Firebird-devel wrote: - one more closed-source plugin I've used to deal with   Perhaps, it has the same limitations. No. Could you reveal the secret then: how application callback receives name of crypt key if it is called way before the key holder get

Re: [Firebird-devel] Sequence of key holder's methods calls

2018-04-02 Thread Dimitry Sibiryakov
02.04.2018 17:40, Alex Peshkoff via Firebird-devel wrote: With what release of firebird are you building your plugin? I mean first of all .h files. Firebird 3.0.4.32939, freshly built. Default configuration. Key holder is set in databases.conf for single database. Returning to your parti

Re: [Firebird-devel] Sequence of key holder's methods calls

2018-04-02 Thread Dimitry Sibiryakov
02.04.2018 16:58, Dimitry Sibiryakov wrote:   Could someone tell me why it is called three times in row, obviously from three different instances of crypt plugin (according to the last pointer in callback() call)? I thought that one instance is enough for one database in superserver mode

Re: [Firebird-devel] Database encryption

2018-04-02 Thread Dimitry Sibiryakov
02.04.2018 17:25, Alex Peshkoff via Firebird-devel wrote: Encryption of database using key passed from application over the wire works well in at least 2 known to me plugins: - DbCrypt_example/KeyHolder_example present in firebird distro This one can serve only one key for only one predefine

[Firebird-devel] Sequence of key holder's methods calls

2018-04-02 Thread Dimitry Sibiryakov
Hello, All. Firebird 3.0.4.32939. Default configuration. Key holder is set in databases.conf for single database. When I use "alter database encrypt" within embedded connection I see following sequence of calls to my key holder plugin: createPlugin is returning new KeyFileHolder obje

<    4   5   6   7   8   9   10   11   12   13   >