Re: [Firebird-devel] [FB-Tracker] Created: (CORE-5460) Insert NULL into identity column with auth generated value

2017-01-18 Thread Dmitry Yemanov
19.01.2017 00:51, Ann Harrison wrote:
>
> In what universe does that make sense?  The field is NOT NULL.  You're 
> storing NULL in it.  That's an error.

I'd say it depends. What about a BEFORE trigger converting input NULL to 
something valid before storing?


Dmitry


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5462) Erro Criação Chave Primária

2017-01-18 Thread Willer Seno Trambuch (JIRA)
Erro Criação Chave Primária
---

 Key: CORE-5462
 URL: http://tracker.firebirdsql.org/browse/CORE-5462
 Project: Firebird Core
  Issue Type: Bug
Affects Versions: 2.5.5
 Environment: Windows Server 2008 R2 64 bits
Reporter: Willer Seno Trambuch


Após tentar realizar algumas criações de chaves primárias ocorre o seguinte erro

SQL Server Error: unsuccessful metadata update cannot create index 
PK_LF_CREDITOPISCOFINS

unsuccessful metadata update
request depth exceeded. (Recursive definition?)

única solução é realizando BACKUP/RESTORE (gbak) ou rodando GFIX, alguma outra 
solução???
Geralmente ocorre quando tenta realizar criação de chave primária no banco.

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

   

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5461) Recursive Definition

2017-01-18 Thread Willer Seno Trambuch (JIRA)
Recursive Definition


 Key: CORE-5461
 URL: http://tracker.firebirdsql.org/browse/CORE-5461
 Project: Firebird Core
  Issue Type: Bug
Affects Versions: 2.5.5
 Environment: Windows Server 2008 R2 64 Bits
Reporter: Willer Seno Trambuch


Ao realizar vários comandos sequências no banco de dados ocorre o seguinte 
erro, A única solução encontrada é reiniciando o firebird, porém após mandar 
outra atualização ocorre novamente isso.
Há Alguma outra solução?

unsuccessful metadata update request depth exceeded. (recursive definition)

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

   

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] [FB-Tracker] Created: (CORE-5460) Insert NULL into identity column with auth generated value

2017-01-18 Thread Adriano dos Santos Fernandes
Ann, I assigned it to me based on Dimitry S. comment.

After your comment, I edited the case to reflect the standard.


Adriano


Em 18/01/2017 19:51, Ann Harrison escreveu:
> On Jan 18, 2017, at 11:17 AM, Gerhard S (JIRA)  
> wrote:
>>
>> Insert NULL into identity column with auth generated value
>> --
>>
>> Key: CORE-5460
>> URL: http://tracker.firebirdsql.org/browse/CORE-5460
>> Project: Firebird Core
>>  Issue Type: Improvement
>>Affects Versions: 3.0.0
>> Environment: Windows 10 64bit, LibreOffice 5.3.0RC1
>>Reporter: Gerhard S

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] [FB-Tracker] Created: (CORE-5460) Insert NULL into identity column with auth generated value

2017-01-18 Thread Ann Harrison
On Jan 18, 2017, at 11:17 AM, Gerhard S (JIRA)  wrote:
> 
> Insert NULL into identity column with auth generated value
> --
> 
> Key: CORE-5460
> URL: http://tracker.firebirdsql.org/browse/CORE-5460
> Project: Firebird Core
>  Issue Type: Improvement
>Affects Versions: 3.0.0
> Environment: Windows 10 64bit, LibreOffice 5.3.0RC1
>Reporter: Gerhard S
> 
> 
> Could you support inserting rows where the value for the identity column is 
> passed as NULL in order to increment the value automatically?.
> 
> Example:
> create table testtbl (
> id integer generated by default as identity (START WITH 0) NOT NULL primary 
> key,
> name varchar(15)
> );
> 
> insert into testtbl values (NULL, 'name1');
> 
> This only makes sense, if the column is NOT NULL, I guess. Other database 
> systems such as MySQL, HSQLDB, MariaDB allow that.


In what universe does that make sense?  The field is NOT NULL.  You're storing 
NULL in it.  That's an error.  Not an error only if there's no default value, 
not an error only if there's not a sequence.  It's an ERROR.  And quite typical 
of MySQL which tries to make life easier for developers by not giving an error 
if you store 10 in a 16 bit integer field - it stores 32767. -- you know, 
best try.  Like 0-FEB-2017 matches any day in February.  

Maybe if you assign 'ABC' to integer it should store 123?  Or the RAD50 values?


Death to cute hacks!

Good luck,

Ann
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Virtual metadata

2017-01-18 Thread Leyne, Sean


> > Roman,
> >
> >> May I ask an example?
> >>
> >> Will it work?
> >>
> >> start transaction;
> >>
> >> alter table T add column N INTEGER;
> >>
> >> insert into T (..., N) values (..., 10);
> >>
> >> commit;
> > IMO, it should.
> >
> > But, the interesting question would be:
> >
> > What would be the state if instead of "commit", you executed "rollback"?
> >
> 
> I see no problems - no record inserted with N==10, no column N.

That is what I was expecting, but preferred to as a question rather than push 
my opinion.


Sean


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] Looking for new object id

2017-01-18 Thread Dimitry Sibiryakov
   Hello, All.

   When Firebird looks for free id for a new object it does not recognize which 
unique 
constraint is violated. As the result, following script takes quite much time 
before 
showing error:

create database "test";
create or alter sequence aaa start with 1000;
set autoddl off;
create or alter sequence aaa start with 10;

   Is it a but or just a room for improvement?

-- 
   WBR, SD.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5460) Insert NULL into identity column with auth generated value

2017-01-18 Thread Gerhard S (JIRA)
Insert NULL into identity column with auth generated value
--

 Key: CORE-5460
 URL: http://tracker.firebirdsql.org/browse/CORE-5460
 Project: Firebird Core
  Issue Type: Improvement
Affects Versions: 3.0.0
 Environment: Windows 10 64bit, LibreOffice 5.3.0RC1
Reporter: Gerhard S


Could you support inserting rows where the value for the identity column is 
passed as NULL in order to increment the value automatically?.

Example:
create table testtbl (
id integer generated by default as identity (START WITH 0) NOT NULL primary key,
name varchar(15)
);

insert into testtbl values (NULL, 'name1');

This only makes sense, if the column is NOT NULL, I guess. Other database 
systems such as MySQL, HSQLDB, MariaDB allow that.

I am aware that the following already works, but using NULL is more flexible 
and simpler than
insert into testtbl (name) values ('name1');

By the way, I am using Firebird in conjunction with LibreOffice 5.3.0RC1.


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



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Virtual metadata

2017-01-18 Thread Molnár Attila
Don't forget about SAVEPOINT handling! It can make things very messy in 
this case (BUT expected to work as part of the transaction logic from my 
point of view).
Lock should be applied in case of altering, parallel altering should be 
not allowed. (same as update a record, instant lock conflict error at 
command execution time, not commit time (even when different values are 
updated))

On 2017.01.18. 11:09, Dmitry Yemanov wrote:
> 18.01.2017 12:38, Alex Peshkoff wrote:
>> Currently with dfw we do have a lot of DDL errors raised at commit time
>> i.e. it's not a regression.
> True, but only because the actual work is performed during commit. If we
> claim that DDL changes are applied immediately, but error is thrown at
> commit, this looks weird. Especially if we find a way to allow mixed DDL
> and DML - imagine ALTER TABLE and subsequent UPDATE both executing OK
> but failing at commit because of the metadata conflict.
>
>   > But don't forget that under
>   > normal circumstances such conflicts will be very rare.
>
> I would seriously question the need to allow concurrent DDL against the
> same objects. This is simply not the way people work with the relational
> databases. I'd rather lock the metadata being changed at the DDL time
> and until commit.
>
>
> Dmitry
>
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> Firebird-Devel mailing list, web interface at 
> https://lists.sourceforge.net/lists/listinfo/firebird-devel


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] node-firebird-libfbclient SEG FAULT when nodejs exits

2017-01-18 Thread Denys Khanzhyiev
It works in my Ubuntu VM, travis script needs to set default db password.

2017-01-18 10:38 GMT+01:00 marius adrian popa :

> Could you try with the latest version from ppa ?
>
> https://launchpad.net/~mapopa/+archive/ubuntu/ppa
>
> On Tue, Jan 17, 2017 at 7:46 PM, Denys Khanzhyiev 
> wrote:
>
>> Hi all,
>> trying to setup a kind of CI with travis for  node-firebird-libfbclient.
>> Keep getting SEG FAULT when tests are finished and nodejs exists.
>>
>> Isolated it to one test case:
>> the test tests the case when erronous query is called async, i.e.
>> 1. isc_attach_database is called on some thread from thread pool
>> 2. then after connection is established follwoing functions are called
>> isc_dsql_allocate_statement
>> isc_start_transaction
>> isc_dsql_preparefor "select * from non_existent_table"
>>  all in the same function possibly on another thread (but not at the same
>> time with isc_attach_database).
>>
>> isc_dsql_prepare returns error as expected and everyting works until the
>> process is exiting
>> on process exit i get segfault
>> here is what I get from core dump:
>>
>> Using host libthread_db library "/lib/x86_64-linux-gnu/libthre
>> ad_db.so.1".
>>
>> warning: no loadable sections found in added symbol-file system-supplied
>> DSO at   0x7fff3fd91000
>> Core was generated by `node ./node_modules/.bin/nodeunit
>> tests/def/test-async.js
>> -t AsyncQueryWithErro'.
>> Program terminated with signal 11, Segmentation fault.
>> #0  0x7f1515ab2e84 in pthread_mutex_lock ()
>>from /lib/x86_64-linux-gnu/libpthread.so.0
>> (gdb) where
>> #0  0x7f1515ab2e84 in pthread_mutex_lock ()
>>from /lib/x86_64-linux-gnu/libpthread.so.0
>> #1  0x7f15112481b9 in ?? () from /usr/lib/x86_64-linux-gnu/libf
>> bclient.so.2
>> #2  0x7f1515ab0c83 in __nptl_deallocate_tsd ()
>>from /lib/x86_64-linux-gnu/libpthread.so.0
>> #3  0x7f1515ab0ea8 in start_thread ()
>>from /lib/x86_64-linux-gnu/libpthread.so.0
>> #4  0x7f15157de36d in clone () from /lib/x86_64-linux-gnu/libc.so.6
>> #5  0x in ?? ()
>> (gdb)
>>
>> System info:
>>  Ubuntu 12.04.5 LTS amd64
>>  firebird2.5-superclassic
>>
>> Same code works fine on Windows.
>>
>> I also have tried to call fb_shutdown in exit hook provided by nodejs -
>> with no success, i.e.
>> fb_shutdown(0,1) returns 0 and later I still get SEG FAULT
>>
>> Just have found that I also get SEGFAULT after unsuccessfull async
>> connect too.
>> So it looks like any unsuccessfull (with non zero return value) call on
>> other thread leads to SEG FAULT at process exit.
>>
>> Thanks,
>> Denys
>>
>>
>>
>> 
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> Firebird-Devel mailing list, web interface at
>> https://lists.sourceforge.net/lists/listinfo/firebird-devel
>>
>>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> Firebird-Devel mailing list, web interface at
> https://lists.sourceforge.net/lists/listinfo/firebird-devel
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdotFirebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Virtual metadata

2017-01-18 Thread Dimitry Sibiryakov
18.01.2017 11:09, Dmitry Yemanov wrote:
> I would seriously question the need to allow concurrent DDL against the
> same objects. This is simply not the way people work with the relational
> databases. I'd rather lock the metadata being changed at the DDL time
> and until commit.

   +1


-- 
   WBR, SD.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Virtual metadata

2017-01-18 Thread Dmitry Yemanov
18.01.2017 12:38, Alex Peshkoff wrote:
>
> Currently with dfw we do have a lot of DDL errors raised at commit time
> i.e. it's not a regression.

True, but only because the actual work is performed during commit. If we 
claim that DDL changes are applied immediately, but error is thrown at 
commit, this looks weird. Especially if we find a way to allow mixed DDL 
and DML - imagine ALTER TABLE and subsequent UPDATE both executing OK 
but failing at commit because of the metadata conflict.

 > But don't forget that under
 > normal circumstances such conflicts will be very rare.

I would seriously question the need to allow concurrent DDL against the 
same objects. This is simply not the way people work with the relational 
databases. I'd rather lock the metadata being changed at the DDL time 
and until commit.


Dmitry


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Virtual metadata

2017-01-18 Thread Dimitry Sibiryakov
18.01.2017 10:53, Alex Peshkoff wrote:
> Statements prepared in a transaction performing DDL changes should not
> be usable in context of other transactions. Reverse rule should also be
> true - statement prepared outside particular DDL transaction is not
> usable in it. This will be new restriction but IMHO it's reasonable one.
> For DDL transaction we should track a set of prepared statements.

   IMHO, it is too much work for enforcing one restriction. Make such statement 
working 
(may be with unobvious results) can be simpler, IMHO.


-- 
   WBR, SD.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] node-firebird-libfbclient SEG FAULT when nodejs exits

2017-01-18 Thread marius adrian popa
Could you try with the latest version from ppa ?

https://launchpad.net/~mapopa/+archive/ubuntu/ppa

On Tue, Jan 17, 2017 at 7:46 PM, Denys Khanzhyiev  wrote:

> Hi all,
> trying to setup a kind of CI with travis for  node-firebird-libfbclient.
> Keep getting SEG FAULT when tests are finished and nodejs exists.
>
> Isolated it to one test case:
> the test tests the case when erronous query is called async, i.e.
> 1. isc_attach_database is called on some thread from thread pool
> 2. then after connection is established follwoing functions are called
> isc_dsql_allocate_statement
> isc_start_transaction
> isc_dsql_preparefor "select * from non_existent_table"
>  all in the same function possibly on another thread (but not at the same
> time with isc_attach_database).
>
> isc_dsql_prepare returns error as expected and everyting works until the
> process is exiting
> on process exit i get segfault
> here is what I get from core dump:
>
> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
>
> warning: no loadable sections found in added symbol-file system-supplied
> DSO at   0x7fff3fd91000
> Core was generated by `node ./node_modules/.bin/nodeunit
> tests/def/test-async.js
> -t AsyncQueryWithErro'.
> Program terminated with signal 11, Segmentation fault.
> #0  0x7f1515ab2e84 in pthread_mutex_lock ()
>from /lib/x86_64-linux-gnu/libpthread.so.0
> (gdb) where
> #0  0x7f1515ab2e84 in pthread_mutex_lock ()
>from /lib/x86_64-linux-gnu/libpthread.so.0
> #1  0x7f15112481b9 in ?? () from /usr/lib/x86_64-linux-gnu/libf
> bclient.so.2
> #2  0x7f1515ab0c83 in __nptl_deallocate_tsd ()
>from /lib/x86_64-linux-gnu/libpthread.so.0
> #3  0x7f1515ab0ea8 in start_thread ()
>from /lib/x86_64-linux-gnu/libpthread.so.0
> #4  0x7f15157de36d in clone () from /lib/x86_64-linux-gnu/libc.so.6
> #5  0x in ?? ()
> (gdb)
>
> System info:
>  Ubuntu 12.04.5 LTS amd64
>  firebird2.5-superclassic
>
> Same code works fine on Windows.
>
> I also have tried to call fb_shutdown in exit hook provided by nodejs -
> with no success, i.e.
> fb_shutdown(0,1) returns 0 and later I still get SEG FAULT
>
> Just have found that I also get SEGFAULT after unsuccessfull async connect
> too.
> So it looks like any unsuccessfull (with non zero return value) call on
> other thread leads to SEG FAULT at process exit.
>
> Thanks,
> Denys
>
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> Firebird-Devel mailing list, web interface at
> https://lists.sourceforge.net/lists/listinfo/firebird-devel
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdotFirebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Virtual metadata

2017-01-18 Thread Alex Peshkoff
On 01/18/17 01:15, Leyne, Sean wrote:
> Roman,
>
>> May I ask an example?
>>
>> Will it work?
>>
>> start transaction;
>>
>> alter table T add column N INTEGER;
>>
>> insert into T (..., N) values (..., 10);
>>
>> commit;
> IMO, it should.
>
> But, the interesting question would be:
>
> What would be the state if instead of "commit", you executed "rollback"?
>

I see no problems - no record inserted with N==10, no column N.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel