[Firebird-devel] Restoring DB into shutdown state

2016-03-23 Thread Jiří Činčura
Hi *,

Is there a SPB combination to restore database and keep it in shutdown?
Hence manually requiring to online it?

JC

-- 
Mgr. Jiří Činčura
Independent IT Specialist

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Restoring DB into shutdown state

2016-03-23 Thread Alex Peshkoff
On 03/23/2016 10:23 AM, Jiří Činčura wrote:
> Hi *,
>
> Is there a SPB combination to restore database and keep it in shutdown?

No

> Hence manually requiring to online it?
>
> JC
>


--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Restoring DB into shutdown state

2016-03-23 Thread Vlad Khorsun
23.03.2016 9:23, Jiří Činčura wrote:
> Hi *,
>
> Is there a SPB combination to restore database and keep it in shutdown?
> Hence manually requiring to online it?

   There is no direct way to do it (probably it could be a useful new feature),
but you may put db i shutdown before backup and it will be restored in the
same mode.

Regards,
Vlad


--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Restoring DB into shutdown state

2016-03-23 Thread Alex Peshkoff
On 03/23/2016 11:15 AM, Vlad Khorsun wrote:
> 23.03.2016 9:23, Jiří Činčura wrote:
>> Hi *,
>>
>> Is there a SPB combination to restore database and keep it in shutdown?
>> Hence manually requiring to online it?
> There is no direct way to do it (probably it could be a useful new 
> feature),
> but you may put db i shutdown before backup and it will be restored in the
> same mode.

No, it will be restored in active mode.


--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Restoring DB into shutdown state

2016-03-23 Thread Jiří Činčura
> but you may put db i shutdown before backup and it will be restored in
> the
> same mode.

I can't even backup database in shutdown mode.

-- 
Mgr. Jiří Činčura
Independent IT Specialist

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Restoring DB into shutdown state

2016-03-23 Thread Vlad Khorsun
23.03.2016 10:22, Alex Peshkoff wrote:
> On 03/23/2016 11:15 AM, Vlad Khorsun wrote:
>> 23.03.2016 9:23, Jiří Činčura wrote:
>>> Hi *,
>>>
>>> Is there a SPB combination to restore database and keep it in shutdown?
>>> Hence manually requiring to online it?
>>  There is no direct way to do it (probably it could be a useful new 
>> feature),
>> but you may put db i shutdown before backup and it will be restored in the
>> same mode.
>
> No, it will be restored in active mode.

   Yep, you right. My memory failed ;)

Regards,
Vlad


--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Restoring DB into shutdown state

2016-03-23 Thread Vlad Khorsun
23.03.2016 10:28, Jiří Činčura wrote:

> I can't even backup database in shutdown mode.

   There is few shutdown mode's. Default one is "multi-user maintenance"
and it not prevents backup. If you need something non-default - specify
it explicitly.

Regards,
Vlad

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Services and encoding

2016-03-23 Thread Mark Rotteveel
On 22-3-2016 15:10, Alex Peshkoff wrote:
> On 03/22/2016 04:54 PM, Jim Starkey wrote:
>> On 3/22/2016 8:33 AM, Dimitry Sibiryakov wrote:
>>>   Hello, All.
>>>
>>>   Because there is nothing like isc_spb_lc_ctype, must be established a 
>>> rule for
>>> determining of encoding of all strings passed into services and back. I 
>>> suggest to use
>>> following:
>>>   If isc_spb_utf8_filename is included in SPB, all strings are supposed 
>>> to be in UTF8.
>>>   Otherwise they are in ANSI code page on Windows and current locale on 
>>> *nix.
>>>
>>>   Do you agree?
>>>
>> I don't agree.  It would be better all around if everything passing over
>> the wire is passed as utf-8.
>
> Certainly - but we must support old clients.

In that case wouldn't it be better to bump the SPB version and declare 
that from that version strings buffers are UTF-8 only?

Mark
-- 
Mark Rotteveel

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] Atomics

2016-03-23 Thread Vlad Khorsun
   All,

in new codebase (v4) we going to use atomic operations more intensively than
before. The question is: could we use standard features of C++11 or should
choose some 3rd party library (such as libatomic_ops) for it ?

   The main concern about C++11 atomics is - if all platforms where Firebird
can be built have support for it (by software and hardware) ? We have no
problem with Intel\AMD and Linux\Windows (GCC and MSVC supports C++11 atomics)
but i have no idea about MAC\HP\AIX\ARM and other...

   Opinions ?

Thanks,
Vlad

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Atomics

2016-03-23 Thread Dimitry Sibiryakov
23.03.2016 10:04, Vlad Khorsun wrote:
> Opinions ?

   I vote for C++11 standard.

-- 
   WBR, SD.

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Atomics

2016-03-23 Thread Atri Sharma
+1 for a cross platform library

On Wed, Mar 23, 2016 at 2:34 PM, Vlad Khorsun 
wrote:

>All,
>
> in new codebase (v4) we going to use atomic operations more intensively
> than
> before. The question is: could we use standard features of C++11 or should
> choose some 3rd party library (such as libatomic_ops) for it ?
>
>The main concern about C++11 atomics is - if all platforms where
> Firebird
> can be built have support for it (by software and hardware) ? We have no
> problem with Intel\AMD and Linux\Windows (GCC and MSVC supports C++11
> atomics)
> but i have no idea about MAC\HP\AIX\ARM and other...
>
>Opinions ?
>
> Thanks,
> Vlad
>
>
> --
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
> Firebird-Devel mailing list, web interface at
> https://lists.sourceforge.net/lists/listinfo/firebird-devel
>



-- 
Regards,

Atri
*l'apprenant*
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Services and encoding

2016-03-23 Thread Dimitry Sibiryakov
23.03.2016 10:04, Mark Rotteveel wrote:
> In that case wouldn't it be better to bump the SPB version and declare
> that from that version strings buffers are UTF-8 only?

   It will add more problems with backward-compatibility with no gain.

-- 
   WBR, SD.

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Services and encoding

2016-03-23 Thread Alex Peshkoff
On 03/23/2016 12:04 PM, Mark Rotteveel wrote:
> On 22-3-2016 15:10, Alex Peshkoff wrote:
>> On 03/22/2016 04:54 PM, Jim Starkey wrote:
>>> On 3/22/2016 8:33 AM, Dimitry Sibiryakov wrote:
Hello, All.

Because there is nothing like isc_spb_lc_ctype, must be established 
 a rule for
 determining of encoding of all strings passed into services and back. I 
 suggest to use
 following:
If isc_spb_utf8_filename is included in SPB, all strings are 
 supposed to be in UTF8.
Otherwise they are in ANSI code page on Windows and current locale 
 on *nix.

Do you agree?

>>> I don't agree.  It would be better all around if everything passing over
>>> the wire is passed as utf-8.
>> Certainly - but we must support old clients.
> In that case wouldn't it be better to bump the SPB version and declare
> that from that version strings buffers are UTF-8 only?

isc_spb_utf8_filename is enough,  see no need to have new version.
Version is bumped when clumplets format is changed incompatibly (like 
use of 32-bit clumplet length in new SPB version). Changing encoding 
rules does not look like such change.


--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Services and encoding

2016-03-23 Thread Dmitry Yemanov
23.03.2016 12:04, Mark Rotteveel wrote:
>
> In that case wouldn't it be better to bump the SPB version and declare
> that from that version strings buffers are UTF-8 only?

Shouldn't this idea be adapted for DPB as well?


Dmitry


--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Atomics

2016-03-23 Thread Alex Peshkoff
On 03/23/2016 12:06 PM, Dimitry Sibiryakov wrote:
> 23.03.2016 10:04, Vlad Khorsun wrote:
>>  Opinions ?
> I vote for C++11 standard.
>

That's not parliament to vote:)
The question was to people who aware - do compilers on MAC\HP\AIX\ARM 
support C++11 atomics? If yes - absolutely no need in additional library.


--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Restoring DB into shutdown state

2016-03-23 Thread Jiří Činčura
>There is few shutdown mode's. Default one is "multi-user maintenance"
> and it not prevents backup. If you need something non-default - specify
> it explicitly.

I used full shutdown mode. So the gbak not working is kind of expected.

-- 
Mgr. Jiří Činčura
Independent IT Specialist

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Services and encoding

2016-03-23 Thread Dmitry Yemanov
23.03.2016 12:10, Alex Peshkoff wrote:
>
> isc_spb_utf8_filename is enough,  see no need to have new version.

Please let's avoid choosing bad names. It has nothing to do with 
filenames. It should be something like isc_spb_utf8_data or 
isc_spb_utf8_strings instead. And yes, we need to add a properly named 
alias for isc_dpb_utf8_filename too.

> Version is bumped when clumplets format is changed incompatibly (like
> use of 32-bit clumplet length in new SPB version). Changing encoding
> rules does not look like such change.

I'd say the version can be bumped for any change that leads to wrong 
processing by the older code. Misinterpreted strings fit this rule.

However, using *_utf8_* tags really looks like a hack in the long term. 
If we agree to move towards UTF8 in the long run, adding a new DPB/SPB 
version may be a good idea. Not necessarily in v4 though.


Dmitry


--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Atomics

2016-03-23 Thread Dimitry Sibiryakov
23.03.2016 10:13, Alex Peshkoff wrote:
> The question was to people who aware - do compilers on MAC\HP\AIX\ARM
> support C++11 atomics? If yes - absolutely no need in additional library.

   If these platforms don't support atomic ops, they have to emulate standard 
somehow. Or 
to be dropped from list of supported.
   AFAIK, GCC provide standard library on all supported platform.

-- 
   WBR, SD.

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Atomics

2016-03-23 Thread Alex Peshkoff
On 03/23/2016 12:04 PM, Vlad Khorsun wrote:
> All,
>
> in new codebase (v4) we going to use atomic operations more intensively than
> before. The question is: could we use standard features of C++11 or should
> choose some 3rd party library (such as libatomic_ops) for it ?
>
> The main concern about C++11 atomics is - if all platforms where Firebird
> can be built have support for it (by software and hardware) ? We have no
> problem with Intel\AMD and Linux\Windows (GCC and MSVC supports C++11 atomics)
> but i have no idea about MAC\HP\AIX\ARM and other...
>
> Opinions ?

Looking at this table:
http://en.cppreference.com/w/cpp/compiler_support
looks like we may safely switch to use of c++11 atomics support.



--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Services and encoding

2016-03-23 Thread Dimitry Sibiryakov
23.03.2016 10:18, Dmitry Yemanov wrote:
> Please let's avoid choosing bad names. It has nothing to do with
> filenames. It should be something like isc_spb_utf8_data or
> isc_spb_utf8_strings instead. And yes, we need to add a properly named
> alias for isc_dpb_utf8_filename too.

   I agree that we should add alias named isc_spb(dpb)_utf8 in V4. I used old 
name just 
because it already exists.

> If we agree to move towards UTF8 in the long run, adding a new DPB/SPB
> version may be a good idea. Not necessarily in v4 though.

   Completely break backward-compatibility is a bad idea. And bumping of the 
version won't 
solve any problem with handling of strings in old applications. We can do that, 
of course, 
when it will be clearly documented that new API version support only UTF-8.

-- 
   WBR, SD.

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Atomics

2016-03-23 Thread Paul Beach
>

Having just checked - Clang (LLVM) 3.5 is installed via XCode on my Mac.
So thats OK.

Paul

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5164) Provide ability for fast receive number of current attachments, WITHOUT querying monitoring or call fb_lock_print and parsing its output

2016-03-23 Thread Pavel Zotov (JIRA)
Provide ability for fast receive number of current attachments, WITHOUT 
querying monitoring or call fb_lock_print and parsing its output


 Key: CORE-5164
 URL: http://tracker.firebirdsql.org/browse/CORE-5164
 Project: Firebird Core
  Issue Type: Improvement
  Components: Engine
Affects Versions: 4.0 Initial
Reporter: Pavel Zotov
Priority: Trivial


It will be extremely useful for lot of testing purpoces (and not only for them) 
to get number of current sessions.
After discuss with dimitr following syntax seems to be appropriate for this:

select RDB$GET_CONTEXT('SYSTEM', 'SESSION_COUNT') from rdb$database;

PS. Please, add this ability not only in 4.0 but also in 2.5 and 3.0.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Services and encoding

2016-03-23 Thread Dmitry Yemanov
23.03.2016 12:25, Dimitry Sibiryakov wrote:

>> If we agree to move towards UTF8 in the long run, adding a new DPB/SPB
>> version may be a good idea. Not necessarily in v4 though.
>
> Completely break backward-compatibility is a bad idea.

I didn't not suggest to remove/deprecate older DPB versions, so legacy 
clients will be supported.


Dmitry



--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Services and encoding

2016-03-23 Thread Dimitry Sibiryakov
23.03.2016 10:53, Dmitry Yemanov wrote:
> I didn't not suggest to remove/deprecate older DPB versions, so legacy
> clients will be supported.

   Ok, but what will be an advantage of the new DPB version except implicit 
isc_dpb_utf8 tag?

-- 
   WBR, SD.

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Services and encoding

2016-03-23 Thread Dmitry Yemanov
23.03.2016 12:56, Dimitry Sibiryakov wrote:
>
> what will be an advantage of the new DPB version except implicit isc_dpb_utf8 
> tag?

1) No need to care about that tag -- simplify life for both end users 
and connectivity layer developers.

2) Explicitly declare our UTF8 only future (in advance).


Dmitry


--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Services and encoding

2016-03-23 Thread Dimitry Sibiryakov
23.03.2016 11:01, Dmitry Yemanov wrote:
> 1) No need to care about that tag -- simplify life for both end users
> and connectivity layer developers.
>
> 2) Explicitly declare our UTF8 only future (in advance).

   I would prefer a brand-new API for that, not just a little hacking of old 
crap.

-- 
   WBR, SD.

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Atomics

2016-03-23 Thread Vlad Khorsun
23.03.2016 11:19, Alex Peshkoff wrote:
> On 03/23/2016 12:04 PM, Vlad Khorsun wrote:
>>  All,
>>
>> in new codebase (v4) we going to use atomic operations more intensively than
>> before. The question is: could we use standard features of C++11 or should
>> choose some 3rd party library (such as libatomic_ops) for it ?
>>
>>  The main concern about C++11 atomics is - if all platforms where 
>> Firebird
>> can be built have support for it (by software and hardware) ? We have no
>> problem with Intel\AMD and Linux\Windows (GCC and MSVC supports C++11 
>> atomics)
>> but i have no idea about MAC\HP\AIX\ARM and other...
>>
>>  Opinions ?
>
> Looking at this table:
> http://en.cppreference.com/w/cpp/compiler_support
> looks like we may safely switch to use of c++11 atomics support.


   It shows no support for c++11 atomics by HP aCC and IBM XLC++ (except of 
Linux).
Is it a problem for us ?

Regards,
Vlad

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Atomics

2016-03-23 Thread Paul Beach
>> in new codebase (v4) we going to use atomic operations more intensively than
>> before. The question is: could we use standard features of C++11 or should
>> choose some 3rd party library (such as libatomic_ops) for it ?
>>
>>  The main concern about C++11 atomics is - if all platforms where 
>> Firebird
>> can be built have support for it (by software and hardware) ? We have no
>> problem with Intel\AMD and Linux\Windows (GCC and MSVC supports C++11 
>> atomics)
>> but i have no idea about MAC\HP\AIX\ARM and other...
>>
>>  Opinions ?
>
> Looking at this table:
> http://en.cppreference.com/w/cpp/compiler_support
> looks like we may safely switch to use of c++11 atomics support.

<>

An interesting question, I do know of a few users who continue to use AIX and 
HPUX and
who actively build on 2.5... Will we still have AIX and HPUX users by the time 
we release
Firebird 4.0 - I don't know.

Paul

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Atomics

2016-03-23 Thread Dimitry Sibiryakov
23.03.2016 12:18, Paul Beach wrote:
> < Linux).
> Is it a problem for us ?>>
>
> An interesting question, I do know of a few users who continue to use AIX and 
> HPUX and
> who actively build on 2.5... Will we still have AIX and HPUX users by the 
> time we release
> Firebird 4.0 - I don't know.

   Google says that AIX and HPUX are supported by GCC. It means that FB4 may be 
cannot 
build with HP aCC and IBM XLC++, but GCC still could be still used for 
compilation on 
these OSes.

-- 
   WBR, SD.

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Atomics

2016-03-23 Thread Paul Beach
> < Linux).
> Is it a problem for us ?>>
>
> An interesting question, I do know of a few users who continue to use AIX and 
> HPUX and
> who actively build on 2.5... Will we still have AIX and HPUX users by the 
> time we release
> Firebird 4.0 - I don't know.

   <>

Just an observation.

Currently GCC on AIX produces awful debug versions of Firebird, that in effect 
are useless
for analysing crash dumps etc, only XLC seems to work properly for this.

Paul

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Extend ALTER EXTERNAL FUNCTION to adjust arguments

2016-03-23 Thread Dmitry Yemanov
20.03.2016 14:27, Atri Sharma wrote:

> Does this sound like an easy place to start?

It should be doable and probably you could take some ideas or even code 
snippets from other places.

First of all, syntax for ALTER EXTERNAL FUNCTION needs to be changed to 
match the one for DECLARE EXTERNAL FUNCTION, but all elements should be 
optional. However, it may look somewhat weird:

ALTER EXTERNAL FUNCTION my_udf RETURNS int; -- more or less OK
ALTER EXTERNAL FUNCTION my_udf (int, int); -- worse, IMHO

Maybe we should require that both inputs and output must be always 
specified together.

Then, CreateAlterFunctionNode class needs new code to alter arguments 
and return value. It already does that for non-external functions, so it 
should not be that hard. But legacy external functions are somewhat 
tricky and their handling is different -- for example, they're not 
allowed to refer domains but required to use only direct datatypes. You 
may get the idea from looking at the "create" part of 
CreateAlterFunctionNode dedicated to external functions.


Dmitry


--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Physical replication using NBACKUP

2016-03-23 Thread Dmitry Kuzmenko
Здравствуйте!

Tuesday, March 22, 2016, 4:40:23 PM, you wrote:
>> 2) We added option into NBACKUP utility to create change set based on 
>> baseline GUID rather than level.

VK>Basic tests show it works :) If anyone have idea how to improve it - you 
are welcome.
VK> For example, we could introduce special switch to query backup GUID of 
target database
VK> to pass in into backup automatically.

as I understand correctly (maybe not), this is equivalent how InterBase's 
"online dump"
feature works.
InterBase cannot produce "level increments", like Firebird, but it can
write changes since -b 0 to the -b 0 file.

If I'm right, I think using GUIDs in the command line is totally
useless.
How InterBase do this
gbak -d db.ib db.dump

if db.dump does not exist, it will be created, and the result will be
equivalent of
nbackup -b 0 db.fdb db.nb0

except InterBase after dump makes db.dump read-only, and another
instance can work with this file without any problem.

Next command
gbak -d db.ib db.dump
will only write changes from db.ib since this command was run last
time. After that db.dump have the same state - read-only.
If IB needs to overwrite dump, like -b 0 again, -ov switch is used
gbak -d -ov ...

Since Firebird always overwrite files during nbackup -b 0
I suggest to add nbackup switch that will APPEND changes to nbackup
file level 0.
Example
nbackup -b 0 db.fdb db.nb0

this will always overwrite db.nb0

nbackup -b 0 -ap db.fdb db.nb0
this will append changes, accumulated in db.fdb from the last -b 0.

But, in this case nbackup must understand that none "increments"
were missing between
nbackup -b 0 db.fdb db.nb0
and
nbackup -b 0 -ap db.fdb db.nb0
nbackup -b 0 -ap db.fdb db.nb0
...

If I'm not understood what Nikolay have done, consider this message as
a feature request.
This feature is very good for scalability - to allow split load of one
database between two servers. read-only "copy" of the database can be used
to run reports, etc.
And it can be updated from the main database each 30-10 minutes, if
there any need of this. Especially with Firebird 3.0 SCN feature, wich
allow nbackup to scan db very fast.

-- 
Dmitry Kuzmenko, www.ibase.ru


--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Atomics

2016-03-23 Thread Alex Peshkoff
On 03/23/2016 01:55 PM, Vlad Khorsun wrote:
> 23.03.2016 11:19, Alex Peshkoff wrote:
>> On 03/23/2016 12:04 PM, Vlad Khorsun wrote:
>>>   All,
>>>
>>> in new codebase (v4) we going to use atomic operations more intensively than
>>> before. The question is: could we use standard features of C++11 or should
>>> choose some 3rd party library (such as libatomic_ops) for it ?
>>>
>>>   The main concern about C++11 atomics is - if all platforms where 
>>> Firebird
>>> can be built have support for it (by software and hardware) ? We have no
>>> problem with Intel\AMD and Linux\Windows (GCC and MSVC supports C++11 
>>> atomics)
>>> but i have no idea about MAC\HP\AIX\ARM and other...
>>>
>>>   Opinions ?
>> Looking at this table:
>> http://en.cppreference.com/w/cpp/compiler_support
>> looks like we may safely switch to use of c++11 atomics support.
>
> It shows no support for c++11 atomics by HP aCC and IBM XLC++ (except of 
> Linux).

Damned  - I did not notice '*' near IBM XLC and read HP aCC as something 
like hppa (which we d not support any more, it's obvious that on hppa 
it's hard to have good atomic support).

> Is it a problem for us ?

Telling true I suppose both will add atomic support to the moment of FB4 
release.
But as long as they did not...
I suppose we keep our AtomicPointer and AtomicCounter, just implement 
them internally using C++11. For existing 2 exceptions we keep #ifdef's 
for a while, when they are fixed we may cleanup them.



--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Extend ALTER EXTERNAL FUNCTION to adjust arguments

2016-03-23 Thread Alex Peshkoff
On 03/23/2016 03:34 PM, Dmitry Yemanov wrote:
> 20.03.2016 14:27, Atri Sharma wrote:
>
>> Does this sound like an easy place to start?
> It should be doable and probably you could take some ideas or even code
> snippets from other places.
>
> First of all, syntax for ALTER EXTERNAL FUNCTION needs to be changed to
> match the one for DECLARE EXTERNAL FUNCTION, but all elements should be
> optional. However, it may look somewhat weird:
>
> ALTER EXTERNAL FUNCTION my_udf RETURNS int; -- more or less OK
> ALTER EXTERNAL FUNCTION my_udf (int, int); -- worse, IMHO
>
> Maybe we should require that both inputs and output must be always
> specified together.

Sooner of all yes. Specially taking into an account return of numbered 
argument.



--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Physical replication using NBACKUP

2016-03-23 Thread Vlad Khorsun
23.03.2016 14:32, Dmitry Kuzmenko wrote:
> Здравствуйте!
>
> Tuesday, March 22, 2016, 4:40:23 PM, you wrote:
>>> 2) We added option into NBACKUP utility to create change set based on 
>>> baseline GUID rather than level.
>
> VK>Basic tests show it works :) If anyone have idea how to improve it - 
> you are welcome.
> VK> For example, we could introduce special switch to query backup GUID of 
> target database
> VK> to pass in into backup automatically.
>
> as I understand correctly (maybe not), this is equivalent how InterBase's 
> "online dump"
> feature works.

   Not really so. Let me explain again (after original letter by Nickolay). The 
patch adds

a) for backup: ability to set "database backup GUID" as previous (starting) 
point for
increment backup.

   Note, "database backup GUID" is changed every time when database backup is 
made. All that
backup GUID's are stored in RDB$BACKUP_HISTORY table, therefore one can set 
desired backup
level as a "starting point" for new backup or use backup GUID for the same 
goal. Current
backup GUID is stored at database header page.

b) for restore: new INPLACE option allows to apply increment backup to the 
existing database.
   Target database automatically set into read-only mode after such restore.

   Let me show how it works. It is very simplified example, of course.

Create database source.fdb.

Create level-0 backup, as usual:
   nbackup -B 0 source.fdb source-0.nbk

Restore level-0 backup, as usual:
  nbackup -R target.fdb source-0.nbk

Every N minutes:
{
   obtain backup GUID of target database:
 gstat -h target.fdb | findstr /C:"Database backup GUID:"

   create new incremental backup using GUID above:
 nbackup -B {93070E3C-E63F-4FB3-B89A-10C732BDEAC3} source.fdb source-inc.nbk

   apply new increment to the target database:
 nbackup -INPLACE -R target.fdb source-inc.nbk
}

   This is all you need to have read-only copy of source database refreshed 
every N minutes.

> InterBase cannot produce "level increments", like Firebird, but it can
> write changes since -b 0 to the -b 0 file.
>
> If I'm right, I think using GUIDs in the command line is totally
> useless.

   Hope you have another opinion now :)

> How InterBase do this
> gbak -d db.ib db.dump
>
> if db.dump does not exist, it will be created, and the result will be
> equivalent of
> nbackup -b 0 db.fdb db.nb0
>
> except InterBase after dump makes db.dump read-only,

   as Firebird does, see above

> and another
> instance can work with this file without any problem.

   This is not fully true, sorry, see below

> Next command
> gbak -d db.ib db.dump
> will only write changes from db.ib since this command was run last
> time. After that db.dump have the same state - read-only.
> If IB needs to overwrite dump, like -b 0 again, -ov switch is used
> gbak -d -ov ...
>
> Since Firebird always overwrite files during nbackup -b 0
> I suggest to add nbackup switch that will APPEND changes to nbackup
> file level 0.
> Example
> nbackup -b 0 db.fdb db.nb0
>
> this will always overwrite db.nb0
>
> nbackup -b 0 -ap db.fdb db.nb0
> this will append changes, accumulated in db.fdb from the last -b 0.
>
> But, in this case nbackup must understand that none "increments"
> were missing between
> nbackup -b 0 db.fdb db.nb0
> and
> nbackup -b 0 -ap db.fdb db.nb0
> nbackup -b 0 -ap db.fdb db.nb0
> ...
>
> If I'm not understood what Nikolay have done, consider this message as
> a feature request.
> This feature is very good for scalability - to allow split load of one
> database between two servers. read-only "copy" of the database can be used
> to run reports, etc.

   Such read-only copy could be used for read-only queries, no doubt. But it is
safe between two restore (apply increment) moments only. Else one have a big
chance to create non-consistent report: if report started before new increment
arrives and continue to work after new increment applied - it could be that
report's transaction snapshot is not exists anymore and even "snapshot"
transaction will not see a consistent view of database. It could be even worce -
if metadata on source database was changed.

   Therefore i don't think Interbase have really working hot-standby solution,
unless i know not all details. So, working with target database is possible,
but all user connections should gone before applying of new increment - else
metadata cache on the target database could be not correct. Even if there is
guarantee of stable metadata, all user queries and transactions should be 
finished
before applying of new increment.

> And it can be updated from the main database each 30-10 minutes, if
> there any need of this. Especially with Firebird 3.0 SCN feature, wich
> allow nbackup to scan db very fast.

   You may try snapshot build of FB 4 with this feature, btw ;)

Regards,
Vlad



--
Transform Data into Opportunity.
Accelerate data analysis in your applications w

Re: [Firebird-devel] Atomics

2016-03-23 Thread Jim Starkey
On 3/23/2016 5:04 AM, Vlad Khorsun wrote:
> All,
>
> in new codebase (v4) we going to use atomic operations more intensively than
> before. The question is: could we use standard features of C++11 or should
> choose some 3rd party library (such as libatomic_ops) for it ?
>
> The main concern about C++11 atomics is - if all platforms where Firebird
> can be built have support for it (by software and hardware) ? We have no
> problem with Intel\AMD and Linux\Windows (GCC and MSVC supports C++11 atomics)
> but i have no idea about MAC\HP\AIX\ARM and other...
>
>

What's the rush?  You may find important compilers that don't support it 
or have garbage implementations.

The reasonable way to handle atomics is for project defined macros on 
whatever facilities the various platforms expose.  When I originally 
wrote SyncObject, I had to use in-line assemble everywhere.  The 
Microsoft implemented satisfactory compiler intrinsics (OK, not strictly 
portable between 32 and 64 bits, but workable).  Later, gcc got around 
to implementing compiler intrinsics and I was able to ditch the last 
remaining inline assembler.  Lately, I was pleased to discovered that 
gcc on ARM supports the same intrinsic COMPARE_AND_SWAP even though the 
underlying hardware didn't.

Defining your own macro layer gives you cheap portability and a zero 
overhead implementation.  With C++11, you may be stuck with a high 
overhead library runtime call written by somebody who didn't really 
understand the hardware instructions, just like the rancid STL garbage 
for its first half dozen years.

Personally, I haven't a clue what the original macros got replaced with 
template that called platform specific implementations.  A macro would 
have compile as one or two machine instructions rather than a number of 
nested called.  Strikes me as a way to introduce unnecessary complexity 
at a significant cost in performance.

Personally, I'm quite happy with macros that hide platform differences.  
If I ever decide that I care about C++11 and its implementation is 
decent on the platform I care about, I'd redefine the macros to the new 
feature.  But I wouldn't see any reason to change the existing code.

Firebird 3 took (will take?) way too long to ship.  One way to help 
streamline releases is to minimize unnecessary dependencies. Building a 
completely unnecessary dependency on C++11 may be one of the solutions 
to non-problems that will turn around and bite you.





--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Physical replication using NBACKUP

2016-03-23 Thread Dmitry Yemanov
23.03.2016 17:43, Vlad Khorsun wrote:
>
> apply new increment to the target database:
>   nbackup -INPLACE -R target.fdb source-inc.nbk

Wouldn't something like "nbackup -merge" be more user-friendly?


Dmitry


--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Physical replication using NBACKUP

2016-03-23 Thread Vlad Khorsun
23.03.2016 17:01, Dmitry Yemanov wrote:
> 23.03.2016 17:43, Vlad Khorsun wrote:
>>
>>  apply new increment to the target database:
>>nbackup -INPLACE -R target.fdb source-inc.nbk
>
> Wouldn't something like "nbackup -merge" be more user-friendly?

   Original patch contains just "-I" switch :) For me both "inplace" and "merge"
are ok, let decide what to use.

Regards,
Vlad


--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Physical replication using NBACKUP

2016-03-23 Thread Dmitry Yemanov
23.03.2016 18:14, Vlad Khorsun wrote:
>
> Original patch contains just "-I" switch :) For me both "inplace" and "merge"
> are ok, let decide what to use.

My point was to replace two switches (-inplace -restore) with one 
(-merge or whatever).


Dmitry


--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] Firebird.pas for the windows build

2016-03-23 Thread preeves

Firebird.pas is generated in the posix builds but it is not generated
in the windows builds. Posix builds generate it via this target:

$(API_PAS_FILE): $(IDL_FILE) $(PASCAL_SOURCES) $(TMP_FUNCS)
$(CLOOP) $(IDL_FILE) pascal $@ Firebird --uses SysUtils \
--interfaceFile $(PAS_ROOT)/Pascal.interface.pas \
--implementationFile $(PAS_ROOT)/Pascal.implementation.pas \
--exceptionClass FbException \
--functionsFile $(TMP_FUNCS) \
--prefix I

There seems to be more going on here than simple file concatenation.

How are we meant to do this in the windows build?



Paul
--
Paul Reeves
http://www.ibphoenix.com
Supporting users of Firebird

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5165) HAVING COUNT(*) NOT IN ( ) prevent record from appearing in outer resultset when it should be there ( = resultset without nulls)

2016-03-23 Thread Pavel Zotov (JIRA)
HAVING COUNT(*) NOT IN (  ) prevent record from appearing in outer resultset 
when it should be there ( = resultset without nulls)
---

 Key: CORE-5165
 URL: http://tracker.firebirdsql.org/browse/CORE-5165
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 4.0 Initial, 3.0 RC2, 2.5.5
Reporter: Pavel Zotov


(created as separate ticket after Adriano suggestion; text below was moved here 
from CORE-5153)

Consider following sample:

set list on;
set count on;
select 1 as check_ok
from rdb$database r
group by r.rdb$relation_id
having count(*) not in (select -1 from rdb$database r2)
;

NOT-IN subquery has not NULLs so HAVING clause should NOT prevent from 
returning one row.

But results differ on 2.5 vs (3.0 RC2 and 4.0 Unstable):

C:\MIX\firebird\QA\fbt-repo\tmp>C:\MIX\firebird\fb25\bin\isql /:e25 -z -i 
c5153x.sql
ISQL Version: WI-V2.5.6.26980 Firebird 2.5
Server version:
WI-V2.5.6.26980 Firebird 2.5
WI-V2.5.6.26980 Firebird 2.5/tcp (csprog)/P12
WI-V2.5.6.26980 Firebird 2.5/tcp (csprog)/P12

CHECK_OK 1

Records affected: 1



C:\MIX\firebird\QA\fbt-repo\tmp>C:\MIX\firebird\fb30\isql /:e30 -z -i c5153x.sql
ISQL Version: WI-V3.0.0.32383 Firebird 3.0 Release Candidate 2
Server version:
WI-V3.0.0.32383 Firebird 3.0 Release Candidate 2
WI-V3.0.0.32383 Firebird 3.0 Release Candidate 2/tcp (csprog)/P13
WI-V3.0.0.32383 Firebird 3.0 Release Candidate 2/tcp (csprog)/P13
Records affected: 0

C:\MIX\firebird\QA\fbt-repo\tmp>C:\MIX\firebird\fb40\isql /:e40 -z -i c5153x.sql
ISQL Version: WI-T4.0.0.32400 Firebird 4.0 Unstable
Server version:
WI-T4.0.0.32400 Firebird 4.0 Unstable
WI-T4.0.0.32400 Firebird 4.0 Unstable/tcp (csprog)/P13
WI-T4.0.0.32400 Firebird 4.0 Unstable/tcp (csprog)/P13
Records affected: 0

PS. Versions: WI-V3.0.0.32383 and WI-T4.0.0.32400 - were downloaded from 
snapshot directory just now:

C:\1TMP>dir /-c Firebird-3.0.0.32383-0_Win32.7z Firebird-4.0.0.32400-0_Win32.7z 
|findstr /i fir
23.03.2016 16:48 6562751 Firebird-3.0.0.32383-0_Win32.7z
23.03.2016 16:46 5401474 Firebird-4.0.0.32400-0_Win32.7z

Unfortunately, we have no more (or not yet ?) subsequent number of builds after 
moving on git, so they are the same as before.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Atomics

2016-03-23 Thread Dimitry Sibiryakov
23.03.2016 14:05, Alex Peshkoff wrote:
> Telling true I suppose both will add atomic support to the moment of FB4
> release.
> But as long as they did not...
> I suppose we keep our AtomicPointer and AtomicCounter, just implement
> them internally using C++11. For existing 2 exceptions we keep #ifdef's
> for a while, when they are fixed we may cleanup them.

   May be contrary would be better: use std::atomic everywhere and for these 
two 
exceptions emulate it with an  header somewhere in 
include/firebird/impl used as a 
last include dir in list?
   It would keep main codebase cleaner and better readable for outsiders.

-- 
   WBR, SD.

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Atomics

2016-03-23 Thread Michal Kubecek
On Wed, Mar 23, 2016 at 10:59:20AM -0400, Jim Starkey wrote:
> 
> Defining your own macro layer gives you cheap portability and a zero 
> overhead implementation.

That's one side of it. The other is that for occasional contributors or
distribution support guys, it brings a lot of confusion. Like when you
find out that ULONG is in fact not unsigned long as one would expect
from the name but rather what standard calls uint32_t). Or when you
learn that instead of a standard library function you are supposed to
use this compatibility wrapper. Regular contributors have learned these
and got used to it; for newcomers, it can be tough at times.

The portability you mention is nice but it's paid for by readability and
maintainability of the code. Most of the stuff is historical and it
would be unwise to rush into weeding it out. But we should think twice
before adding more.

  Michal Kubecek

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Atomics

2016-03-23 Thread Jim Starkey
On 3/23/2016 1:18 PM, Michal Kubecek wrote:
> On Wed, Mar 23, 2016 at 10:59:20AM -0400, Jim Starkey wrote:
>> Defining your own macro layer gives you cheap portability and a zero
>> overhead implementation.
> That's one side of it. The other is that for occasional contributors or
> distribution support guys, it brings a lot of confusion. Like when you
> find out that ULONG is in fact not unsigned long as one would expect
> from the name but rather what standard calls uint32_t). Or when you
> learn that instead of a standard library function you are supposed to
> use this compatibility wrapper. Regular contributors have learned these
> and got used to it; for newcomers, it can be tough at times.

Frankly, the idea of an occasional contributed messing around with 
non-interlocked data structures is remarkably scary.  Anyone who is 
troubled by COMPARE_AND_SWAP or COMPARE_EXCHANGE should be anywhere near 
them.

Now that Microsoft accepts the standard artificial integer types, it's 
probably time to do a couple of global replaces and replace things like 
ULONG with standard artificial types.  I created ULONG a couple of 
decades before stdint.h existed and even longer before Visual Studio 
could handle both stdint.h and Microsoft includes. This is just normal 
project maintenance.

>
> The portability you mention is nice but it's paid for by readability and
> maintainability of the code. Most of the stuff is historical and it
> would be unwise to rush into weeding it out. But we should think twice
> before adding more.
>
> 

With a code base so rife with casts as Firebird, it's hard to make a 
legitimate argument for readability.  If anyone cared about readability, 
the code would reworked to be type safe.

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Atomics

2016-03-23 Thread Vlad Khorsun
23.03.2016 16:59, Jim Starkey wrote:
> On 3/23/2016 5:04 AM, Vlad Khorsun wrote:
>>  All,
>>
>> in new codebase (v4) we going to use atomic operations more intensively than
>> before. The question is: could we use standard features of C++11 or should
>> choose some 3rd party library (such as libatomic_ops) for it ?
>>
>>  The main concern about C++11 atomics is - if all platforms where 
>> Firebird
>> can be built have support for it (by software and hardware) ? We have no
>> problem with Intel\AMD and Linux\Windows (GCC and MSVC supports C++11 
>> atomics)
>> but i have no idea about MAC\HP\AIX\ARM and other...
>>
>>
>
> What's the rush?  You may find important compilers that don't support it
> or have garbage implementations.

   There is not rush. But such changes better to do now, then at release 
candidate
stage.

> The reasonable way to handle atomics is for project defined macros on
> whatever facilities the various platforms expose.  When I originally
> wrote SyncObject, I had to use in-line assemble everywhere.  The
> Microsoft implemented satisfactory compiler intrinsics (OK, not strictly
> portable between 32 and 64 bits, but workable).  Later, gcc got around
> to implementing compiler intrinsics and I was able to ditch the last
> remaining inline assembler.  Lately, I was pleased to discovered that
> gcc on ARM supports the same intrinsic COMPARE_AND_SWAP even though the
> underlying hardware didn't.

   Life is more complex than plain CAS. There is different memory ordering
supported by hardware and one single CAS is not effective (at least).

> Defining your own macro layer gives you cheap portability and a zero
> overhead implementation.  With C++11, you may be stuck with a high
> overhead library runtime call written by somebody who didn't really
> understand the hardware instructions, just like the rancid STL garbage
> for its first half dozen years.
>
> Personally, I haven't a clue what the original macros got replaced with
> template that called platform specific implementations.  A macro would
> have compile as one or two machine instructions rather than a number of
> nested called.  Strikes me as a way to introduce unnecessary complexity
> at a significant cost in performance.
>
> Personally, I'm quite happy with macros that hide platform differences.
> If I ever decide that I care about C++11 and its implementation is
> decent on the platform I care about, I'd redefine the macros to the new
> feature.  But I wouldn't see any reason to change the existing code.
>
> Firebird 3 took (will take?) way too long to ship.  One way to help
> streamline releases is to minimize unnecessary dependencies. Building a
> completely unnecessary dependency on C++11 may be one of the solutions
> to non-problems that will turn around and bite you.

   I prefer to have dependancy on standard feature than on 3rd party library
or self-made macros...

Regards,
Vlad



--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5166) Wrong error message with UNIQUE BOOLEAN field

2016-03-23 Thread Gabor Boros (JIRA)
Wrong error message with UNIQUE BOOLEAN field
-

 Key: CORE-5166
 URL: http://tracker.firebirdsql.org/browse/CORE-5166
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0 RC2
Reporter: Gabor Boros


With BIGINT field the message is correct:

CREATE TABLE TABLE1 (
FIELD1  BIGINT NOT NULL,
CONSTRAINT UNQ1_TABLE1 UNIQUE (FIELD1)
);

COMMIT;

INSERT INTO TABLE1 (FIELD1) VALUES (1);
INSERT INTO TABLE1 (FIELD1) VALUES (1);

COMMIT;

Statement failed, SQLSTATE = 23000
violation of PRIMARY or UNIQUE KEY constraint "UNQ1_TABLE1" on table "TABLE1"
-Problematic key value is ("FIELD1" = 1)


With BOOLEAN field the message is wrong:

CREATE TABLE TABLE1 (
FIELD1  BOOLEAN NOT NULL,
CONSTRAINT UNQ1_TABLE1 UNIQUE (FIELD1)
);

COMMIT;

INSERT INTO TABLE1 (FIELD1) VALUES (TRUE);
INSERT INTO TABLE1 (FIELD1) VALUES (TRUE);

COMMIT;

Statement failed, SQLSTATE = 23000
violation of PRIMARY or UNIQUE KEY constraint "UNQ1_TABLE1" on table "TABLE1"
-conversion error from string "BOOLEAN"

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] BLR contexts limit

2016-03-23 Thread liviuslivius
>>All,

>>

>>Can anyone think of any better idea? I have the former solution
>>implemented, but maybe we could do something more clever?


>>Dmitry

Hi Dmitry,

is this somehow implemented or stuck under not finished discussion?
We are waiting for removing this limit :
Fingers crossed :)

And one more question - will this work also in execute block or this is 
another scenario?
We use extensively ArrayDML and 255 context limit slow down operations if 
table have many columns(parametrized executed block) because we must prepare 
smaller statement. It is rather fast avg. 4 rec/s - but you know it can 
be faster.

regards,
Karol Bieniaszewski




--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] BLR contexts limit

2016-03-23 Thread Dmitry Yemanov
24.03.2016 00:25, liviusliv...@poczta.onet.pl wrote:
>
> is this somehow implemented or stuck under not finished discussion?

Implemented *but* stuck due to lack of comments ;-)

> We are waiting for removing this limit :
> Fingers crossed :)

Are you prepared to lose the ability to migrate back if something goes 
wrong?

> And one more question - will this work also in execute block or this is
> another scenario?
> We use extensively ArrayDML and 255 context limit slow down operations if
> table have many columns(parametrized executed block) because we must prepare
> smaller statement. It is rather fast avg. 4 rec/s - but you know it can
> be faster.

I'm not sure I get you here. How number of columns does relate to number 
of contexts?


Dmitry


--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel