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

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

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

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

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

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'm

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

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

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 virtual table

Re: [Firebird-odbc-devel] issues with PowerBi (Microsoft) and firebird database

2018-05-28 Thread Dimitry Sibiryakov
28.05.2018 6:34, Matz Wentingmann wrote: The value SQL_CONVERT_GUID is expected with ODBC 3.x, but the driver does not know it. IIRC, Firebird ODBC supports ODBC v2 only. -- WBR, SD. -- Check out the vibrant

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

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

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

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

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

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

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

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

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:

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

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

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

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

[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

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

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

Re: [Firebird-odbc-devel] reading the just generated identity throws an exception

2018-05-14 Thread Dimitry Sibiryakov
14.05.2018 12:46, Michael von Boetticher wrote: I need to know the generated ID for further actions in other subtables. Has somebody the same issue and even better - a solution for this? Use INSERT RETURNING. -- WBR, SD.

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

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

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

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

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

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?

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

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

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

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.

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

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

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

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

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

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. --

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

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] 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.

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

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

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

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

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

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

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

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

[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

[Firebird-devel] Database encryption

2018-03-31 Thread Dimitry Sibiryakov
Hello, All. Is it intentional that database cannot be encrypted via remote connection if encryption plugin requires key obtained from application callback? I'm getting following error: Statement failed, SQLSTATE = 42000 unsuccessful metadata update -ALTER DATABASE failed -Missing

Re: [Firebird-devel] Status and planning of timezone support

2018-03-31 Thread Dimitry Sibiryakov
31.03.2018 15:38, Adriano dos Santos Fernandes wrote: The more difficult things is done but not yet committed, region-based time zones (using ICU). But there are tasks yet to do: - Windows ICU should probably be updated - See how and adjust the code for the way to make possible for us to

Re: [Firebird-devel] Getting location of fbclient.dll via IExternalContext

2018-03-26 Thread Dimitry Sibiryakov
26.03.2018 18:04, Jiří Činčura wrote: Just use LoadLibrary() without path. The library is for sure already loaded into address space, so the function will return handle to it without further searching. I need the string. Not load the library. Then everything is even simplier:

Re: [Firebird-devel] Getting location of fbclient.dll via IExternalContext

2018-03-26 Thread Dimitry Sibiryakov
26.03.2018 17:49, Jiří Činčura wrote: Hmm, found `context->getMaster()->getConfigManager()->getRootDirectory()`. Is there a better/shorter way? Just use LoadLibrary() without path. The library is for sure already loaded into address space, so the function will return handle to it without

Re: [Firebird-devel] Executing statement in the same context as external engine execution

2018-03-26 Thread Dimitry Sibiryakov
26.03.2018 17:12, Jiří Činčura wrote: The OO API has one major drawback. It's OO. It is not actually OO. It is just structures of plain function pointers. The only thing that is missed in this "OO API" is a structure with pointers to ISC functions. Such structure would solve the rest of

Re: [Firebird-devel] Valid date or not

2018-02-28 Thread Dimitry Sibiryakov
28.02.2018 16:42, Leyne, Sean wrote: Based on this, and considering legacy FB applications I propose the following: 1- The only acceptable string format for the new Date/Time with Timezone datatypes should be the ISO/SQL standard 2- Only legacy DATE and TIMESTAMP datatype would maintain

Re: [Firebird-devel] Existing a subject of privileges and refactoring

2018-02-20 Thread Dimitry Sibiryakov
20.02.2018 13:14, Alex Peshkoff via Firebird-devel wrote: 2) We have no check of existance a subjects of privileges. I.e. SQL> create table t(i integer); SQL> grant select on t to wrong_func; SQL> show function wrong_func; There is no user-defined function WRONG_FUNC in this database I tend to

Re: [Firebird-devel] Existing a subject of privileges and refactoring

2018-02-20 Thread Dimitry Sibiryakov
20.02.2018 12:55, Roman Simakov wrote: 2) We have no check of existance a subjects of privileges. I.e. SQL> create table t(i integer); SQL> grant select on t to wrong_func; SQL> show function wrong_func; There is no user-defined function WRONG_FUNC in this database I tend to consider it as a

[Firebird-devel] [FB-Tracker] Created: (CORE-5741) Word "fixing" in gbak output is too scary

2018-02-05 Thread Dimitry Sibiryakov (JIRA)
Affects Versions: 3.0.3, 4.0 Alpha 1 Reporter: Dimitry Sibiryakov Priority: Trivial It implies that something is broken. Using of "adjust" or "set" would be better. -- This message is automatically generated by JIRA. - If you think it wa

Re: [Firebird-devel] DEC_FIXED implementation, Decimal128 is unscaled?

2018-02-03 Thread Dimitry Sibiryakov
03.02.2018 14:19, Dmitry Yemanov wrote: 03.02.2018 16:05, Mark Rotteveel wrote: I assume this to also mean the blr_dec_fixed is removed From the client-server interaction - yes, but supposedly not in general, as it still can back physical field storage / PSQL variables / etc. Variables

Re: [Firebird-devel] DEC_FIXED implementation, Decimal128 is unscaled?

2018-02-03 Thread Dimitry Sibiryakov
03.02.2018 14:05, Mark Rotteveel wrote: 1. When sending values from client to server, will Firebird reject values with the wrong scale for subtypes 1 and 2, or round them to the correct scale? As an example, will sending 12.345 (12345e-3) for a DECIMAL(34,2) be rejected with an incorrect

Re: [Firebird-devel] DEC_FIXED implementation, Decimal128 is unscaled?

2018-02-02 Thread Dimitry Sibiryakov
02.02.2018 20:35, Mark Rotteveel wrote: On 2-2-2018 20:19, Dimitry Sibiryakov wrote: 02.02.2018 20:03, Mark Rotteveel wrote: I have the feeling I'm missing part of the discussion here    Thunderbird used to reply to author of message directly instead of sending reply to list. It can

Re: [Firebird-devel] DEC_FIXED implementation, Decimal128 is unscaled?

2018-02-02 Thread Dimitry Sibiryakov
02.02.2018 20:03, Mark Rotteveel wrote: I have the feeling I'm missing part of the discussion here Thunderbird used to reply to author of message directly instead of sending reply to list. It can be changed in settings. -- WBR, SD.

Re: [Firebird-devel] DEC_FIXED implementation, Decimal128 is unscaled?

2018-02-02 Thread Dimitry Sibiryakov
02.02.2018 19:08, Alex Peshkoff wrote: On 02/02/18 19:40, Dimitry Sibiryakov wrote: 02.02.2018 17:25, Alex Peshkoff via Firebird-devel wrote: I.e. to represent NUMERIC/DECIMAL(M, N) where M > 18 will be used SQL_DEC34 with sqlsubtype 1/2? But what should be the value of sql_scale? On the

Re: [Firebird-devel] DEC_FIXED implementation, Decimal128 is unscaled?

2018-02-02 Thread Dimitry Sibiryakov
02.02.2018 17:25, Alex Peshkoff via Firebird-devel wrote: I.e. to represent NUMERIC/DECIMAL(M, N) where M > 18 will be used SQL_DEC34 with sqlsubtype 1/2? But what should be the value of sql_scale? On the one hand in should be non-zero to let user know how many digits after decimal point may be

Re: [Firebird-devel] DEC_FIXED implementation, Decimal128 is unscaled?

2018-02-01 Thread Dimitry Sibiryakov
01.02.2018 17:04, Mark Rotteveel wrote: Let me try to rephrase: for DECFLOAT we use Decimal128 which includes the correct scale, and for DECIMAL(19+) we use Decimal128 with a scale of zero, and the correct scale communicated externally, which then needs to be applied separately. That to me as

Re: [Firebird-devel] DEC_FIXED implementation, Decimal128 is unscaled?

2018-02-01 Thread Dimitry Sibiryakov
01.02.2018 16:30, Alex Peshkoff via Firebird-devel wrote: Point taken, but my suggestion was more that we now don't utilize the Decimal128 to its fullest for decimal, and users of the direct API now need to handle decfloat and decimal(19+, x) in a very different manner even though the

Re: [Firebird-devel] DEC_FIXED implementation, Decimal128 is unscaled?

2018-02-01 Thread Dimitry Sibiryakov
01.02.2018 12:44, Mark Rotteveel wrote: On 27-1-2018 19:30, Dmitry Yemanov wrote: 27.01.2018 20:18, Mark Rotteveel wrote: I'm implementing the new precision 34 decimal/numeric support in Jaybird, and I notice that the underlying Decimal128 is used as just an integer container, instead of

Re: [Firebird-devel] About support for embed into iOS/Android

2018-01-18 Thread Dimitry Sibiryakov
18.01.2018 16:56, Carlos H. Cantu wrote: And you notified them that is available? And in conferences talk about this? Most of them I don't have the personal contact, because it was just talks during the FDD conferences. And yes, in the last FDD (2017) we had a entire session about "FB for

Re: [Firebird-devel] Weird date/time literals

2018-01-18 Thread Dimitry Sibiryakov
18.01.2018 11:57, Dmitry Yemanov wrote: IMO, no sane person would rely on that intentionally. Why? This is the only method to get procedure compilation time, AFAIR. -- WBR, SD. -- Check out the vibrant tech

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