[Firebird-devel] [FB-Tracker] Created: (CORE-6534) Hash join cannot match records using some TIME ZONE / DECFLOAT keys

2021-04-05 Thread Dmitry Yemanov (JIRA)
Hash join cannot match records using some TIME ZONE / DECFLOAT keys
---

 Key: CORE-6534
 URL: http://tracker.firebirdsql.org/browse/CORE-6534
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 4.0 RC 1, 4.0 Beta 2
Reporter: Dmitry Yemanov


Test case:

select 1 from rdb$database where timestamp '01.01.2021 13:00:00 +03:00' = 
timestamp '01.01.2021 12:00:00 +02:00';
-- Values are surely equal:

CONSTANT 
 
   1 

select 1 from (select timestamp '01.01.2021 13:00:00 +03:00' as ts from 
rdb$database) natural join (select timestamp '01.01.2021 12:00:00 +02:00' as ts 
from rdb$database);
-- OOPS! No record is returned!

select 1 from rdb$database where cast(10 as decfloat) = cast(10.000 as 
decfloat);
-- Values are surely equal:

CONSTANT 
 
   1 

select 1 from (select cast(10 as decfloat) as df from rdb$database) natural 
join (select cast(10.000 as decfloat) as df from rdb$database);
-- OOPS! No record is returned!

select 1 from rdb$database where cast('+0' as decfloat) = cast('-0' as 
decfloat);
-- Values are surely equal:

CONSTANT 
 
   1 

select 1 from (select cast('+0' as decfloat) as df from rdb$database) natural 
join (select cast('-0' as decfloat) as df from rdb$database);
-- OOPS! No record is returned!

And also another case with approximate zeros (similar to CORE-3547):

select 1 from rdb$database where cast('+0' as float) = cast('-0' as float);
-- Values are surely equal:

CONSTANT 
 
   1 

select 1 from (select cast('+0' as float) as f from rdb$database) natural join 
(select cast('-0' as float) as f from rdb$database);
-- OOPS! No record is returned!

select 1 from rdb$database where cast('+0' as double precision) = cast('-0' as 
double precision);
-- Values are surely equal:

CONSTANT 
 
   1 

select 1 from (select cast('+0' as double precision) as d from rdb$database) 
natural join (select cast('-0' as double precision) as d from rdb$database);
-- OOPS! No record is returned!


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




Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-6529) Error "no current record for fetch operation" when sorting by a long international string

2021-04-01 Thread Dmitry Yemanov (JIRA)
Error "no current record for fetch operation" when sorting by a long 
international string
-

 Key: CORE-6529
 URL: http://tracker.firebirdsql.org/browse/CORE-6529
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 4.0 RC 1
Reporter: Dmitry Yemanov


Simplified test case:

-- string size should be >= InlineSortThreshold
recreate table t (f varchar(5000) character set win1251);
commit;
insert into t select rpad('asd', 1000, '+') from rdb$database;
-- no commit here!
select f from t order by 1;

-- ERROR
-- Statement failed, SQLSTATE = 22000
-- no current record for fetch operation


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




Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-6335) INSERT ... RETURNING does not require a SELECT privilege

2020-06-17 Thread Dmitry Yemanov (JIRA)
INSERT ... RETURNING does not require a SELECT privilege


 Key: CORE-6335
 URL: http://tracker.firebirdsql.org/browse/CORE-6335
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 4.0 Beta 2, 3.0.5, 2.5.9, 4.0 Beta 1, 3.0.4, 3.0.3, 
2.5.8, 4.0 Alpha 1, 3.0.2, 2.5.7, 3.0.1, 2.5.6, 3.0.0, 4.0 Initial, 2.5.5, 
2.5.4, 2.5.3 Update 1, 2.5.3, 2.5.2 Update 1, 2.5.2, 2.5.1
Reporter: Dmitry Yemanov
Priority: Minor


While UPDATE ... RETURNING and DELETE ... RETURNING require a SELECT privilege, 
INSERT ... RETURNING does not enforce that. It may look logical from the first 
glance, as there is usually no implicit cursor (that always exists for 
UPDATE/DELETE) and there's no OLD context for INSERT, so you can read only 
values from the row being inserted by yourself. However, some fields may be 
assigned implicitly (DEFAULT clause, GENERATED AS IDENTITY clause, BEFORE 
INSERT triggers) and the fact they can be read using the RETURNING clause looks 
like a minor security issue.

RETURNING is a non-standard extension, but the SQl specification includes  which is derived from rows changed by INSERT/UPDATE/DELETE 
statements, And it's explicitly specified that any column referenced in  require a SELECT permission on the target table for 
underlying INSERT/UPDATE/DELETE.

I suspect there may be a backward compatibility issue for those using INSERT 
... RETURNING  without a SELECT privilege granted. Thus 
backporting into v3 is questionable, I need other opinions in this regard.

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




Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Reopened: (CORE-4985) Non-privileged user can implicitly count records in a restricted table

2020-06-06 Thread Dmitry Yemanov (JIRA)


 [ 
http://tracker.firebirdsql.org/browse/CORE-4985?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Yemanov reopened CORE-4985:
--

Fix Version/s: (was: 4.0 Alpha 1)

Re-opened due to regression found, fix is rolled back.

> Non-privileged user can implicitly count records in a restricted table
> --
>
> Key: CORE-4985
> URL: http://tracker.firebirdsql.org/browse/CORE-4985
> Project: Firebird Core
>  Issue Type: Bug
>  Components: Security
>Affects Versions: 2.5.5, 3.0 RC2, 4.0 Initial
>Reporter: Pavel Zotov
>Assignee: Dmitry Yemanov
>
> SQL> create or alter user john password '123';
> SQL> create table test(id int);
> SQL> set count on;
> SQL> insert into test select row_number()over() from rdb$types rows 7;
> Records affected: 7
> SQL> commit;
> SQL> revoke all on all from john;
> Warning: ALL on ALL is not granted to JOHN.
> SQL> commit;
> SQL> connect '/:e30' user john password '123';
> Database: '/:e30', User: JOHN
> SQL> select count(*) from test;
> Statement failed, SQLSTATE = 28000
> no permission for SELECT access to TABLE TEST - OK, expected
> SQL> set count on;
> SQL> select 1 from test;
> CONSTANT
> 
>1
>1
>1
>1
>1
>1
>1
> Records affected: 7 -- ?? Why he can know result of COUNT(*) 
> using this way ?
> WI-V3.0.0.32136
> PS. May be this is not a bug, but IMO user shoudl not have *any* knowledge 
> about such table, even about number of rows in it.

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




Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-6323) File-system ID may be duplicated among databases located on different volumes

2020-06-03 Thread Dmitry Yemanov (JIRA)
File-system ID may be duplicated among databases located on different volumes
-

 Key: CORE-6323
 URL: http://tracker.firebirdsql.org/browse/CORE-6323
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 4.0 Beta 2, 3.0.5, 2.5.9, 4.0 Beta 1, 3.0.4, 3.0.3, 
2.5.8, 4.0 Alpha 1, 3.0.2, 2.5.7, 3.0.1, 2.5.6, 3.0.0, 4.0 Initial, 2.5.5, 
2.5.4, 2.5.3 Update 1, 2.1.7, 2.5.3, 2.5.2 Update 1, 2.5.2, 2.5.1, 2.5.0
 Environment: Windows only
Reporter: Dmitry Yemanov


Firebird uses file-system ID of the open database file to uniquely name its 
dependent shared memory files - lock table, event table, etc. File-system ID is 
retrieved using GetFileInformationByHandle() API and composed from the three 
fields (dwVolumeSerialNumber, nFileIndexHigh, nFileIndexLow) that are 
documented in MSDN as providing a unique combination:

https://docs.microsoft.com/ru-ru/windows/win32/api/fileapi/nf-fileapi-getfileinformationbyhandle

"You can compare the VolumeSerialNumber and FileIndex members returned in the 
BY_HANDLE_FILE_INFORMATION structure to determine if two paths map to the same 
target; for example, you can compare two file paths and determine if they map 
to the same directory." 

The problem, however, is that Volume Serial Number (VSN) is not guaranteed to 
be unique. It's generated when then the volume is formatted and it's stored 
inside the volume's master boot record. But if the volume is cloned at the 
physical block level, or if a virtual (preformatted) drive is used, or if a 
volume snapshot (created by storage system like Dell EMC) is attached as a 
different logical drive, then VSN may duplicate an existing VSN. This may cause 
two different databases (located on different volumes) to share the same 
file-system ID thus sharing the same lock table, causing unexpected freezes and 
other undesired side-effects.


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




Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-6285) SQL-level replication management

2020-04-20 Thread Dmitry Yemanov (JIRA)
SQL-level replication management


 Key: CORE-6285
 URL: http://tracker.firebirdsql.org/browse/CORE-6285
 Project: Firebird Core
  Issue Type: New Feature
  Components: Engine
Affects Versions: 4.0 Beta 1
Reporter: Dmitry Yemanov


Sometimes it makes sense to set up the replication set (i.e. tables to be 
replicated) inside the database rather than via the configuration file. Or 
provide a two-level customization, with tables explicitly included at the 
database level and excluded using the configuration wildcards.

For that purpose, CREATE TABLE and ALTER TABLE commands are extended with the 
optional {ENABLE | DISABLE} PUBLICATION clause. Also ALTER DATABASE command is 
extended with batch operations to manage the replication set:

ALTER DATABASE ADD {ALL | TABLE } TO PUBLICATION
ALTER DATABASE DROP {ALL | TABLE } FROM PUBLICATION

And finally, ALTER DATABASE command now offers an ability to switch the 
replication ON/OFF at runtime:

ALTER DATABASE {ENABLE | DISABLE} PUBLICATION

See also /doc/replication.md and /doc/sql.extensions/README.ddl.txt.

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




Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-6278) Efficient table scans for DBKEY-based range conditions

2020-04-06 Thread Dmitry Yemanov (JIRA)
Efficient table scans for DBKEY-based range conditions
--

 Key: CORE-6278
 URL: http://tracker.firebirdsql.org/browse/CORE-6278
 Project: Firebird Core
  Issue Type: Improvement
  Components: Engine
Reporter: Dmitry Yemanov


Currently queries with conditions like (RDB$DB_KEY = :param) use a very fast 
lookup of single record based on its number decoded from DBKEY. But if some 
range condition is used (e.g. RDB$DB_KEY > :param), then a full table scan is 
performed. However, if the lower/upper limits for the retrieval are provided, 
then a "partial" table scan could be performed instead.

The logical record number space is sequential and the full table scan just 
iterates starting with the zero number until the last record is seen. It can be 
modified to start with the given "lowest" record number and stop as soon as the 
last fetched record number is bigger than the given "upper" record number.

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




Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-6104) Error "invalid request handle" is thrown when an embedded user doesn't have SELECT permissions

2019-07-20 Thread Dmitry Yemanov (JIRA)
Error "invalid request handle" is thrown when an embedded user doesn't have 
SELECT permissions
--

 Key: CORE-6104
 URL: http://tracker.firebirdsql.org/browse/CORE-6104
 Project: Firebird Core
  Issue Type: Bug
  Components: GPRE
Affects Versions: 4.0 Beta 1, 3.0.4, 3.0.3, 2.5.8, 4.0 Alpha 1, 3.0.2, 
2.5.7, 3.0.1, 2.5.6, 3.0.0, 4.0 Initial, 2.5.5, 2.5.4, 2.5.3 Update 1, 2.1.7, 
2.5.3, 2.5.2 Update 1, 2.5.2, 2.5.1, 2.5.0
Reporter: Dmitry Yemanov


isc_compile_request() returns error but local SQLCODE is not set and later 
isc_receive() is executed with zero request handle.

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




Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-6090) BLOB fields may be suddenly set to NULLs during UPDATE after a table format change

2019-06-29 Thread Dmitry Yemanov (JIRA)
BLOB fields may be suddenly set to NULLs during UPDATE after a table format 
change
--

 Key: CORE-6090
 URL: http://tracker.firebirdsql.org/browse/CORE-6090
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 4.0 Beta 1, 3.0.4, 3.0.3
Reporter: Dmitry Yemanov


Test case:

recreate table t (col1 int, col2 int, col3 int, col4 blob);

insert into t values (0, 0, null, '0');
insert into t values (1, 1, 1, '1');
insert into t values (2, 2, 2, '2');
commit;

select * from t;

COL1 COL2 COL3  COL4 
   = 
   00 83:0 
   111  83:1 
   222  83:2 


update t set col1 = 1 where col2 >= 0;
-- COL1 should be set to 1 in all three rows
select * from t;

COL1 COL2 COL3  COL4 
   = 
   10 83:0 
   111  83:1 
   122  83:2 

rollback;

update t set col1 = 1 where col2 >= 0 and col3 >= 0;
-- COL1 should be set to 1 in 2nd and 3rd rows
select * from t;

COL1 COL2 COL3  COL4 
   = 
   00 83:0 
   111  83:1 
   122  83:2 

rollback;

alter table t add col5 date;
commit;

update t set col1 = 1 where col2 >= 0;
-- COL1 should be set to 1 in all three rows
select * from t;

COL1 COL2 COL3  COL4COL5 
   = === 
   10 83:3   
   111  83:4   
   122  83:5   

-- BLOB IDs in COL4 were changed (see CORE-6089) but contents is correct

rollback;

update t set col1 = 1 where col2 >= 0 and col3 >= 0;
-- COL1 should be set to 1 in 2nd and 3rd rows
select * from t;

COL1 COL2 COL3  COL4COL5 
   = === 
   00 83:0   
   111   
   122  83:6   

-- BUG: COL4 in the second row was nullified!!!

rollback;

This issue manifests itself this way: if some WHERE condition (COL3 >= 0 in our 
case) is evaluated to NULL/UNKNOWN for the prior (skipped) row, then all blobs 
are set to NULLs in the next row (unless explicitly set to something else by 
the SET clause). This happens only for BLOB fields and only if OLD and NEW 
records have different formats (i.e. after ALTER TABLE).

The bug became visible after fixing CORE-5600 (thus v3.0.3 and later versions 
are affected), but the issue itself seems to be old. We were just lucky that 
the "buggy" code path was never used 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




Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-6089) BLOBs are unnecessarily copied during UPDATE after a table format change

2019-06-29 Thread Dmitry Yemanov (JIRA)
BLOBs are unnecessarily copied during UPDATE after a table format change


 Key: CORE-6089
 URL: http://tracker.firebirdsql.org/browse/CORE-6089
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 4.0 Beta 1, 3.0.4, 3.0.3
Reporter: Dmitry Yemanov


Test case:

recreate table t (col1 int, col2 blob);

insert into t values (1, '1');
insert into t values (2, '2');
insert into t values (3, '3');
commit;

select * from t;

COL1  COL2 
 = 
   1  84:0 
   2  84:1 
   3  84:2 

update t set col1 = -col1;
select * from t;

COL1  COL2 
 = 
  -1  84:0 
  -2  84:1 
  -3  84:2 

-- So far so good: COL1 is negated, COL2 has the same BLOB IDs

rollback;

alter table t add col3 date;

select * from t;

COL1  COL2COL3 
 = === 
   1  84:0   
   2  84:1   
   3  84:2   

update t set col1 = -col1;
select * from t;

COL1  COL2COL3 
 = === 
  -1  84:3   
  -2  84:4   
  -3  84:5   

-- BUG: COL2 has different BLOB IDs, i.e. the whole blobs were copied rather 
than just their IDs

rollback;

This is a regression introduced while fixing CORE-5600. v3.0.3 and later 
versions are affected.

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




Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5744) Incorrect index usage for some cases of index expressions involving literals

2018-02-10 Thread Dmitry Yemanov (JIRA)
Incorrect index usage for some cases of index expressions involving literals


 Key: CORE-5744
 URL: http://tracker.firebirdsql.org/browse/CORE-5744
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0.3, 2.5.8, 4.0 Alpha 1, 3.0.2, 2.5.7, 3.0.1, 2.5.6, 
3.0.0, 4.0 Initial, 2.5.5, 2.5.4, 2.5.3 Update 1, 2.1.7, 2.5.3, 2.5.2 Update 1, 
2.5.2, 2.5.1, 2.5.0
Reporter: Dmitry Yemanov


recreate table tidx (col varchar(10));
commit;
insert into tidx values ('asd');
commit;
create index itidx1 on tidx computed by (col || '0');
commit;

set plan;

select 1 from tidx where col || '0' = 'asd0';

PLAN (TIDX INDEX (ITIDX1))

CONSTANT 
 
   1 

(*) Matching expressions, correct plan and result

select 1 from tidx where col || 0 = 'asd0';

PLAN (TIDX INDEX (ITIDX1))

CONSTANT 
 
   1

(*) Expressions are in fact different but CAST(0 as VARCHAR(10)) = '0', thus it 
surprisingly works.

select 1 from tidx where col || 0 = 'asd0' plan (tidx natural);

PLAN (TIDX NATURAL)

CONSTANT 
 
   1 

(*) Checked without indices - the same result

create index itidx2 on tidx computed by (col || '00');

select 1 from tidx where col || '00' = 'asd00';

PLAN (TIDX INDEX (ITIDX2))

CONSTANT 
 
   1 

(*) Matching expressions, correct plan and result

select 1 from tidx where col || 0 = 'asd0';

PLAN (TIDX INDEX (ITIDX2))

-- NO RESULT!

(*) Expressions are different, plan using index ITIDX2 causes incorrect result

select 1 from tidx where col || 0 = 'asd0' plan (tidx natural);

PLAN (TIDX NATURAL)

CONSTANT 
 
   1 

(*) Checked without indices - one row is returned

I.e. expressions (COL || '00') and (COL || 0) are considered equal and index is 
matched, but it definitely shouldn't due to different index keys in the second 
index.


-- 
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-5718) Make TempCacheLimit setting database-wise

2018-01-19 Thread Dmitry Yemanov (JIRA)
Make TempCacheLimit setting database-wise
-

 Key: CORE-5718
 URL: http://tracker.firebirdsql.org/browse/CORE-5718
 Project: Firebird Core
  Issue Type: Improvement
  Components: Engine
Reporter: Dmitry Yemanov


First, allow this setting to be customized per-database via databases.conf. 
Second, even if the global default is used, account the temp cache usage 
separately for every attached database instead of per server process as now. 
This matches the page cache setup behaviour.

-- 
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-5676) Consider equivalence classes for index navigation

2017-12-05 Thread Dmitry Yemanov (JIRA)
Consider equivalence classes for index navigation
-

 Key: CORE-5676
 URL: http://tracker.firebirdsql.org/browse/CORE-5676
 Project: Firebird Core
  Issue Type: Improvement
  Components: Engine
Reporter: Dmitry Yemanov
Priority: Minor


Test case:

recreate table document(id int primary key using index pk_document);
recreate table doc_ip_doc(id int primary key using index pk_doc_ip_doc, name 
varchar(100));

insert into document (id) select row_number() over() from rdb$types, rdb$types;
insert into doc_ip_doc (id) select row_number() over() from rdb$types;
commit;

set planonly;

select document.id, doc_ip_doc.name
from doc_ip_doc
join document on document.id=doc_ip_doc.id
order by doc_ip_doc.id;
--PLAN JOIN (DOC_IP_DOC ORDER PK_DOC_IP_DOC, DOCUMENT INDEX (PK_DOCUMENT))

select document.id, doc_ip_doc.name
from doc_ip_doc
join document on document.id=doc_ip_doc.id
order by document.id;
--PLAN SORT (JOIN (DOC_IP_DOC NATURAL, DOCUMENT INDEX (PK_DOCUMENT)))

select doc_ip_doc.id, doc_ip_doc.name
from doc_ip_doc
join document on document.id=doc_ip_doc.id
order by id;
--PLAN JOIN (DOC_IP_DOC ORDER PK_DOC_IP_DOC, DOCUMENT INDEX (PK_DOCUMENT))

select document.id, doc_ip_doc.name
from doc_ip_doc
join document on document.id=doc_ip_doc.id
order by id;
--PLAN SORT (JOIN (DOC_IP_DOC NATURAL, DOCUMENT INDEX (PK_DOCUMENT)))

All queries are semantically the same and should have the same plan (ORDER 
rather than SORT), but the optimizer understands only explicit reference inside 
ORDER BY clause and ignores sorts derived from equivalent expressions.


-- 
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-5611) Higher memory consumption for prepared statements in FB3

2017-09-11 Thread Dmitry Yemanov (JIRA)
Higher memory consumption for prepared statements in FB3


 Key: CORE-5611
 URL: http://tracker.firebirdsql.org/browse/CORE-5611
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 4.0 Alpha 1, 3.0.2, 3.0.1, 3.0.0, 4.0 Initial
Reporter: Dmitry Yemanov


Customer has reported about noticably higher memory consumption with FB 3.0 
than they see with FB 2.5. This is somewhat expected, given the metadata cache 
is per-attachment in FB3 and their production database is complex. But then 
Paul Reeves and I were able to reproduce this with TPCC which database has just 
a few tables and procedures, so the metadata cache should not be a big issue.

This is what I've got looking at mon$memory_usage (values are avg/max):

v2.5 SS
---
database: 22MB
attachment: 150KB
transaction: 1.7KB / 18KB
statement: 25KB / 90KB

v3.0 SS
---
database: 160MB
attachment: 2.4MB
transaction: 1.1KB / 13KB
statement: 88KB / 154KB

Database counter is aggregated among all attachments, it doesnt show where the 
problem is, but it does show that the problem exists. Attachment counter 
clearly shows noticably higher memory usage, but we still cannot say for sure 
whether it's effect of the metadata caching or not. Transaction counter show 
only a little increase, it shouldn't be a problem. Finally, statement counter 
does indicate a problem. We see a 2x-3x more memory used for DSQL statements in 
v3.0 as compared to v2.5.

Quick debugging shows that even trivial statements like "execute procedure X 
(A, B, C)" consume 3x more memory: 10KB vs 32KB (with the same impure size). 
Here are examples from the memory pool dumps for the same statements:

v2.5
0x72b5e530 USED: size=80 allocated at ../src/jrd/par.cpp:686
0x72b5e5a0 USED: size=96 allocated at ../src/jrd/par.cpp:686
0x72b5e620 USED: size=80 allocated at ../src/jrd/par.cpp:686
0x72b5e690 USED: size=72 allocated at ../src/jrd/par.cpp:686
0x72b5e6f8 USED: size=80 allocated at ../src/jrd/par.cpp:686
0x72b5e768 USED: size=80 allocated at ../src/jrd/par.cpp:686
0x72b5e7d8 USED: size=80 allocated at ../src/jrd/par.cpp:686
0x72b5e848 USED: size=80 allocated at ../src/jrd/par.cpp:686
0x72b5e8b8 USED: size=72 allocated at ../src/jrd/par.cpp:686
0x72b5e920 USED: size=80 allocated at ../src/jrd/par.cpp:686

v3.0
USED 0x7fffe3405d20: size=56 allocated at 
/work/v3-release/src/jrd/../jrd/../jrd/../jrd/../dsql/Nodes.h:681
USED 0x7fffe3405d58: size=56 allocated at 
/work/v3-release/src/jrd/../jrd/../jrd/../jrd/../dsql/Nodes.h:681
USED 0x7fffe3405d90: size=56 allocated at 
/work/v3-release/src/jrd/../jrd/../common/classes/array.h:464
USED 0x7fffe3405dc8: size=232 allocated at /work/v3-release/src/jrd/par.cpp:1234
USED 0x7fffe3405eb0: size=56 allocated at 
/work/v3-release/src/jrd/../jrd/../jrd/../jrd/../dsql/Nodes.h:681
USED 0x7fffe3405ee8: size=56 allocated at 
/work/v3-release/src/jrd/../jrd/../jrd/../jrd/../dsql/Nodes.h:681
USED 0x7fffe3405f20: size=56 allocated at 
/work/v3-release/src/jrd/../jrd/../common/classes/array.h:464
USED 0x7fffe3405f58: size=232 allocated at 
/work/v3-release/src/dsql/ExprNodes.cpp:7783
USED 0x7fffe3406040: size=56 allocated at 
/work/v3-release/src/jrd/../jrd/../jrd/../jrd/../dsql/Nodes.h:681
USED 0x7fffe3406078: size=56 allocated at 
/work/v3-release/src/jrd/../jrd/../jrd/../jrd/../dsql/Nodes.h:681
USED 0x7fffe34060b0: size=56 allocated at 
/work/v3-release/src/jrd/../jrd/../common/classes/array.h:464
USED 0x7fffe34060e8: size=232 allocated at 
/work/v3-release/src/dsql/ExprNodes.cpp:7795
USED 0x7fffe34061d0: size=56 allocated at 
/work/v3-release/src/jrd/../jrd/../jrd/../jrd/../dsql/Nodes.h:681
USED 0x7fffe3406208: size=56 allocated at 
/work/v3-release/src/jrd/../jrd/../jrd/../jrd/../dsql/Nodes.h:681
USED 0x7fffe3406240: size=56 allocated at 
/work/v3-release/src/jrd/../jrd/../common/classes/array.h:464
USED 0x7fffe3406278: size=232 allocated at /work/v3-release/src/jrd/par.cpp:1230
USED 0x7fffe3406360: size=56 allocated at 
/work/v3-release/src/jrd/../jrd/../jrd/../jrd/../dsql/Nodes.h:681
USED 0x7fffe3406398: size=56 allocated at 
/work/v3-release/src/jrd/../jrd/../jrd/../jrd/../dsql/Nodes.h:681
USED 0x7fffe34063d0: size=56 allocated at 
/work/v3-release/src/jrd/../jrd/../common/classes/array.h:464
USED 0x7fffe3406408: size=232 allocated at /work/v3-release/src/jrd/par.cpp:1234

Besides the fact that the execution tree node itself is bigger in v3.0 (e.g. 
232 vs 80 bytes), we also see 3 extra allocations by 56 bytes that didn't exist 
in v2.5. This makes a huge total difference. Given that the execution trees 
exist not only for DSQL statements but also for every cached PSQL object, this 
issue affects also the metadata cache thus making per-attachment memory usage 
even bigger.

I can see several reasons:
1) Every node now contains vtable with a dozen of 

[Firebird-devel] [FB-Tracker] Created: (CORE-5567) Direct system table modifications are not completely prohibited

2017-06-12 Thread Dmitry Yemanov (JIRA)
Direct system table modifications are not completely prohibited
---

 Key: CORE-5567
 URL: http://tracker.firebirdsql.org/browse/CORE-5567
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0.2, 3.0.1, 3.0.0, 4.0 Initial
Reporter: Dmitry Yemanov


SQL> create database '/work/data/systab.fdb';
SQL> create domain my_type numeric(18, 2);
SQL> commit;

SQL> show domain MY_TYPE;
MY_TYPE NUMERIC(18, 2) Nullable

SQL> update rdb$fields set rdb$field_scale = -3 where rdb$field_name = 
'MY_TYPE';
Statement failed, SQLSTATE = 42000
UPDATE operation is not allowed for system table RDB$FIELDS
-- THIS IS EXPECTED
SQL> rollback;

SQL> show domain MY_TYPE;
MY_TYPE NUMERIC(18, 2) Nullable

SQL> set term ^;
SQL> execute block as
CON> begin
CON> update rdb$fields set rdb$field_scale = -3 where rdb$field_name = 
'MY_TYPE';
CON> end^
Statement failed, SQLSTATE = 42000
UPDATE operation is not allowed for system table RDB$FIELDS
-At block line: 3, col: 1
-- ALSO EXPECTED
SQL> set term ;^
SQL> rollback;

SQL> show domain MY_TYPE;
MY_TYPE NUMERIC(18, 2) Nullable

SQL> set term ^;
SQL> execute block as
CON> declare procedure hack as
CON> begin
CON> update rdb$fields set rdb$field_scale = -3 where rdb$field_name = 
'MY_TYPE';
CON> end
CON> begin
CON> execute procedure hack;
CON> end^
SQL> set term ;^
SQL> commit;

SQL> show domain MY_TYPE;
MY_TYPE NUMERIC(18, 3) Nullable

-- WTF???


-- 
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-5566) Server crashes while restoring backup if the shadow file already exists

2017-06-12 Thread Dmitry Yemanov (JIRA)
Server crashes while restoring backup if the shadow file already exists
---

 Key: CORE-5566
 URL: http://tracker.firebirdsql.org/browse/CORE-5566
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Reporter: Dmitry Yemanov


gbak -c -rep C:\TEMP\TEST.FBK C:\TEMP\TEST.FDB

Database is configured to have a shadow at C:\TEMP\CITYCARD.SHD. If there's no 
such a file, restore succeeds. If the file exists, expected error is reported:

gbak: ERROR:I/O error during "CreateFile (create)" operation for file 
"C:\TEMP\CITYCARD.SHD"
gbak: ERROR:Error while trying to create file
gbak: ERROR:Файл существует.
gbak:Exiting before completion due to errors
 
but then the engine crashes with the following stack:

  msvcr100d.dll!memcmp()  Line 127 Asm
  engine12.dll!Firebird::MetaName::compare(const Firebird::MetaName & m={...})  
Line 90 + 0x38 bytes C++
  engine12.dll!Firebird::MetaName::operator==(const Firebird::MetaName & 
m={...})  Line 96 + 0x32 bytes C++
  engine12.dll!PAR_find_proc_field(const Jrd::jrd_prc * 
procedure=0x033f2260, const Firebird::MetaName & name={...})  Line 771 
+ 0x16 bytes C++
  engine12.dll!Jrd::FieldNode::parse(Jrd::thread_db * tdbb=0x0012a4f0, 
Firebird::MemoryPool & pool={...}, Jrd::CompilerScratch * 
csb=0x0341ad50, const unsigned char blrOp='')  Line 4855 + 0x15 bytes 
C++
  engine12.dll!PAR_parse_node(Jrd::thread_db * tdbb=0x0012a4f0, 
Jrd::CompilerScratch * csb=0x0341ad50)  Line 1611 + 0x4b bytes C++
  engine12.dll!PAR_parse_value(Jrd::thread_db * tdbb=0x0012a4f0, 
Jrd::CompilerScratch * csb=0x0341ad50)  Line 1544 + 0xf bytes C++
  engine12.dll!parseMap(Jrd::thread_db * tdbb=0x0012a4f0, 
Jrd::CompilerScratch * csb=0x0341ad50, unsigned long stream=0x0001) 
 Line 3326 + 0x15 bytes C++
  engine12.dll!Jrd::UnionSourceNode::parse(Jrd::thread_db * 
tdbb=0x0012a4f0, Jrd::CompilerScratch * csb=0x0341ad50, const 
short blrOp=0x004c)  Line 1641 + 0x1a bytes C++
  engine12.dll!PAR_parseRecordSource(Jrd::thread_db * tdbb=0x0012a4f0, 
Jrd::CompilerScratch * csb=0x0341ad50)  Line 1281 + 0x15 bytes C++
  engine12.dll!PAR_rse(Jrd::thread_db * tdbb=0x0012a4f0, 
Jrd::CompilerScratch * csb=0x0341ad50, short rse_op=0x0043)  Line 1306 
+ 0x15 bytes C++
  engine12.dll!PAR_rse(Jrd::thread_db * tdbb=0x0012a4f0, 
Jrd::CompilerScratch * csb=0x0341ad50)  Line 1426 + 0x15 bytes C++
  engine12.dll!PAR_parse_node(Jrd::thread_db * tdbb=0x0012a4f0, 
Jrd::CompilerScratch * csb=0x0341ad50)  Line 1587 + 0x15 bytes C++
  engine12.dll!PAR_blr(Jrd::thread_db * tdbb=0x0012a4f0, Jrd::jrd_rel * 
relation=0x0341a750, const unsigned char * blr=0x00129298, 
unsigned long blr_length=0x01d8, Jrd::CompilerScratch * 
view_csb=0x, Jrd::CompilerScratch * * 
csb_ptr=0x001295f8, Jrd::JrdStatement * * 
statementPtr=0x, const bool trigger=false, unsigned short 
flags=0x)  Line 235 + 0x1a bytes C++
  engine12.dll!MET_parse_blob(Jrd::thread_db * tdbb=0x0012a4f0, 
Jrd::jrd_rel * relation=0x0341a750, Jrd::bid * 
blob_id=0x00129898, Jrd::CompilerScratch * * 
csb_ptr=0x001295f8, Jrd::JrdStatement * * 
statementPtr=0x, const bool trigger=false, bool 
validationExpr=false)  Line 7750 + 0x58 bytes C++
  engine12.dll!MET_get_dependencies(Jrd::thread_db * tdbb=0x0012a4f0, 
Jrd::jrd_rel * relation=0x0341a750, const unsigned char * 
blob=0x, const unsigned long blob_length=0x, 
Jrd::CompilerScratch * view_csb=0x, Jrd::bid * 
blob_id=0x00129898, Jrd::JrdStatement * * 
statementPtr=0x, Jrd::CompilerScratch * * 
csb_ptr=0x00129a18, const Firebird::MetaName & object_name={...}, int 
type=0x0001, unsigned short flags=0x, Jrd::jrd_tra * 
transaction=0x0308c710, const Firebird::MetaName & 
domain_validation={...})  Line 5826 + 0x8d bytes C++
  engine12.dll!MET_scan_relation(Jrd::thread_db * tdbb=0x0012a4f0, 
Jrd::jrd_rel * relation=0x0341a750)  Line 8796 + 0x92 bytes C++
  engine12.dll!scan_relation(Jrd::thread_db * tdbb=0x0012a4f0, short 
phase=0x0003, Jrd::DeferredWork * work=0x03414b98, Jrd::jrd_tra * 
__formal=0x0308c710)  Line 10983 C++
  engine12.dll!DFW_perform_work(Jrd::thread_db * tdbb=0x0012a4f0, 
Jrd::jrd_tra * transaction=0x0308c710)  Line 4746 + 0x28 bytes C++
  engine12.dll!TRA_commit(Jrd::thread_db * tdbb=0x0012a4f0, 
Jrd::jrd_tra * transaction=0x0308c710, const bool retaining_flag=false) 
 Line 380 C++
  engine12.dll!commit(Jrd::thread_db * tdbb=0x0012a4f0, Jrd::jrd_tra * 
transaction=0x0308c710, const bool retaining_flag=false) 

[Firebird-devel] [FB-Tracker] Created: (CORE-5481) Available indices are not used in some cases if ORDER BY expression is a filtered one

2017-02-12 Thread Dmitry Yemanov (JIRA)
Available indices are not used in some cases if ORDER BY expression is a 
filtered one
-

 Key: CORE-5481
 URL: http://tracker.firebirdsql.org/browse/CORE-5481
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0.1, 3.0.0, 4.0 Initial
Reporter: Dmitry Yemanov


CREATE TABLE ORG_ACCOUNTS
(
ORGACCOUNTID BIGINT NOT NULL PRIMARY KEY
);

CREATE TABLE BALANCES
(
BALANCEID BIGINT NOT NULL,
ORGACCOUNTID BIGINT NOT NULL,
BALANCEDATE DATE  NOT NULL
);

ALTER TABLE BALANCES ADD CONSTRAINT PK_BALANCES PRIMARY KEY (BALANCEID);
ALTER TABLE BALANCES ADD CONSTRAINT FK_BALANCES_ORGACCOUNTS FOREIGN KEY 
(ORGACCOUNTID) REFERENCES ORG_ACCOUNTS (ORGACCOUNTID);
ALTER TABLE BALANCES ADD CONSTRAINT BALANCES_BALANCEDATE_ORGACCOUNT UNIQUE 
(ORGACCOUNTID, BALANCEDATE);

CREATE DESCENDING INDEX BALANCES_BALANCEDATE_DESC ON BALANCES (BALANCEDATE);

select first 1 *
from Balances B
where OrgAccountID=18 and
   BalanceDate<='01.01.2017'
order by BalanceDate desc;
 
v2.5:
PLAN (B ORDER BALANCES_BALANCEDATE_DESC INDEX (BALANCES_BALANCEDATE_ORGACCOUNT))

v3.0:
PLAN (B ORDER BALANCES_BALANCEDATE_DESC)

Correct (best) plan should be:
PLAN (B ORDER BALANCES_BALANCEDATE_DESC INDEX (FK_BALANCES_ORGACCOUNTS))

Now the funny thing:
ALTER TABLE BALANCES DROP CONSTRAINT BALANCES_BALANCEDATE_ORGACCOUNT;

v3.0:
PLAN (B ORDER BALANCES_BALANCEDATE_DESC INDEX (FK_BALANCES_ORGACCOUNTS))

I.e. existing compound index BALANCES_BALANCEDATE_ORGACCOUNT is not only 
ignored itself (see also CORE-5070), but it also hides possibilities to use 
another index FK_BALANCES_ORGACCOUNTS.


-- 
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-5435) Badly selective index could be used for extra filtering even if selective index is used for sorting

2017-01-04 Thread Dmitry Yemanov (JIRA)
Badly selective index could be used for extra filtering even if selective index 
is used for sorting
---

 Key: CORE-5435
 URL: http://tracker.firebirdsql.org/browse/CORE-5435
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0.1, 3.0.0, 4.0 Initial
Reporter: Dmitry Yemanov


It seems that Firebird 3 is sometimes choosing the index with less selectivity, 
which can have a serious 
effect on performance. We have seen this behaviour in several queries. 

In this example (we have attached in databases.zip the databases for Firebird 
2.5 and Firebird 3): 
  -Table1 has around 30 records. 
  -Field1 has 15000 different values with 20 records each one. 
  -Field2 has 2 different values (0 with 20 records, and 1 with 10 
records). 
  -Both databases were tested immediately after a backup/restore cycle and in 
the same computer. 
  -The times are measured in the second execution of each query (though the 
first execution follow the same pattern). 

Query: 
  select * 
  from TABLE1 where FIELD1 is null and FIELD2=0 
  order by FIELD1, ID 

Firebird 2.1/2.5: 
  PLAN (TABLE1 ORDER TABLE1_F1_ID INDEX (TABLE1_F1_ID)) 
  0.002 seconds 

Firebird3: 
  PLAN (TABLE1 ORDER TABLE1_F1_ID INDEX (TABLE1_F2)) 
  Select Expression 
  -> Filter 
  -> Table "TABLE1" Access By ID 
  -> Index "TABLE1_F1_ID" Range Scan (partial match: 1/2) 
  -> Bitmap 
  -> Index "TABLE1_F2" Range Scan (full match) 
  0.240 seconds 

- 

CREATE TABLE "TABLE1" 
( 
  "ID"  INTEGER NOT NULL, 
  "FIELD1"  INTEGER, 
  "FIELD2"  INTEGER, 
CONSTRAINT "TABLE1_PK" PRIMARY KEY ("ID") 
); 

CREATE INDEX "TABLE1_F1_ID" ON "TABLE1"("FIELD1", "ID"); 
CREATE INDEX "TABLE1_F2" ON "TABLE1"("FIELD2"); 


-- 
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-5418) Inconsistent output when retrieving the server log via Services API

2016-12-12 Thread Dmitry Yemanov (JIRA)
Inconsistent output when retrieving the server log via Services API
---

 Key: CORE-5418
 URL: http://tracker.firebirdsql.org/browse/CORE-5418
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine, SVCMGR
Affects Versions: 2.5.6, 2.5.5, 2.5.4, 2.5.3 Update 1, 2.1.7, 2.5.3, 2.5.2 
Update 1, 2.5.2, 2.5.1, 2.5.0
 Environment: Consistently reproduced on Windows only
Reporter: Dmitry Yemanov
Priority: Minor


When Services API is used to fetch the firebird.log contents 
(isc_svc_action_get_fb_log command), sometimes unexpected output may appear:

1) If firebird.log exists and it's empty, garbage may be returned
2) If firebird.log is not empty, its last line may be returned twice


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



--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5393) Bad optimization of some operations with views containing subqueries

2016-11-08 Thread Dmitry Yemanov (JIRA)
Bad optimization of some operations with views containing subqueries


 Key: CORE-5393
 URL: http://tracker.firebirdsql.org/browse/CORE-5393
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0.1, 3.0.0, 4.0 Initial
Reporter: Dmitry Yemanov


Bug is caused by internally created derived expressions being based on all view 
streams, including streams burried inside subqueries, etc. This is causing 
various optimization issues due to nested subqueries being non-computable at 
the moment.

Test case may look a bit complicated as it exploits the fact that simple field 
references become wrapped by derived expressions if located inside an explicit 
cursor. But I suspect this issue may be visible in other cases too.

create table test (id int primary key, col int);
commit;

insert into test (id, col) values (1, 1);
insert into test (id, col) values (2, 2);
commit;

-- view must contain a subquery
create or alter view v_test (id1, id2, col1, col2, dummy)
as
select t1.id, t2.id, t1.col, t2.col, (select 1 from rdb$database)
from test t1 join test t2 on t1.col = t2.id;

-- trigger makes the view updatable
create trigger t_v_test
for v_test before update
as
begin
end;

set plan;

set term ^;

execute block
as
begin
  for select id1 from v_test as cursor c do
  begin
update v_test set col1 = 1
where id1 = c.id1;
--where current of c;

update v_test set col1 = 1
where id1 = c.id1;
  end
end^

set term ;^

PLAN (V_TEST RDB$DATABASE NATURAL)
PLAN JOIN (V_TEST T1 INDEX (RDB$PRIMARY1), V_TEST T2 INDEX (RDB$PRIMARY1))
PLAN (V_TEST RDB$DATABASE NATURAL)
PLAN JOIN (V_TEST T1 INDEX (RDB$PRIMARY1), V_TEST T2 INDEX (RDB$PRIMARY1))
PLAN JOIN (C V_TEST T1 NATURAL, C V_TEST T2 INDEX (RDB$PRIMARY1))

The only naturally-read join is cursor C, this is expected. Both updates 
utilize the primary key index for table T1. So far so good.

set term ^;

execute block
as
begin
  for select id1 from v_test as cursor c do
  begin
update v_test set col1 = 1
--where id1 = c.id1;
where current of c;

update v_test set col1 = 1
where id1 = c.id1;
  end
end^

set term ;^

PLAN (C V_TEST RDB$DATABASE NATURAL)
PLAN (V_TEST RDB$DATABASE NATURAL)
PLAN JOIN (V_TEST T1 NATURAL, V_TEST T2 INDEX (RDB$PRIMARY1))
PLAN JOIN (C V_TEST T1 NATURAL, C V_TEST T2 INDEX (RDB$PRIMARY1))

The first update is not reported in the plan because it's based on the same 
cursor as the select itself. However, the second update is unable to utilize 
the primary key index for table T1 anymore.

In the production database, this issue is causing 100x degradation in execution 
time.

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



--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Reopened: (CORE-5382) Incorrect processing (truncation) of SQL statement with length 10MB+1

2016-11-03 Thread Dmitry Yemanov (JIRA)

 [ 
http://tracker.firebirdsql.org/browse/CORE-5382?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Yemanov reopened CORE-5382:
--


Sorry, Pavel was too fast to resolve this ticket. The current behaviour is 
intended, but honestly, I don't remember why I decided to truncate instead of 
raising the error.

> Incorrect processing (truncation) of SQL statement with length 10MB+1
> -
>
> Key: CORE-5382
> URL: http://tracker.firebirdsql.org/browse/CORE-5382
> Project: Firebird Core
>  Issue Type: Bug
>  Components: Engine
>Affects Versions: 3.0.2
> Environment: Firebird 3.0.2.32619, IBProvider, direct INET-connection 
> to FB3 (without fbclient.dll).
>Reporter: Kovalenko Dmitry
>
> SQL Statement (total length = 10*1024*1024+1):
>  "select/*--  ---*/ID from DUAL "
> ---
> Prepare error:
> Dynamic SQL Error
> SQL error code = -204
> Table unknown
> DUA
> ---
> 1. I think, the error message must be a little another.
> 2. Special for this case, I created the new table "DUA" and server prepared 
> original query without any problem.

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



--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5329) Database gets partially corrupted in the "no-reserve" mode

2016-08-13 Thread Dmitry Yemanov (JIRA)
Database gets partially corrupted in the "no-reserve" mode
--

 Key: CORE-5329
 URL: http://tracker.firebirdsql.org/browse/CORE-5329
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0.0
Reporter: Dmitry Yemanov


If a "no-reserve" (aka "use full space") option was enabled for a v2.5 
database, then the issue becomes visible right after restore on v3.0, just do 
an immediate validation and see:

Summary of validation errors
Number of database page errors  : 90167

Then check firebird.log and see:

solaris Sat Aug 13 18:01:28 2016
Database: /work/data/abc.fdb
Error: Page 1017 wrong type (expected SCN inventory encountered 
purposely undefined)

solaris Sat Aug 13 18:01:28 2016
Database: /work/data/abc.fdb
Error: SCN's page 1017 {sequence 1} inconsistent

solaris Sat Aug 13 18:01:28 2016
Database: /work/data/abc.fdb
Error: Page 2034 wrong type (expected SCN inventory encountered 
purposely undefined)

solaris Sat Aug 13 18:01:28 2016
Database: /work/data/abc.fdb
Error: SCN's page 2034 {sequence 2} inconsistent

and so on. Only SCN pages are corrupted, they are all unexpectedly zeroed.

It means that only incremental restore is affected by this issue, basically the 
database operates OK. A short-term workaround is: gfix -use reserve + 
backup/restore.

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



--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. http://sdm.link/zohodev2dev
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5307) Random "invalid transaction handle" errors are returned from the engine

2016-07-13 Thread Dmitry Yemanov (JIRA)
Random "invalid transaction handle" errors are returned from the engine
---

 Key: CORE-5307
 URL: http://tracker.firebirdsql.org/browse/CORE-5307
 Project: Firebird Core
  Issue Type: Bug
  Components: API / Client Library, Engine
Affects Versions: 3.0.0, 4.0 Initial
Reporter: Dmitry Yemanov


Sometimes (almost randomly) DML statement running in a valid transaction 
context may fail with "invalid transaction handle" error. All subsequent usage 
of the same transaction handle (including attempt to rollback) raise the same 
error. The issue manifests itself only when user-defined temporary blobs are 
involved in DML operations.

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



--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5305) CASCADE UPDATE fails for self-referencing FK

2016-07-11 Thread Dmitry Yemanov (JIRA)
CASCADE UPDATE fails for self-referencing FK


 Key: CORE-5305
 URL: http://tracker.firebirdsql.org/browse/CORE-5305
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0.0, 4.0 Initial
Reporter: Dmitry Yemanov


Test case:

recreate table tfkself (col1 int primary key, col2 int references tfkself(col1) 
on update cascade);
insert into tfkself (col1, col2) values (1, null);
insert into tfkself (col1, col2) values (2, null);
insert into tfkself (col1, col2) values (3, 1);
commit;

update tfkself set col1 = -col1;

--violation of FOREIGN KEY constraint "".
--violation of FOREIGN KEY constraint "INTEG_14" on table "TFKSELF".
--Foreign key reference target does not exist.
--Problematic key value is ("COL2" = 1).

It appears that when the last row is being updated, it does not see the new 
(changed by casdade) value of the COL2 column.

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



--
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5281) Support AS CURSOR and . features in FOR EXECUTE STATEMENT loops

2016-06-14 Thread Dmitry Yemanov (JIRA)
Support AS CURSOR and . features in FOR EXECUTE STATEMENT loops
--

 Key: CORE-5281
 URL: http://tracker.firebirdsql.org/browse/CORE-5281
 Project: Firebird Core
  Issue Type: Improvement
  Components: Engine
Reporter: Dmitry Yemanov
Priority: Minor


This is not about positioned updates/deletes, but about a simplified syntax to 
retrieve the output values without using many variables. It's implementation is 
likely to be very different and it does not look easy at the first glance, but 
it would be nice to have one day.

A somewhat related improvement would be to allow AS CURSOR (or should it be AS 
RECORD?) syntax for singleton SELECT, EXECUTE PROCEDURE and EXECUTE STATEMENT 
commands, and probably for INSERT/UPDATE/DELETE RETURNING too.

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



--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5241) Affected rows are not counted for some update operations with views

2016-05-16 Thread Dmitry Yemanov (JIRA)
Affected rows are not counted for some update operations with views
---

 Key: CORE-5241
 URL: http://tracker.firebirdsql.org/browse/CORE-5241
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0.0, 4.0 Initial, 2.5.5, 2.5.4, 2.5.3 Update 1, 2.1.7, 
2.5.3, 2.5.2 Update 1, 2.5.2, 2.5.1, 2.5.0
Reporter: Dmitry Yemanov


Partially caused by the old bugfix CORE-578 which is totally wrong for PSQL 
with many updates, partially due to the changed rules for view updates in v2.0. 
The issue is not visible for DSQL updates and for single updates inside a PSQL 
block, it manifests itself only for multiple updates.

Simplified test case:

recreate table tbl (col int);
recreate view vtbl11 as select col from tbl;
recreate view vtbl12 as select col from vtbl11;

insert into tbl values (1);
commit;

set term ^;

execute block returns (out int)
as
begin
  update tbl set col = 2;
  out = row_count;
  suspend;
  update vtbl11 set col = 2;
  out = row_count;
  suspend;
  update vtbl12 set col = 2;
  out = row_count;
  suspend;
end^

-- returns {1, 1, 1} - as expected

recreate trigger t_vtbl11 for vtbl11 before update as begin end^
recreate trigger t_vtbl12 for vtbl12 before update as begin end^

execute block returns (out int)
as
begin
  update tbl set col = 2;
  out = row_count;
  suspend;
  update vtbl11 set col = 2;
  out = row_count;
  suspend;
  update vtbl12 set col = 2;
  out = row_count;
  suspend;
end^

-- wrongly returns {1, 0, 0}

execute block returns (out int)
as
begin
  update vtbl11 set col = 2;
  out = row_count;
  suspend;
  update vtbl12 set col = 2;
  out = row_count;
  suspend;
  update tbl set col = 2;
  out = row_count;
  suspend;
end^

-- wrongly returns  {1, 0, 1}

Correct ROW_COUNT is returned for real tables, for naturally updatable views 
and sometimes for the first trigger-backed view (if no tables were updated 
beforehand). All other views are "pseudo-updated" correctly but zero ROW_COUNT 
is returned. It doesn't make any difference whether a trigger performs 
something useful or not.

Additionally, wrong ROW_COUNT calculation makes UPDATE OR INSERT failing for 
trigger-backed views.


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



--
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5239) Add virtual table SEC$ROLES to return all roles currently active for the connected user

2016-05-15 Thread Dmitry Yemanov (JIRA)
Add virtual table SEC$ROLES to return all roles currently active for the 
connected user
---

 Key: CORE-5239
 URL: http://tracker.firebirdsql.org/browse/CORE-5239
 Project: Firebird Core
  Issue Type: Improvement
  Components: Engine
Reporter: Dmitry Yemanov


After introducing default (and aggregated) roles, CURRENT_ROLE becomes 
practically useless in such cases. We now have RDB$ROLE_IN_USE() to 
check for a particular role, this replaces the IF (CURRENT_ROLE = ) 
functionality for the cases with multiple active roles. But it would be also 
handy to just know (enumerate) all the active roles, hence this ticket.

SEC$ROLES may either return all roles active for the current user, or return 
all roles granted to the current user with a flag whether every role is 
currently active or not.

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



--
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5238) Replace xinetd support with the native listener

2016-05-15 Thread Dmitry Yemanov (JIRA)
Replace xinetd support with the native listener
---

 Key: CORE-5238
 URL: http://tracker.firebirdsql.org/browse/CORE-5238
 Project: Firebird Core
  Issue Type: Task
 Environment: POSIX Classic
Reporter: Dmitry Yemanov


Using the same native network listener (firebird process) on Classic would be 
the logical last step in unifying the architectures. It would simplify 
maintenance for us (no need to double install scripts) and production setup for 
end users (easy to detect running server, no need to tweak xinetd.conf re. max 
number of connections, etc.). Also, it would allow some new features requiring 
other-than-networking threads running inside the server.

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



--
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5229) Allow to enforce IPv4 or IPv6 in URL-like connection strings

2016-05-06 Thread Dmitry Yemanov (JIRA)
Allow to enforce IPv4 or IPv6 in URL-like connection strings


 Key: CORE-5229
 URL: http://tracker.firebirdsql.org/browse/CORE-5229
 Project: Firebird Core
  Issue Type: Improvement
  Components: API / Client Library
Reporter: Dmitry Yemanov
Priority: Minor


Extend the new URL-style connection string format to restrict name lookup to 
only IPv4 or IPv6 addresses:

  connect 'inet://server.example.org/test';
  connect 'inet4://server.example.org/test';
  connect 'inet6://server.example.org/test';

First example tries all addresses, second only IPv4 ones, third only IPv6ones. 
This can be used to avoid connection delays on systems where name lookup 
returns IPv6 addresses for some host names but attempts to connect to them time 
out rather than failing immediatelly (as reported, this can happen even for 
name "localhost" on some systems).

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



--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5228) Restore may hang if the database contains more than 4 billion records

2016-05-06 Thread Dmitry Yemanov (JIRA)
Restore may hang if the database contains more than 4 billion records
-

 Key: CORE-5228
 URL: http://tracker.firebirdsql.org/browse/CORE-5228
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0.0, 4.0 Initial, 2.5.5, 2.5.4, 2.5.3 Update 1, 2.1.7, 
2.5.3, 2.5.2 Update 1, 2.5.2, 2.5.1, 2.5.0
Reporter: Dmitry Yemanov


The problem of the current restore process is that every record is inserted in 
its own looper roundtrip and thus using its own savepoint. The savepoint number 
is 32-bit and it wraps around after 2^32 iterations. This particular issue is 
not related to GBAK, it's common to any single transaction modifying billions 
of records. Fortunately, old dumb savepoint handling is tolerate to such a 
wraparound in trivial cases, so GBAK is not affected.

Second part of the problem appears when this transaction has also a deferred 
work (uncommitted DDL). AFAIU, the legacy code implicitly assumes that there 
cannot be savepoint number zero, but it becomes possible due to wraparound. So 
DFW_merge_work() is called with old_sav_number = 0 and new_sav_number = 0 and 
it enters an infinite loop, causing a hang.

Workaround for GBAK's restore is to use the -o switch, which restores every 
table in its own transaction (and also separates a DDL transaction from 
multiple DML transactions).

A noticable improvement could be to avoid savepoints during restore at all. 
IIRC, InterBase has added the isc_tpb_no_savepoints feature. But I leave this 
for another ticket.

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



--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5226) Incorrect result set (missing records) may be returned by the ORDER plan query navigating on a descending index

2016-05-01 Thread Dmitry Yemanov (JIRA)
Incorrect result set (missing records) may be returned by the ORDER plan query 
navigating on a descending index
---

 Key: CORE-5226
 URL: http://tracker.firebirdsql.org/browse/CORE-5226
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0.0, 4.0 Initial, 2.5.5, 2.5.4, 2.5.3 Update 1, 2.1.7, 
2.5.3, 2.5.2 Update 1, 2.5.2, 2.5.1, 2.5.0
Reporter: Dmitry Yemanov


It happens only if the index key was removed (concurrently or by the 
cooperative GC) after reading it but before validating it using the fetched 
record. Only DESC indices are affected, the issue also depends on index key 
values. The bug seems to be inherited from InterBase.

Simplified example (leaf page layout):

key A, length 23, points to record 120006 (old version to be GCed)
key B, length 22, points to record 119054
key C, length 22, points to record 119535
key D, length 22, points to record 120006 (last committed version)

Key A gets GCed while reading and disappears, but key B is skipped and only 
records for C and D are returned. The second execution (with no GC involved) 
correctly returns {B, C, D}. The issue manifests itself only if key B has all 
its 22 bytes equal to key A (which is one byte longer).

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



--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5222) SELECT WITH LOCK may raise unexpected update conflict errors under concurrent load

2016-04-29 Thread Dmitry Yemanov (JIRA)
SELECT WITH LOCK may raise unexpected update conflict errors under concurrent 
load
--

 Key: CORE-5222
 URL: http://tracker.firebirdsql.org/browse/CORE-5222
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0.0, 4.0 Initial
Reporter: Dmitry Yemanov


This is a regression introduced in v3.0. Easily noticable in read-committed 
no-record-version mode.

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



--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5218) Explicitly defined names for NOT NULL constraint are not exported into script by ISQL -x

2016-04-28 Thread Dmitry Yemanov (JIRA)
Explicitly defined names for NOT NULL constraint are not exported into script 
by ISQL -x


 Key: CORE-5218
 URL: http://tracker.firebirdsql.org/browse/CORE-5218
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0.0, 4.0 Initial, 2.5.5, 2.5.4, 2.5.3 Update 1, 2.1.7, 
2.5.3, 2.5.2 Update 1, 2.5.2, 2.5.1, 2.5.0
Reporter: Dmitry Yemanov
Priority: Minor


create table t (
  id int constraint tc0 primary key,
  col1 int constraint tc1 unique,
  col2 int constraint tc2 not null,
  col3 int not null);

Then export via isql -x:

/* Table: T, Owner: DIMITR */
CREATE TABLE T (ID INTEGER NOT NULL,
COL1 INTEGER,
COL2 INTEGER NOT NULL,
COL3 INTEGER NOT NULL,
CONSTRAINT TC0 PRIMARY KEY (ID),
CONSTRAINT TC1 UNIQUE (COL1));

Both COL2 and COL3 are exported with unnamed NOT NULL constraints, despite the 
explicitly specified name TC2. The funny thing is that it gets exported 
correctly for Dialect 1 databases but not for Dialect 3 databases. The script 
should be something like:

/* Table: T, Owner: DIMITR */
CREATE TABLE T (ID INTEGER NOT NULL,
COL1 INTEGER,
COL2 INTEGER CONSTRAINT TC2 NOT NULL,
COL3 INTEGER NOT NULL,
CONSTRAINT TC0 PRIMARY KEY (ID),
CONSTRAINT TC1 UNIQUE (COL1));


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



--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5216) Provide location context (line/column numbers) for runtime errors raised inside EXECUTE BLOCK

2016-04-28 Thread Dmitry Yemanov (JIRA)
Provide location context (line/column numbers) for runtime errors raised inside 
EXECUTE BLOCK
-

 Key: CORE-5216
 URL: http://tracker.firebirdsql.org/browse/CORE-5216
 Project: Firebird Core
  Issue Type: Improvement
  Components: Engine
Reporter: Dmitry Yemanov


set term ^;

select cast('' as timestamp) from rdb$database
^
-- ERROR:
-- Statement failed, SQLSTATE = 22018
-- conversion error from string ""


recreate procedure qwe123
  returns(res timestamp)
as
begin
  res = cast('' as timestamp);
  suspend;
end
^

execute procedure qwe123
^
-- ERROR:
-- Statement failed, SQLSTATE = 22018
-- conversion error from string ""
-- At procedure 'QWE123' line: 5, col: 3

execute block
returns(res timestamp)
as
begin
  res = cast('' as timestamp);
  suspend;
end
^
-- ERROR:
-- Statement failed, SQLSTATE = 22018
-- conversion error from string ""

Something like "At anonymous block line: 5, col: 3" should be reported in this 
case.


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



--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5182) Inconsistent effects of subsequent statement execution if failing during record refetch

2016-04-03 Thread Dmitry Yemanov (JIRA)
Inconsistent effects of subsequent statement execution if failing during record 
refetch
---

 Key: CORE-5182
 URL: http://tracker.firebirdsql.org/browse/CORE-5182
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 4.0 Initial, 3.0 RC2, 3.0 RC1
Reporter: Dmitry Yemanov


Test case:

CREATE TABLE Q (F1  INT);

CREATE OR ALTER TRIGGER Q_AD FOR Q
ACTIVE AFTER DELETE POSITION 0
AS
BEGIN
  DELETE FROM Q;
END

COMMIT;

INSERT INTO Q (F1) VALUES (1);
INSERT INTO Q (F1) VALUES (2);
INSERT INTO Q (F1) VALUES (3);
INSERT INTO Q (F1) VALUES (4);

COMMIT;

DELETE FROM Q;
-- ERROR:
-- no current record for fetch operation.
-- At trigger 'Q_AD' line: 5, col: 3
-- At trigger 'Q_AD' line: 5, col: 3.
-- this is more or less expected (or at least known about), see CORE-5142

DELETE FROM Q;
-- ERROR:
-- no current record for fetch operation.
-- At trigger 'Q_AD' line: 5, col: 3.
-- error is now raised at the first level of trigger recursion

DELETE FROM Q;
-- ERROR:
-- no current record for fetch operation.
-- error is now raised by the outer DELETE itself

In more complex examples the final execution happens without errors at all. 
Intermediate ROLLBACKs between DELETEs don't change anything. Reconnect returns 
everything to its original state, i.e. problem is not persistent.

Happens only after "no current record for fetch operation" error is raised. 
Related to stable cursors. Happens either for re-executions of prepared 
statements or if error is raised inside a trigger or stored procedure (as their 
requests are reused).


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



--
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5159) Regression: engine may throw transliteration errors when running from non-ASCII system path

2016-03-20 Thread Dmitry Yemanov (JIRA)
Regression: engine may throw transliteration errors when running from non-ASCII 
system path
---

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


Unpack Firebird into some non-ASCII directory and try to create some ICU 
collation (or restore a backup with ICU attributes), for example:

c:\тест\firebird>gbak -r -v -p 8192 c:\firebird\test.fbk c:\firebird\test.fdb
gbak:opened file c:\firebird\test.fbk
gbak:transportable backup -- data in XDR format
gbak:   backup file is compressed
gbak:backup version is 9
gbak: ERROR:arithmetic exception, numeric overflow, or string truncation
gbak: ERROR:Cannot transliterate character between character sets
gbak: ERROR:failed to create database c:\firebird\test.fdb
gbak:Exiting before completion due to errors

It works fine with FB 2.5. Stack trace for error:

fbintl.dll!Jrd::CsConvert::convert()
fbintl.dll!Firebird::IntlUtil::parseSpecificAttributes()
fbintl.dll!Jrd::getVersions()
fbintl.dll!Jrd::UnicodeUtil::loadICU()
fbintl.dll!Jrd::UnicodeUtil::getCollVersion()
fbintl.dll!Firebird::IntlUtil::setupIcuAttributes()
fbintl.dll!LCICU_setup_attributes()
fbintl.dll!LD_setup_attributes()
engine12.dll!Jrd::IntlManager::setupCollationAttributes()
engine12.dll!setupSpecificCollationAttributes()
engine12.dll!create_collation()
engine12.dll!DFW_perform_work()
engine12.dll!DFW_perform_system_work()
engine12.dll!INI_format()
engine12.dll!Jrd::JProvider::createDatabase()

Transliteration error happens because attributes are treated as ASCII:

charset cs;
IntlUtil::initAsciiCharset(&cs);

AutoPtr 
ascii(Jrd::CharSet::createInstance(*getDefaultMemoryPool(), 0, &cs));

IntlUtil::SpecificAttributesMap config;
IntlUtil::parseSpecificAttributes(ascii, configInfo.length(),
(const UCHAR*) configInfo.c_str(), &config);

but in fact it includes a "filename" attribute containing ANSI characters:

p = 0x004a0dab "c:\тест\firebird\intl\fbintl;icu_versions=default"


-- 
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=278785231&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5153) Regression: Server crashes when aggregate functions are used together with NOT IN predicate

2016-03-19 Thread Dmitry Yemanov (JIRA)
Regression: Server crashes when aggregate functions are used together with NOT 
IN predicate
---

 Key: CORE-5153
 URL: http://tracker.firebirdsql.org/browse/CORE-5153
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 4.0 Initial, 3.0 RC2, 3.0 RC1, 3.0 Beta 2, 3.0 Beta 1
Reporter: Dmitry Yemanov


Simplified test case:

select r.rdb$relation_id, count(*)
from rdb$database r
group by r.rdb$relation_id
having count(*) not in (select r2.rdb$relation_id from rdb$database r2);


-- 
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=278785231&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5158) Extend ALTER EXTERNAL FUNCTION to adjust arguments

2016-03-19 Thread Dmitry Yemanov (JIRA)
Extend ALTER EXTERNAL FUNCTION to adjust arguments
--

 Key: CORE-5158
 URL: http://tracker.firebirdsql.org/browse/CORE-5158
 Project: Firebird Core
  Issue Type: Improvement
  Components: Engine
Reporter: Dmitry Yemanov


v3.0 prohibits any system table updates. But it also closed an ability to 
change arguments for existing UDFs. For example, increasing length from 
CSTRING(100) to CSTRING(1000) is safe and I believe could be supported. 
Currently, ALTER EXTERNAL FUNCTION allows only module and entrypoint to be 
changed. Dropping is not an option due to dependencies.

-- 
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=278785231&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5122) Expression index may not be used by the optimizer if created and used in different connection charsets

2016-02-29 Thread Dmitry Yemanov (JIRA)
Expression index may not be used by the optimizer if created and used in 
different connection charsets
--

 Key: CORE-5122
 URL: http://tracker.firebirdsql.org/browse/CORE-5122
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.5, 3.0 RC1, 3.0 Beta 2, 2.5.4, 3.0 Beta 1, 2.5.3, 3.0 
RC2
Reporter: Dmitry Yemanov


If the index expression contains a string literal, e.g. computed by 
(my_udf(my_field, 'ABC')) or computed by (my_field || 'ABC'), index is created 
in connection charset X but used in connections with charset other than X, then 
index and user expressions are considered different and index is not used by 
the optimizer.

This is a regression introduced in v2.5.3 as well as in v3.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



--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5119) Support autocommit mode in SET TRANSACTION statement

2016-02-28 Thread Dmitry Yemanov (JIRA)
Support autocommit mode in SET TRANSACTION statement


 Key: CORE-5119
 URL: http://tracker.firebirdsql.org/browse/CORE-5119
 Project: Firebird Core
  Issue Type: Improvement
  Components: Engine
Reporter: Dmitry Yemanov
Priority: Trivial


Autocommit was always supported in API by using the isc_tpb_autocommit tag. It 
would make sense to surface it in DSQL too by extending the SET TRANSACTION 
statement.

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



--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4982) Server crashes during "select from procedure" if exception is thrown while backing out the current savepoint

2015-10-29 Thread Dmitry Yemanov (JIRA)
Server crashes during "select from procedure" if exception is thrown while 
backing out the current savepoint


 Key: CORE-4982
 URL: http://tracker.firebirdsql.org/browse/CORE-4982
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0 Beta 2, 2.5.4, 2.5.3 Update 1, 2.1.7, 3.0 Beta 1, 
2.5.3, 3.0 Alpha 2, 3.0 Alpha 1, 2.5.2 Update 1, 2.5.2, 2.5.1, 2.5.0
Reporter: Dmitry Yemanov


The bug should be common for all versions, although less visible in v2.x due to 
bugcheck being raised immediately.

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



--
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4872) v3 fbclient cannot work with servers older than v2.5 via the remote protocol

2015-07-10 Thread Dmitry Yemanov (JIRA)
v3 fbclient cannot work with servers older than v2.5 via the remote protocol


 Key: CORE-4872
 URL: http://tracker.firebirdsql.org/browse/CORE-4872
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0 Beta 2, 3.0 Beta 1
Reporter: Dmitry Yemanov


Historically, BLOB IDs were described as blr_quad in remote messages, because 
older server versions don't understand blr_blob2. v3 fbclient breaks this 
compatibility by sending blr_blob2 over the wire. ISQL connects fine, SHOW 
VERSION executes fine, but "select * from rdb$database" throws "error reading 
data from the connection".

I suppose we could simply revert back to the old behavior, but a more clever 
approach would be to check the protocol version and use blr_blob2 only if the 
server is known to understand it. I'm preparing the patch at the moment.

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



--
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4824) Result of a MERGE statement may depend on the execution plan if multiple matches exist

2015-06-02 Thread Dmitry Yemanov (JIRA)
Result of a MERGE statement may depend on the execution plan if multiple 
matches exist
--

 Key: CORE-4824
 URL: http://tracker.firebirdsql.org/browse/CORE-4824
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Reporter: Dmitry Yemanov


Copied from a comment in CORE-4618:

Seems that recent fix leads to different results of MERGE statement when INDEX 
on joined field is added. 

For example: 

recreate table t(id int, x int, y int); 
commit; 
insert into t (id, x, y) values (1, 1, 1); 
insert into t (id, x, y) values (3, 1, 0); 
insert into t (id, x, y) values (2, 0, 2); 
commit; 
create index t_x on t(x); --  NB : this 
statement affects on result of merge 
commit; 
select 'before_merge' msg, t.* from t order by id; 
set plan on; 
merge into t 
using t s 
  --(select * from t order by x) s 
on t.x=s.x 
when matched then update set t.x = t.x + s.y, t.y = t.y - s.x; 
set plan off; 
select 'after_merge' msg, t.* from t order by id; 
rollback; 

Test-1: WITHOUT index `t_x`: 

MSG ID X Y 
    
before_merge 1 1 1 
before_merge 2 0 2 
before_merge 3 1 0 


PLAN HASH (T NATURAL, S NATURAL) 

MSG ID X Y 
===    
after_merge 1 2 0 
after_merge 2 2 2 
after_merge 3 2 -1 


Test-2: WITH index `t_x`: 
MSG ID X Y 
    
before_merge 1 1 1 
before_merge 2 0 2 
before_merge 3 1 0 


PLAN JOIN (S NATURAL, T INDEX (T_X)) 

MSG ID X Y 
===    
after_merge 1 1 0 
after_merge 2 2 2 
after_merge 3 1 -1 

Rows with 'after_merge' in MSG column differ in 'X' field. 

ISQL Version: WI-T3.0.0.31532 Firebird 3.0 Beta 2 
Server version: 
Firebird/Windows/Intel/i386 (access method), version "WI-T3.0.0.31532 Firebird 
3.0 Beta 2" 
on disk structure version 12.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



--
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4704) Generator/exception permissions get corrupted after backup/restore

2015-03-04 Thread Dmitry Yemanov (JIRA)
Generator/exception permissions get corrupted after backup/restore
--

 Key: CORE-4704
 URL: http://tracker.firebirdsql.org/browse/CORE-4704
 Project: Firebird Core
  Issue Type: Bug
  Components: GBAK
Affects Versions: 3.0 Beta 1, 3.0 Alpha 2, 3.0 Alpha 1
Reporter: Dmitry Yemanov


USAGE permissions granted to generators and/or exceptions can be lost after 
backup/restore, their appropriate ACLs appear to be reused by some other 
objects (e.g. tables) and overwritten.

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



--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4639) Linux server may reject connections with a transliteration error

2014-12-16 Thread Dmitry Yemanov (JIRA)
Linux server may reject connections with a transliteration error


 Key: CORE-4639
 URL: http://tracker.firebirdsql.org/browse/CORE-4639
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0 Beta 1, 3.0 Alpha 2, 3.0 Alpha 1
 Environment: Any Linux build
Reporter: Dmitry Yemanov


Example of failure:

SQL> connect 192.168.1.105:employee user sysdba password 123;
Statement failed, SQLSTATE = 08001
Invalid connection string
-Cannot transliterate character between character sets
-Invalid or incomplete multibyte or wide character

It happens when a connection is being established from a client host with 
non-ASCII (e.g. Cyrillic) name or with non-ASCII OS user name. This could be 
quite common in the Windows world.

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



--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Reopened: (CORE-4602) RemoteServicePort is not working

2014-12-02 Thread Dmitry Yemanov (JIRA)

 [ 
http://tracker.firebirdsql.org/browse/CORE-4602?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Yemanov reopened CORE-4602:
--

Fix Version/s: (was: 3.0 Beta 2)

Sean, pay attention to the build numbers. It works OK in official Beta (earlier 
build) but fails in the later build (snapshot). So you cannot resolve it as 
fixed, actually it's a recent regression.

> RemoteServicePort is not working
> 
>
> Key: CORE-4602
> URL: http://tracker.firebirdsql.org/browse/CORE-4602
> Project: Firebird Core
>  Issue Type: Bug
>  Components: Engine
>Affects Versions: 3.0 RC 1
> Environment: Windows 8.1 x64 , Firebird 3.0.0.31397 32bit
>Reporter: Mercea Paul
>
> Setting different value for RemoteServicePort in firebird.conf has no effect. 
> Firebird runs on 3050.
> I have Firebird 2.5.2 32 bit installed, but stoped. FB3, start running on 
> 3050 with any value on RemoteServicePort (3033,3053,etc).

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



--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4631) Lock manager "out of room" error hides the real cause of this problem

2014-12-02 Thread Dmitry Yemanov (JIRA)
Lock manager "out of room" error hides the real cause of this problem
-

 Key: CORE-4631
 URL: http://tracker.firebirdsql.org/browse/CORE-4631
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.3, 2.1.6, 2.5.2 Update 1, 2.1.5 Update 1, 2.5.2, 2.1.5
Reporter: Dmitry Yemanov
Priority: Minor


When the shared memory region backing the lock table cannot be remapped, the 
status vector returns the error message (lock manager out of room), but it 
lacks any low-level details (e.g. OS level error) causing this particular 
problem.

This is mostly fixed in v3, but some cases are not covered there either.

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



--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4616) Server crashes while accessing context variables concurrently

2014-11-21 Thread Dmitry Yemanov (JIRA)
Server crashes while accessing context variables concurrently
-

 Key: CORE-4616
 URL: http://tracker.firebirdsql.org/browse/CORE-4616
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.3, 2.5.2 Update 1, 2.5.2
Reporter: Dmitry Yemanov


Crash happens when one thread executes RDB$SET_CONTEXT:

fb_inet_server!set_context
fb_inet_server!CALL_UDF
fb_inet_server!invoke
fb_inet_server!FUN_evaluate
fb_inet_server!EVL_expr
fb_inet_server!EXE_assignment
fb_inet_server!EXE_looper
fb_inet_server!looper_seh
fb_inet_server!execute_looper
fb_inet_server!EXE_start
fb_inet_server!execute_triggers
fb_inet_server!EXE_execute_db_triggers
fb_inet_server!JRD_start_multiple
fb_inet_server!jrd8_start_transaction

and another one retrieves the list of context variables due to the MON$ table 
request:

fb_inet_server!Jrd::DatabaseSnapshot::putContextVars+0xc3
fb_inet_server!Jrd::DatabaseSnapshot::dumpData+0x128
fb_inet_server!Jrd::DatabaseSnapshot::blockingAst+0x9c
fb_inet_server!Jrd::LockManager::blocking_action+0x134
fb_inet_server!Jrd::LockManager::signal_owner+0x37
fb_inet_server!Jrd::LockManager::post_blockage+0x1b4
fb_inet_server!Jrd::LockManager::wait_for_request+0x3d9
fb_inet_server!Jrd::LockManager::grant_or_que+0x8c
fb_inet_server!Jrd::LockManager::enqueue+0x20e
fb_inet_server!enqueue+0x51
fb_inet_server!LCK_lock+0x8f
fb_inet_server!LCK_lock_opt+0x36
fb_inet_server!lock_buffer+0xdb
fb_inet_server!CCH_fetch_lock+0x132
fb_inet_server!CCH_fetch+0x2d
fb_inet_server!DPM_gen_id+0x152 

Bug is caused by the lack of proper synchronization inside RDB$SET_CONTEXT. 
v2.1 and v3 are not affected.

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



--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4568) Server may crash while disconnecting from the database under load

2014-10-01 Thread Dmitry Yemanov (JIRA)
Server may crash while disconnecting from the database under load
-

 Key: CORE-4568
 URL: http://tracker.firebirdsql.org/browse/CORE-4568
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0 Alpha 2, 3.0 Alpha 1
 Environment: SC/CS only
Reporter: Dmitry Yemanov


If a page-level AST is delivered during the database disconnection, the server 
may crash.

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



--
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4564) Add per-table performance counters to the monitoring tables

2014-09-30 Thread Dmitry Yemanov (JIRA)
Add per-table performance counters to the monitoring tables
---

 Key: CORE-4564
 URL: http://tracker.firebirdsql.org/browse/CORE-4564
 Project: Firebird Core
  Issue Type: Improvement
  Components: Engine
Reporter: Dmitry Yemanov


Currently, record level performance counters are available in MON$RECORD_STATS 
only globally (aggregating all affected tables). However, they are available at 
the per table basis in the trace output. It makes a lot of sense to report them 
per table in the monitoring tables too.

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



--
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4534) Invalid DB_KEY based retrievals when concatenation is involved

2014-08-28 Thread Dmitry Yemanov (JIRA)
Invalid DB_KEY based retrievals when concatenation is involved
--

 Key: CORE-4534
 URL: http://tracker.firebirdsql.org/browse/CORE-4534
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.3, 2.1.6, 3.0 Alpha 2, 3.0 Alpha 1, 2.5.2 Update 1, 
2.1.5 Update 1, 2.5.2, 2.1.5
Reporter: Dmitry Yemanov
Priority: Minor


Trivial demonstration:

set plan;

select * from rdb$database where rdb$db_key = x'';
PLAN (RDB$DATABASE INDEX ()) -- OK

select * from rdb$database where rdb$db_key || '' = x'';
PLAN (RDB$DATABASE INDEX ()) -- unexpected, but it does not hurt

select * from rdb$database where rdb$db_key || x'' = 
x'';
PLAN (RDB$DATABASE INDEX ()) -- wrong

select * from rdb$database where rdb$db_key || rdb$db_key = x'';
PLAN (RDB$DATABASE INDEX ()) -- wrong

Concatenation of DBKEYs is a special operation (used to combine individual 
DBKEYs for multi-table views) but the engine doesn't assume that user can also 
concatenate DBKEYs. Lack of proper checks may lead to invalid retrievals as 
shown above.

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



--
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4530) DB_KEY based join of two tables may be ineffective

2014-08-25 Thread Dmitry Yemanov (JIRA)
DB_KEY based join of two tables may be ineffective
--

 Key: CORE-4530
 URL: http://tracker.firebirdsql.org/browse/CORE-4530
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.3, 3.0 Alpha 2
Reporter: Dmitry Yemanov


Simplified test case:

set planonly;
recreate table t (id int primary key);
commit; 

select count(*)
from (select id, rdb$db_key k from t a order by id) x
left join t z on x.k = z.rdb$db_key -- (*)

PLAN JOIN (X A ORDER RDB$PRIMARY4, Z NATURAL)

vs

select count(*)
from (select id, rdb$db_key k from t a order by id) x
left join t z on z.rdb$db_key = x.k -- (*)

PLAN JOIN (X A ORDER RDB$PRIMARY4, Z INDEX ())

i.e. order of expressions in the join condition affects the generated plan and 
thus performance.

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



--
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4460) Expressions containing some built-in functions may be badly optimized

2014-06-10 Thread Dmitry Yemanov (JIRA)
Expressions containing some built-in functions may be badly optimized
-

 Key: CORE-4460
 URL: http://tracker.firebirdsql.org/browse/CORE-4460
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.2 Update 1, 2.1.5 Update 1, 2.5.2, 2.1.5
Reporter: Dmitry Yemanov


Test cases for predicates distributed into the union sub-parts:

select * from (
  select rdb$relation_name from rdb$relations
  union
  select rdb$procedure_name from rdb$procedures
) as dt (name) where dt.name = ''

PLAN (DT RDB$RELATIONS INDEX (RDB$INDEX_0))
PLAN (DT RDB$PROCEDURES INDEX (RDB$INDEX_21))

select * from (
  select rdb$relation_name from rdb$relations
  union
  select rdb$procedure_name from rdb$procedures
) as dt (name) where dt.name = upper('')

PLAN (DT RDB$RELATIONS INDEX (RDB$INDEX_0))
PLAN (DT RDB$PROCEDURES INDEX (RDB$INDEX_21))

select * from (
  select rdb$relation_name from rdb$relations
  union
  select rdb$procedure_name from rdb$procedures
) as dt (name) where dt.name = trim('')

PLAN (DT RDB$RELATIONS INDEX (RDB$INDEX_0))
PLAN (DT RDB$PROCEDURES INDEX (RDB$INDEX_21))

select * from (
  select rdb$relation_name from rdb$relations
  union
  select rdb$procedure_name from rdb$procedures
) as dt (name) where dt.name = left('', 0)

PLAN (DT RDB$RELATIONS NATURAL)
PLAN (DT RDB$PROCEDURES NATURAL)

select * from (
  select rdb$relation_name from rdb$relations
  union
  select rdb$procedure_name from rdb$procedures
) as dt (name) where dt.name = minvalue('', '')

PLAN (DT RDB$RELATIONS NATURAL)
PLAN (DT RDB$PROCEDURES NATURAL)

select * from (
  select rdb$relation_name from rdb$relations
  union
  select rdb$procedure_name from rdb$procedures
) as dt (name) where dt.name = rpad('', 0, '')

PLAN (DT RDB$RELATIONS NATURAL)
PLAN (DT RDB$PROCEDURES NATURAL)

The issue does not affect v3.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



--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4403) Allow referencing cursors as record variables in PSQL

2014-04-24 Thread Dmitry Yemanov (JIRA)
Allow referencing cursors as record variables in PSQL
-

 Key: CORE-4403
 URL: http://tracker.firebirdsql.org/browse/CORE-4403
 Project: Firebird Core
  Issue Type: Improvement
  Components: Engine
Reporter: Dmitry Yemanov
Priority: Minor


Either explicit (DECLARE AS CURSOR) or implicit (FOR SELECT) PSQL cursors could 
make their current record available via the cursor name similar to OLD/NEW 
trigger contexts, thus making the INTO clause optional. In FOR SELECT loops, it 
requires AS CURSOR clause to be specified. For example:

for
  select rdb$relation_id as id, rdb$relation_name as name
  from rdb$relations
  where rdb$view_blr is null
  as cursor tables
do begin
  out_id = tables.id;
  out_name = tables.name;
  suspend;
end

To avoid ambiguities, the colon prefix could be used.

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



--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4402) Add timing statistics to the monitoring tables

2014-04-24 Thread Dmitry Yemanov (JIRA)
Add timing statistics to the monitoring tables
--

 Key: CORE-4402
 URL: http://tracker.firebirdsql.org/browse/CORE-4402
 Project: Firebird Core
  Issue Type: Improvement
  Components: Engine
Reporter: Dmitry Yemanov


It would be useful to track timing for different operations and aggregate these 
values at request / transaction / connection / database levels as other runtime 
statsitics is maintained. In particular, I was thinking about total time spent, 
CPU time (maybe separated for user / kernel) and various waiting time - 
database I/O waits, lock manager waits, cache latch waits, etc. This opens wide 
possibilities for tracking down the performance issues. Note that I don't 
suggest tracking time for particular sub-operations (retrievals, sorts, joins, 
etc), so it's not about profiling the algorithms. It's more about finding 
bottlenecks in I/O or contention.

As time tracking is likely to be a costly operation, it should be disabled by 
default and enabled explicitly by the DBA, probably for either particular 
connections or globally for a database.

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



--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4388) SELECT WITH LOCK may enter an infinite loop for a single record

2014-04-13 Thread Dmitry Yemanov (JIRA)
SELECT WITH LOCK may enter an infinite loop for a single record
---

 Key: CORE-4388
 URL: http://tracker.firebirdsql.org/browse/CORE-4388
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0 Alpha 2, 3.0 Alpha 1
Reporter: Dmitry Yemanov


If a concurrent transaction has deleted (and committed) the record that our 
transaction is trying to lock, the engine keeps infinitely attempting to lock 
the deleted record.

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



--
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4386) Report more details for "object in use" errors

2014-04-05 Thread Dmitry Yemanov (JIRA)
Report more details for "object in use" errors
--

 Key: CORE-4386
 URL: http://tracker.firebirdsql.org/browse/CORE-4386
 Project: Firebird Core
  Issue Type: Improvement
  Components: Engine
Reporter: Dmitry Yemanov
Priority: Minor


While a proper metadata naming convention surely helps, the engine could be 
polite enough to report not only the name of the used object but its type 
(table/index/procedure/etc) as well. Also, for used indices currently a string 
"INDEX" is reported instead of the index name.

Thinking about this more, it would be great to have an original DDL command (or 
at least its shorthand) reported for any DFW error happening during commit. 
This would radically simplify debugging of multi-command DDL scripts.

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



--
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4384) Problems when a table grows beyond 65535 pointer pages

2014-04-04 Thread Dmitry Yemanov (JIRA)
Problems when a table grows beyond 65535 pointer pages
--

 Key: CORE-4384
 URL: http://tracker.firebirdsql.org/browse/CORE-4384
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0 Alpha 2, 3.0 Alpha 1, 2.5.2 Update 1, 2.1.5 Update 1, 
2.5.2, 2.1.5, 2.5.1, 2.1.4, 2.5.0, 2.1.3, 2.1.2, 2.1.1, 2.1.0
Reporter: Dmitry Yemanov


The USHORT pp_sequence number wraps and it may lead to unexpected issues like 
an infinite loop inside extend_relation() or locate_space(). This issue 
manifests itself when a table (including garbage) gets bigger than 256GB (for 
4KB page) ... 4TB (for 16KB page) and remains even after a garbage collection 
pass.

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



--
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4365) Equality predicate distribution does not work for some complex queries

2014-03-15 Thread Dmitry Yemanov (JIRA)
Equality predicate distribution does not work for some complex queries
--

 Key: CORE-4365
 URL: http://tracker.firebirdsql.org/browse/CORE-4365
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0 Alpha 2, 3.0 Alpha 1, 2.5.2 Update 1, 2.1.5 Update 1, 
2.5.2, 2.1.5, 2.5.1, 2.1.4, 2.5.0, 2.1.3, 2.1.2, 2.1.1, 2.1.0
Reporter: Dmitry Yemanov


Artificial test case:

set planonly;

select * from (
  select rdb$relation_id as id
  from rdb$relations r
join (
  select rdb$generator_id as id from rdb$generators
  union all
  select rdb$generator_id as id from rdb$generators
) rf on rf.id = r.rdb$relation_id
) where id = 1

PLAN JOIN (RF RDB$GENERATORS INDEX (RDB$INDEX_46), RF RDB$GENERATORS INDEX 
(RDB$INDEX_46), R INDEX (RDB$INDEX_1))

Note that "id = 1" means "r.rdb$relation_id = 1", given both this boolean and 
"rf.id = r.rdb$relation_id", the optimizer derives "rf.id = 1" that can be 
pushed inside the union to become "rdb$generator_id = 1" thus using indices for 
filtering. So far so good.

select * from (
  select rdb$relation_id as id
  from rdb$relations r
join (
  select rdb$generator_id as id from rdb$generators
  union all
  select rdb$generator_id as id from rdb$generators
) rf on rf.id = r.rdb$relation_id
left join rdb$procedures p on p.rdb$procedure_id = rf.id
) where id = 1

PLAN JOIN (JOIN (RF RDB$GENERATORS NATURAL, RF RDB$GENERATORS NATURAL, R INDEX 
(RDB$INDEX_1)), P INDEX (RDB$INDEX_22))

And here we see that an extra unrelated join completely breaks equality 
distribution so that no new boolean is injected and no indices are used inside 
the union.

Expected plan:
PLAN JOIN (JOIN (RF RDB$GENERATORS INDEX (RDB$INDEX_46), RF RDB$GENERATORS 
INDEX (RDB$INDEX_46), R INDEX (RDB$INDEX_1)), P INDEX (RDB$INDEX_22))


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



--
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4356) Asynchronous cancellation request can be ignored in the case of EXECUTE STATEMENT and WHEN used together

2014-03-03 Thread Dmitry Yemanov (JIRA)
Asynchronous cancellation request can be ignored in the case of EXECUTE 
STATEMENT and WHEN used together


 Key: CORE-4356
 URL: http://tracker.firebirdsql.org/browse/CORE-4356
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.1.4, 2.5.0, 2.1.3, 2.1.2, 2.1.1, 2.1.0
Reporter: Dmitry Yemanov


Artificial test case:

set term ^;

execute block as
  declare stt varchar(255) = 'execute block as begin while (1 = 1) do begin end 
end';
begin
  while(1=1) do
begin
  execute statement stt;
  when any do begin end
end
end^

set term ;^
commit;

Then either press Ctrl-C in the current ISQL session or issue "delete from 
mon$statements where mon$attachment_id <> current_connection" from a different 
ISQL session.

The endless loop inside EXECUTE STATEMENT really gets interrupted but 
isc_cancelled error gets handled by the WHEN block and the loop continues. This 
is a bug, cancellation/shutdown errors should not be processed by exception 
handlers.


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



--
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4353) Sorting records are larger than really necessary

2014-02-25 Thread Dmitry Yemanov (JIRA)
Sorting records are larger than really necessary


 Key: CORE-4353
 URL: http://tracker.firebirdsql.org/browse/CORE-4353
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0 Alpha 2, 3.0 Alpha 1, 2.5.2 Update 1, 2.1.5 Update 1, 
2.5.2, 2.1.5, 2.5.1, 2.1.4, 2.5.0, 2.1.3, 2.1.2, 2.1.1, 2.1.0
Reporter: Dmitry Yemanov
Priority: Minor


In external sorting (SORT plan), every record being sorted is stored as the 
sort key plus all the referenced fields plus stream-level information plus 
padding/alignment. However, the sorting record length is calculated 
inaccurately, causing redundant bytes to be allocated but never used. This 
causes the sort blocks to grow more than necessary thus slowing down the 
operation, especially when number of records being sorted is huge and sort 
blocks are swapped to disk. In most practical cases, this overhead is 
relatively small and is unlikely to be more than 5-10%, but in some artificial 
cases it could be up to 50%.

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



--
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4346) v3 GBAK cannot restore backups on pre-v3 server versions

2014-02-19 Thread Dmitry Yemanov (JIRA)
v3 GBAK cannot restore backups on pre-v3 server versions


 Key: CORE-4346
 URL: http://tracker.firebirdsql.org/browse/CORE-4346
 Project: Firebird Core
  Issue Type: Bug
  Components: GBAK
Affects Versions: 3.0 Alpha 2, 3.0 Alpha 1
Reporter: Dmitry Yemanov


Restore ends with error:

gbak: ERROR:invalid request BLR at offset 201
gbak: ERROR:generator RDB$GENERATOR_NAME is not defined
gbak:Exiting before completion due to errors


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



--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4313) Error "Attempt to reopen an open cursor" may be raised if the query handle is reused in a different transaction

2014-01-05 Thread Dmitry Yemanov (JIRA)
Error "Attempt to reopen an open cursor" may be raised if the query handle is 
reused in a different transaction
---

 Key: CORE-4313
 URL: http://tracker.firebirdsql.org/browse/CORE-4313
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0 Alpha 1, 3.0 Alpha 2
Reporter: Dmitry Yemanov


Call sequence that demonstrates the issue:

isc_dsql_allocate_statement(status, &db, &st);
isc_start_transaction(status, &tr, 1, &db, 0, NULL);
isc_dsql_prepare(status, &tr, &st, 0, "select 1 from rdb$relations", 1, sqlda);

isc_dsql_execute(status, &tr, &st, 1, NULL);
while (isc_dsql_fetch(status, &st, 1, sqlda) == 0);

isc_commit_transaction(status, &tr);
isc_start_transaction(status, &tr, 1, &db, 0, NULL);

isc_dsql_free_statement(status, &st, DSQL_close);

-- here error is raised
isc_dsql_execute(status, &tr, &st, 1, NULL);
while (isc_dsql_fetch(status, &st, 1, sqlda) == 0);

isc_dsql_free_statement(status, &st, DSQL_drop);
isc_commit_transaction(status, &tr);

The issue is caused by the cursor not being explicitly closed before 
transaction commit/rollback. It worked in prior versions, but in v3.0 this 
sequence leads to leftover cursor pointers causing the error to be thrown.

P.S. Given the known details, I'm not sure it's the same issue as CORE-3984.

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



--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4285) Choose the best matching index for navigation

2013-11-27 Thread Dmitry Yemanov (JIRA)
Choose the best matching index for navigation
-

 Key: CORE-4285
 URL: http://tracker.firebirdsql.org/browse/CORE-4285
 Project: Firebird Core
  Issue Type: Improvement
  Components: Engine
Reporter: Dmitry Yemanov


Currently, when ORDER plan is in game, the optimizer chooses the first index 
candidate that matches the ORDER BY / GROUP BY clause. This is not the best 
approach when multiple index choices are available, see examples below.

create table test (col1 int, col2 int, col3 int);
create index itestcol1 on test (col1);
create index itestcol12 on test (col1, col2);
create index itestcol21 on test (col2, col1);
create index itestcol123 on test (col1, col2, col3);
create index itestcol132 on test (col1, col3, col2);
set planonly;

select 1 from test order by col1;
-- expected: PLAN (TEST ORDER ITESTCOL1)

select 1 from test where col1 = 0 order by col1;
-- expected: PLAN (TEST ORDER ITESTCOL1)

select 1 from test order by col1, col2;
-- expected: PLAN (TEST ORDER ITESTCOL12)

select 1 from test where col1 = 0 order by col1, col2;
-- expected: PLAN (TEST ORDER ITESTCOL12)

select 1 from test where col1 = 0 and col2 = 0 order by col1, col2;
-- expected: PLAN (TEST ORDER ITESTCOL12)

select 1 from test  order by col1, col2, col3;
-- expected: PLAN (TEST ORDER ITESTCOL123)

select 1 from test where col1 = 0  order by col1, col2, col3;
-- expected: PLAN (TEST ORDER ITESTCOL123)

select 1 from test where col1 = 0 and col2 = 0 order by col1, col2, col3;
-- expected: PLAN (TEST ORDER ITESTCOL123)

select 1 from test where col1 = 0 and col2 = 0 order by col1;
-- expected: PLAN (TEST ORDER ITESTCOL12)

select 1 from test where col1 = 0 and col2 = 0 and col3 = 0 order by col1;
-- expected: PLAN (TEST ORDER ITESTCOL123) or PLAN (TEST ORDER ITESTCOL132)

select 1 from test where col1 = 0 and col3 = 0 order by col1;
-- expected: PLAN (TEST ORDER ITESTCOL132)

select 1 from test where col1 = 0 and col3 = 0 order by col1, col2;
-- expected: PLAN (TEST ORDER ITESTCOL12)

select 1 from test where col1 = 0 and col3 = 0 order by col1, col2, col3;
-- expected: PLAN (TEST ORDER ITESTCOL123)

select 1 from test where col1 = 0 and col3 = 0 order by col1, col3;
-- expected: PLAN (TEST ORDER ITESTCOL132)


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



--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4268) Server may crash while disconnecting from a database

2013-11-15 Thread Dmitry Yemanov (JIRA)
Server may crash while disconnecting from a database


 Key: CORE-4268
 URL: http://tracker.firebirdsql.org/browse/CORE-4268
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0 Alpha 1, 3.0 Initial
Reporter: Dmitry Yemanov


Races are possible between listener and worker threads when a database is being 
disconnected (op_exit / op_disconnect packets are processed), sometimes causing 
the remote server to crash. So far it was reprodicible in the high load 
scenario only.

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



--
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4267) Server crashes while sweeping the database

2013-11-15 Thread Dmitry Yemanov (JIRA)
Server crashes while sweeping the database
--

 Key: CORE-4267
 URL: http://tracker.firebirdsql.org/browse/CORE-4267
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0 Alpha 1, 2.5.2 Update 1, 2.1.5 Update 1, 2.5.2, 
2.1.5, 2.5.1, 2.1.4, 2.5.0, 3.0 Initial, 2.1.3, 2.1.2, 2.1.1, 2.1.0
Reporter: Dmitry Yemanov


The server process may crash during the sweep under some conditions. They are:

- nobody accessed the problematic tables before the sweep (or sweep is running 
when nobody is connected)
- there are indices based on international string columns
- database schema has complex interdependencies (tables refrencing SPs via 
computed fields and alike)


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



--
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4265) Unexpected lock conflict error may be raised while connecting to a heavily loaded database

2013-11-12 Thread Dmitry Yemanov (JIRA)
Unexpected lock conflict error may be raised while connecting to a heavily 
loaded database
--

 Key: CORE-4265
 URL: http://tracker.firebirdsql.org/browse/CORE-4265
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0 Alpha 1, 2.5.2 Update 1, 2.1.5 Update 1, 2.5.2, 2.1.5
Reporter: Dmitry Yemanov


Under high concurrent load isc_attach_database() may return isc_lock_conflict 
error:

Statement failed, SQLSTATE = 40001
lock conflict on no wait transaction

without any obvious reasons. This happens only when a number of connections are 
being established at the same time.

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



--
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4262) Context parsing error with derived tables and CASE functions

2013-11-11 Thread Dmitry Yemanov (JIRA)
Context parsing error with derived tables and CASE functions


 Key: CORE-4262
 URL: http://tracker.firebirdsql.org/browse/CORE-4262
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0 Alpha 1
Reporter: Dmitry Yemanov


Purely artificial test case that's not expected to demonstrate anything useful, 
just to either compile or not:

  SELECT
CASE WHEN col = 'low' THEN -1
 WHEN col = 'high' THEN 1
END as text
  FROM (
SELECT CASE WHEN EXISTS (SELECT 1 FROM rdb$database WHERE rdb$relation_id = 
r.rdb$relation_id - 1) THEN 'low'
   WHEN EXISTS (SELECT 1 FROM rdb$database WHERE rdb$relation_id = 
r.rdb$relation_id + 1) THEN 'high'
  END as col
FROM rdb$relations as r
  )

Statement failed, SQLSTATE = HY000
invalid request BLR at offset 171
-context already in use (BLR error)

In FB 2.5 there's not such a context parsing problem.

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



--
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4236) Database shutdown is reported as successfully completed before all active connections are in fact interrupted

2013-09-22 Thread Dmitry Yemanov (JIRA)
Database shutdown is reported as successfully completed before all active 
connections are in fact interrupted
-

 Key: CORE-4236
 URL: http://tracker.firebirdsql.org/browse/CORE-4236
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0 Alpha 1
 Environment: SuperServer only
Reporter: Dmitry Yemanov


Database shutdown procedure was reworked in v3 and v2.5.3 to be more 
synchronous than before and really wait until all running activities are 
stopped, their changes are rolled back and all user connections are gone. 
However, this does not work as expected in SuperServer, reporting a successful 
shutdown while other connections may be still modifying the database file. This 
situation is possible under high load.

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



--
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4235) Deadlock is possible while accessing the monitoring tables under concurrent load

2013-09-22 Thread Dmitry Yemanov (JIRA)
Deadlock is possible while accessing the monitoring tables under concurrent load


 Key: CORE-4235
 URL: http://tracker.firebirdsql.org/browse/CORE-4235
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0 Alpha 1
Reporter: Dmitry Yemanov




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



--
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4178) New API should return proper metadata properties, not the historical artifacts

2013-08-11 Thread Dmitry Yemanov (JIRA)
New API should return proper metadata properties, not the historical artifacts
--

 Key: CORE-4178
 URL: http://tracker.firebirdsql.org/browse/CORE-4178
 Project: Firebird Core
  Issue Type: Bug
  Components: API / Client Library
Affects Versions: 3.0 Alpha 1
Reporter: Dmitry Yemanov


Instead of returning implementation details and keeing the old API weirdness, 
let's provide a clear implementation in IMessageMetadata. Now, for SQL_BLOB 
(subtype TEXT), getScale() returns a charset. For SQL_VARYING, getSubType() 
returns a charset, getCharSet() returns zero (accordingly to user reports). 
This makes the interface hardly usable and plays against the long-term success 
of the new API.

The fact that the old API emulation is stacked on top of the new API (thus 
possibly requiring a conversion between proper and legacy property values) 
could be a problem here, but it must be solved.

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



--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4176) Monitoring tables return incomplete information in SC/CS configurations

2013-08-09 Thread Dmitry Yemanov (JIRA)
Monitoring tables return incomplete information in SC/CS configurations
---

 Key: CORE-4176
 URL: http://tracker.firebirdsql.org/browse/CORE-4176
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0 Alpha 1
 Environment: Classic/SuperClassic (SharedDatabase = true)
Reporter: Dmitry Yemanov


When MON$ tables are queried the first time, only information for the current 
connection is returned. If some other connection in turn queries MON$ then it 
gets information for both connections. After that, the first connection also 
gets full information. And so on.

Simplified test case:

isql #1
SQL> connect 'test';
Database:  'test', User: dimitr

isql #2
SQL> connect 'test';
Database:  'test', User: dimitr

isql #1
SQL> select count(*) from mon$attachments;

   COUNT

   1

isql #2
SQL> select count(*) from mon$attachments;

   COUNT

   2

isql #1
SQL> commit;
SQL> select count(*) from mon$attachments;

   COUNT

   2


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



--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4168) Backup containing procedures or triggers that select from external tables cannot be restored with ExternalFileAccess=None

2013-08-06 Thread Dmitry Yemanov (JIRA)
Backup containing procedures or triggers that select from external tables 
cannot be restored with ExternalFileAccess=None
-

 Key: CORE-4168
 URL: http://tracker.firebirdsql.org/browse/CORE-4168
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0 Alpha 1
Reporter: Dmitry Yemanov


Engine Code : 335544831
Engine Message : Access to external file "PLAYERS.EXT" is denied by server 
administrator
Error while parsing procedure IMPORT's BLR


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



--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4165) Replace the hierarchical union execution with the plain one

2013-08-05 Thread Dmitry Yemanov (JIRA)
Replace the hierarchical union execution with the plain one
---

 Key: CORE-4165
 URL: http://tracker.firebirdsql.org/browse/CORE-4165
 Project: Firebird Core
  Issue Type: Improvement
  Components: Engine
Reporter: Dmitry Yemanov


Test case #1:

select 0 i from rdb$database
union all
select 1 from rdb$database
union all
select 2 from rdb$database

Current plan:

Select Expression
-> Union
-> Union
-> Table "RDB$DATABASE" Full Scan
-> Table "RDB$DATABASE" Full Scan
-> Table "RDB$DATABASE" Full Scan

Expected plan:

Select Expression
-> Union
-> Table "RDB$DATABASE" Full Scan
-> Table "RDB$DATABASE" Full Scan
-> Table "RDB$DATABASE" Full Scan

Test case #2:

select 0 i from rdb$database
union
select 1 from rdb$database
union
select 2 from rdb$database

Current plan:

Select Expression
-> Sort
-> Union
-> Sort
-> Union
-> Table "RDB$DATABASE" Full Scan
-> Table "RDB$DATABASE" Full Scan
-> Table "RDB$DATABASE" Full Scan

Expected plan:

Select Expression
-> Sort
-> Union
-> Table "RDB$DATABASE" Full Scan
-> Table "RDB$DATABASE" Full Scan
-> Table "RDB$DATABASE" Full Scan

The latter case is very important as it avoids redundant sorts. However, even 
the former case could benefit from the "plain" execution, as it saves one union 
context thus avoiding redundant record copying.

As a bonus, for the N streams union, we'll have only one context introduced 
instead of N-1 contexts. Of course, mixed type (both ALL and DISTINCT used for 
the streams) unions will behave like before:

select 0 i from rdb$database
union distinct
select 1 from rdb$database
union all
select 2 from rdb$database

Select Expression
-> Union
-> Sort
-> Union
-> Table "RDB$DATABASE" Full Scan
-> Table "RDB$DATABASE" Full Scan
-> Table "RDB$DATABASE" Full Scan


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



--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4164) Owner name is missing for generators/exceptions restored from a backup

2013-08-04 Thread Dmitry Yemanov (JIRA)
Owner name is missing for generators/exceptions restored from a backup
--

 Key: CORE-4164
 URL: http://tracker.firebirdsql.org/browse/CORE-4164
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0 Alpha 1
Reporter: Dmitry Yemanov


Everything is OK for a newly created objects though. As a side effect, this 
issue prevents ISQL from showing the permissions granted to those restored 
objects.

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



--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4159) Incorrect memory statistics is reported

2013-08-04 Thread Dmitry Yemanov (JIRA)
Incorrect memory statistics is reported
---

 Key: CORE-4159
 URL: http://tracker.firebirdsql.org/browse/CORE-4159
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0 Alpha 1
Reporter: Dmitry Yemanov
Priority: Minor


Two issues are observed when looking at the reported memory statistics:

1) Page cache size is not included into the global (database wise) counters
2) OS allocation counters can be around ~4GB

So far I can confirm only the former issue, the latter one is under futher 
investigation.

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



--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4142) Server crashes while preparing a query with DISTINCT and ORDER BY

2013-07-09 Thread Dmitry Yemanov (JIRA)
Server crashes while preparing a query with DISTINCT and ORDER BY
-

 Key: CORE-4142
 URL: http://tracker.firebirdsql.org/browse/CORE-4142
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0 Initial, 3.0 Alpha 1
Reporter: Dmitry Yemanov


Artificial test case:

select distinct rdb$relation_id + 0, rdb$relation_name
from rdb$relations
order by rdb$relation_name


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



--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4139) Error "invalid stream" can be raised in some cases while matching a computed index

2013-07-04 Thread Dmitry Yemanov (JIRA)
Error "invalid stream" can be raised in some cases while matching a computed 
index
--

 Key: CORE-4139
 URL: http://tracker.firebirdsql.org/browse/CORE-4139
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.2 Update 1, 2.1.5 Update 1, 2.5.2, 2.1.5, 2.5.1, 
2.1.4, 2.5.0, 2.1.3, 2.1.2, 2.1.1, 2.1.0
Reporter: Dmitry Yemanov


Test case:

create table A (ID int);
create table B (ID int);
create index IDX on A computed by (ID);

select min( (select 1 from A where cast(ID as int) = B.ID) ) from B
-- ERROR: bad BLR -- invalid stream.

This error is not present if computed index is not created or if CAST is 
omitted inside the query.


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



--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4127) Server crashes instead of reporting the error "key size exceeds implementation restriction"

2013-06-19 Thread Dmitry Yemanov (JIRA)
Server crashes instead of reporting the error "key size exceeds implementation 
restriction"
---

 Key: CORE-4127
 URL: http://tracker.firebirdsql.org/browse/CORE-4127
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.2 Update 1, 2.1.5 Update 1, 2.5.2, 2.1.5, 2.0.7, 
2.5.1, 2.1.4, 2.5.0, 2.0.6, 3.0 Initial, 2.1.3, 2.1.2, 2.0.5, 2.1.1, 2.1.0
Reporter: Dmitry Yemanov


The local buffer of MAX_KEY (4096) bytes overflows thus corrupting the stack 
and causing the engine to crash. Only compound indices are affected.

Test case:

recreate table tab1 (col1 int, col2 char(10));
create index itab1 on tab1 (col1, col2);

select * from tab1 where col1 = 1 and col2 = lpad('a', 5000)


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



--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4118) Expression index may be not used for derived fields or view fields

2013-06-15 Thread Dmitry Yemanov (JIRA)
Expression index may be not used for derived fields or view fields
--

 Key: CORE-4118
 URL: http://tracker.firebirdsql.org/browse/CORE-4118
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.2 Update 1, 2.5.2, 2.5.1, 2.5.0, 3.0 Initial
Reporter: Dmitry Yemanov


Test case:

create table t (id int, d timestamp);
create index itd on t computed (cast(d as date));

select * from t
where cast(d as date) = current_date
-- PLAN (T INDEX (ITD))

select * from (select id, cast(d as date) as d from t)
where d = current_date
-- PLAN (T NATURAL)
-- expected:
-- PLAN (T INDEX (ITD))


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



--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4099) Sub-optimal fuzzy index lookup for empty strings in compound indices

2013-05-06 Thread Dmitry Yemanov (JIRA)
Sub-optimal fuzzy index lookup for empty strings in compound indices


 Key: CORE-4099
 URL: http://tracker.firebirdsql.org/browse/CORE-4099
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.2 Update 1, 2.1.5 Update 1, 2.5.2, 2.1.5, 2.0.7, 
2.5.1, 2.1.4, 2.5.0, 2.0.6, 3.0 Initial, 2.1.3, 2.1.2, 2.0.5, 2.1.1, 2.1.0
Reporter: Dmitry Yemanov
Priority: Minor


recreate table tab (col1 varchar(10), col2 varchar(10));
create index itab on tab (col1, col2);

execute block
as
  declare cnt int = 1000;
begin
  while (cnt > 0) do
  begin
insert into tab (col1, col2) values (:cnt, :cnt);
cnt = cnt - 1;
  end
end;

select * from tab where col1 = '' and col2 starting with trim('');
-- 1000 index reads to found zero rows

TRIM is used just to fool the optimizer so that both index segments were looked 
up, STARTING WITH :PARAM could be used instead. The point here is to use an 
empty string in all conditions (equality for leading segments and STARTING for 
the trailing segment).

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



--
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Reopened: (CORE-2709) Many indexed reads in a compound index with NULLs

2013-05-06 Thread Dmitry Yemanov (JIRA)

 [ 
http://tracker.firebirdsql.org/browse/CORE-2709?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Yemanov reopened CORE-2709:
--

Fix Version/s: (was: 3.0 Alpha 1)

Rolled back from FB3 as well, due to the found regressions. Other solutions are 
being investigated.

> Many indexed reads in a compound index with NULLs
> -
>
> Key: CORE-2709
> URL: http://tracker.firebirdsql.org/browse/CORE-2709
> Project: Firebird Core
>  Issue Type: Bug
>  Components: Engine
>Affects Versions: 2.1.0, 2.0.4, 2.1.1, 2.0.5, 2.1.2, 2.5 Beta 2, 2.1.3, 
> 3.0 Initial, 2.0.6, 2.5.0, 2.1.4
> Environment: Firebird-2.5.0.25731-0_Win32
>Reporter: Alex Bekhtin
>Assignee: Dmitry Yemanov
>
> CREATE TABLE TEST_TABLE (
> ID1  INTEGER,
> ID2  INTEGER,
> ID3  INTEGER
> );
> COMMIT;
> INSERT INTO TEST_TABLE (ID1, ID2, ID3) VALUES (1, 1, NULL);
> INSERT INTO TEST_TABLE (ID1, ID2, ID3) VALUES (1, 2, NULL);
> INSERT INTO TEST_TABLE (ID1, ID2, ID3) VALUES (1, 3, NULL);
> INSERT INTO TEST_TABLE (ID1, ID2, ID3) VALUES (2, 1, NULL);
> INSERT INTO TEST_TABLE (ID1, ID2, ID3) VALUES (2, 2, NULL);
> INSERT INTO TEST_TABLE (ID1, ID2, ID3) VALUES (2, 3, NULL);
> COMMIT;
> CREATE INDEX TEST_TABLE_IDX1 ON TEST_TABLE (ID1, ID2);
> COMMIT;
> select * from test_table where ID1 = 1 and ID2 = 2
> -- one indexed read
> select * from test_table where ID1 = 1 and ID2 IS NULL
> -- zero indexed read
> DROP INDEX TEST_TABLE_IDX1;
> CREATE INDEX TEST_TABLE_IDX1 ON TEST_TABLE (ID1,ID2,ID3);
> select * from test_table where ID1 = 1 and ID2 = 2
> -- one indexed read again
> select * from test_table where ID1 = 1 and ID2 IS NULL
> --   3(!!!) indexed reads 

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



--
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4045) Server crashes during database shutdown

2013-02-11 Thread Dmitry Yemanov (JIRA)
Server crashes during database shutdown
---

 Key: CORE-4045
 URL: http://tracker.firebirdsql.org/browse/CORE-4045
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.2, 2.5.1, 2.5.0
Reporter: Dmitry Yemanov


The problem appears when a parallel helper thread attempts to detach from a 
database after the shutdown thread has decided to release all the database 
locks.

Stack trace:

Jrd::GlobalRWLock::lockRead(Jrd::thread_db * tdbb=0x02cc7450, short 
wait=1, const bool queueJump=true) 
Jrd::Attachment::backupStateReadLock(Jrd::thread_db * tdbb=0x0001402bf831, 
short wait=-8680) 
CCH_fetch_lock(Jrd::thread_db * tdbb=0x020282b0, Jrd::win * 
window=0x02ccde18, unsigned short 
lock_type=62688, short wait=-32096, char page_type='')
CCH_fetch(Jrd::thread_db * tdbb=0x0227b830, Jrd::win * 
window=0x03fcfc10, unsigned short 
lock_type=64528, char page_type='ю', short checksum=1, short latch_wait=1, 
const bool read_shadow=true)
IDX_delete_indices(Jrd::thread_db * tdbb=0x032d0040, Jrd::jrd_rel * 
relation=0x0455f3a0, 
Jrd::RelationPages * relPages=0x03fcf710)
Jrd::jrd_rel::delPages(Jrd::thread_db * tdbb=0x0337ed18, long 
tran=1077321176, Jrd::RelationPages * 
aPages=0x)
TRA_release_transaction(Jrd::thread_db * tdbb=0x03e7, Jrd::jrd_tra 
* 
transaction=0x0337ed18, Jrd::TraceTransactionEnd * 
trace=0x)
purge_transactions(Jrd::thread_db * tdbb=0x02cc7450, Jrd::Attachment * 
attachment=0x02cc7450, 
const bool force_flag=false, const unsigned long att_flags=18)
purge_attachment(Jrd::thread_db * tdbb=0x03fcfc10, Jrd::Attachment * 
attachment=0x02cc7450, 
const bool force_flag=false)
jrd8_detach_database(__int64 * user_status=0x03fcfe10, Jrd::Attachment 
* * handle=0x0061e438)
fb_ping(__int64 * user_status=0x0061e438, unsigned int * 
db_handle=0x0061d550)
`anonymous namespace'::attachmentShutdownThread(void * arg=0x0004)
`anonymous namespace'::threadStart(void * arg=0x)


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

   

--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4038) Broken optimization for the stored dbkeys

2013-01-16 Thread Dmitry Yemanov (JIRA)
Broken optimization for the stored dbkeys
-

 Key: CORE-4038
 URL: http://tracker.firebirdsql.org/browse/CORE-4038
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.2, 2.5.1, 2.5.0
Reporter: Dmitry Yemanov


Test case:

create table t (dbkey char(8) character set octets);
create index it on t (dbkey);

select * from t as t1
  left join t as t2 on t2.dbkey = t1.rdb$db_key

-- expected plan:
PLAN JOIN (T1 NATURAL, T2 INDEX (IT))

-- actual plan:
PLAN JOIN (T1 NATURAL, T2 NATURAL)

This is a regression introduced with CORE-2550 when a separate internal 
datatype was created for dbkeys.

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



--
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612 
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4010) Fetch cannot be subsequently interrupted via DELETE FROM MON$STATEMENTS

2012-12-13 Thread Dmitry Yemanov (JIRA)
Fetch cannot be subsequently interrupted via DELETE FROM MON$STATEMENTS
---

 Key: CORE-4010
 URL: http://tracker.firebirdsql.org/browse/CORE-4010
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.2, 2.1.5, 2.5.1, 2.1.4, 2.5.0, 3.0 Initial, 2.1.3, 
2.1.2, 2.1.1, 2.1.0
Reporter: Dmitry Yemanov
Priority: Minor


If the query is interrupted while fetching from a large cursor and the client 
decides to continue fetching the remaining rows, second and further attempts to 
interrupt this query will fail. Interruption will work again as soon as the 
client will restart this query or start another one.

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



--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4004) Sometimes long-running operations cannot be interrupted by asynchronous shutdown / cancellation requests

2012-12-03 Thread Dmitry Yemanov (JIRA)
Sometimes long-running operations cannot be interrupted by asynchronous 
shutdown / cancellation requests


 Key: CORE-4004
 URL: http://tracker.firebirdsql.org/browse/CORE-4004
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.2, 2.1.5, 2.0.7, 2.5.1, 2.1.4, 2.5.0, 2.0.6, 3.0 
Initial, 2.1.3, 2.1.2, 2.0.5, 2.1.1, 2.1.0
Reporter: Dmitry Yemanov


In fact, this ticket combines a number of different issues with the same 
visible effects. Some of them are inherited from the Borland era, others affect 
only recent Firebird versions (e.g. v2.5.1 and v2.5.2). But it makes a lot of 
sense to address them as a whole.


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



--
Keep yourself connected to Go Parallel: 
BUILD Helping you discover the best ways to construct your parallel projects.
http://goparallel.sourceforge.net
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-3994) Improve the limbo transactions scan at the end of the sweep

2012-11-22 Thread Dmitry Yemanov (JIRA)
Improve the limbo transactions scan at the end of the sweep
---

 Key: CORE-3994
 URL: http://tracker.firebirdsql.org/browse/CORE-3994
 Project: Firebird Core
  Issue Type: Improvement
  Components: Engine
Affects Versions: 2.5.2, 2.1.5, 2.0.7, 2.5.1, 2.1.4, 2.5.0, 2.0.6, 3.0 
Initial, 2.1.3, 2.1.2, 2.0.5, 2.1.1, 2.1.0
Reporter: Dmitry Yemanov
Priority: Minor


After performing a garbage collection pass, the sweep advances the global OIT 
number. But it cannot be advanced further than the oldest known in-limbo 
transaction. In order to find one, the engine scans all the transactions since 
the old OIT. But the used algorithm has a quadratic cost, so it looks like a 
server hang if the transaction gap is big enough. See CORE-3908 for the test 
details.

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



--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-3993) Server crashes while shutting down a database with in-progress attachments

2012-11-21 Thread Dmitry Yemanov (JIRA)
Server crashes while shutting down a database with in-progress attachments
--

 Key: CORE-3993
 URL: http://tracker.firebirdsql.org/browse/CORE-3993
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.2, 2.5.1, 2.5.0
 Environment: The crash is Linux/UNIX specific, but the root of the 
issue is platform independent.
Reporter: Dmitry Yemanov


The shutdown AST is delivered to the database with the already released locks. 
It causes a fatal lock manager error forcing the server process to exit. During 
the cleanup, server crashes with a segfault due to the memory pools being 
already destroyed.

The backtrace:

Thread 1 (Thread 13230):
-- crash specific part
#0  0x004f8c2d in pthread_mutex_lock () from /lib/libpthread.so.0
#1  0x08072155 in enter (this=0x0) at 
../src/remote/../remote/../jrd/../common/classes/locks.h:170
#2  MutexLockGuard (this=0x0) at 
../src/remote/../remote/../jrd/../common/classes/locks.h:246
#3  PortsCleanup::closePorts (this=0x0) at ../src/remote/remote.cpp:782
#4  0x08068617 in cleanup_ports () at ../src/remote/inet.cpp:1805
#5  0x00959a2c in run (timeout=5000, reason=-7) at ../src/jrd/why.cpp:642
#6  fb_shutdown (timeout=5000, reason=-7) at ../src/jrd/why.cpp:5994
#7  0x00959fd6 in (anonymous namespace)::atExitShutdown () at 
../src/jrd/why.cpp:918
#8  0x00cc46fe in Firebird::InstanceControl::destructors () at 
../src/common/classes/init.cpp:157
#9  0x00cc4767 in allClean () at ../src/common/classes/init.cpp:61
#10 ~Cleanup () at ../src/common/classes/init.cpp:89
#11 __tcf_0 () at ../src/common/classes/init.cpp:93
#12 0x003a6059 in __cxa_finalize () from /lib/libc.so.6
#13 0x0093f3d4 in __do_global_dtors_aux () from 
/opt/fb25sc/lib/libfbembed.so.2.5
#14 0x00cd19dc in _fini () from /opt/fb25sc/lib/libfbembed.so.2.5
#15 0x0036a80e in _dl_fini () from /lib/ld-linux.so.2
#16 0x003a5da9 in exit () from /lib/libc.so.6
-- generic part
#17 0x00c2826c in Jrd::LockManager::bug (this=0xb7f86ac4, status_vector=0x0, 
string=0xb039208c "invalid lock id (0)")
#18 0x00c283c9 in Jrd::LockManager::get_request (this=0xb7f86ac4, offset=0) at 
../src/lock/lock.cpp:2224
#19 0x00c2e7b4 in Jrd::LockManager::convert (this=0xb7f86ac4, tdbb=0xb0392264, 
request_offset=0, type=4 '\004', 
#20 0x00ad39e5 in CONVERT (tdbb=0xb0392264, lock=0x529c2890, level=4, wait=1) 
at ../src/jrd/lck.cpp:153
#21 LCK_convert (tdbb=0xb0392264, lock=0x529c2890, level=4, wait=1) at 
../src/jrd/lck.cpp:321
#22 0x00a336b8 in CCH_down_grade_dbb (ast_object=0x529c90d4) at 
../src/jrd/cch.cpp:446
#23 0x00c2c03e in Jrd::LockManager::blocking_action (this=0xb7f86ac4, tdbb=0x0, 
blocking_owner_offset=233240, 
#24 0x00c2d3db in Jrd::LockManager::blocking_action_thread (this=0xb7f86ac4) at 
../src/lock/lock.cpp:1567

Thread 67 (Thread 13232):
#0  0x0064e402 in __kernel_vsyscall ()
#1  0x004fd6e9 in __lll_lock_wait () from /lib/libpthread.so.0
#2  0x004f8dad in _L_lock_981 () from /lib/libpthread.so.0
#3  0x004f8ccb in pthread_mutex_lock () from /lib/libpthread.so.0
#4  0x00c2f03e in enter (this=0xb7f86ac4, tdbb=0xad2e1b9c, 
owner_offset=0x529c9478)
#5  lock (this=0xb7f86ac4, tdbb=0xad2e1b9c, owner_offset=0x529c9478) at 
../src/lock/../jrd/../jrd/Database.h:139
#6  ~Checkout (this=0xb7f86ac4, tdbb=0xad2e1b9c, owner_offset=0x529c9478) at 
../src/lock/../jrd/../jrd/Database.h:240
#7  Jrd::LockManager::shutdownOwner (this=0xb7f86ac4, tdbb=0xad2e1b9c, 
owner_offset=0x529c9478)
#8  0x00ad2930 in LCK_fini (tdbb=0xad2e1b9c, owner_type=LCK_OWNER_database) at 
../src/jrd/lck.cpp:464
#9  0x00aae76b in shutdown_database (dbb=0x529c90d4, release_pools=true) at 
../src/jrd/jrd.cpp:5975
#10 0x00aaf523 in unwindAttach (ex=, 
userStatus=0xad2e2158, tdbb=, 
#11 0x00aba091 in jrd8_attach_database (user_status=, 
filename=0x11ed9c80 "/tmp/idx_test", 


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



--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-3989) Bad performance / slow response when many concurrent sorts are executed

2012-11-20 Thread Dmitry Yemanov (JIRA)
Bad performance / slow response when many concurrent sorts are executed
---

 Key: CORE-3989
 URL: http://tracker.firebirdsql.org/browse/CORE-3989
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.2, 2.1.5, 2.0.7, 2.5.1, 2.1.4, 2.5.0, 2.0.6, 3.0 
Initial, 2.1.3, 2.1.2, 2.0.5, 2.1.1, 2.1.0
 Environment: Reported and debugged on Linux, but generally 
platform-independent
Reporter: Dmitry Yemanov


The issue manifests itself as slow server response under high load when many 
concurrent connections are performing external sorts (i.e. PLAN SORT). 
Backtrace shows that many threads are spending unexpectedly long time in system 
calls mmap/munmap. Besides being a partucular connection's problem, it's also 
blocking the AST delivery thus affecting other connections as well. In Classic 
/ SuperClassic it may result to temporary (up to multiple seconds) server 
freezes.

The problem is that the every sort (regardless of its size) needs 128KB of 
memory for the first level buffer and such big allocations are redirected to 
the operating system. With a high number of relatively small (read: cheap) 
sorts the engine tends to spend more time mapping/unmapping the memory than 
sorting the records.

The proposed solution is to cache a few recently used sort buffers and reuse 
them in subsequent sorts rather than dealing with the system memory manager. 
The field tesing has proved that being an effective measure.

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



--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-3981) Sub-optimal predicate checking while selecting from a view

2012-11-14 Thread Dmitry Yemanov (JIRA)
Sub-optimal predicate checking while selecting from a view
--

 Key: CORE-3981
 URL: http://tracker.firebirdsql.org/browse/CORE-3981
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.2, 2.5.1, 2.5.0
Reporter: Dmitry Yemanov


Test case:

(1) Select from a derived table

select * from (
select r.rdb$relation_name, abs(r.rdb$relation_id) as id
from rdb$relations r natural left join rdb$relation_fields rf
where rdb$relation_id < 128
)
where id = 0

-- 42 reads from RDB$RELATIONS / 4 reads from RDB$RELATION_FIELDS

(2) Select from a view

recreate view v
as
select r.rdb$relation_name, abs(r.rdb$relation_id) as id
from rdb$relations r natural left join rdb$relation_fields rf
where rdb$relation_id < 128;

select * from vvv
where id = 0

-- 42 reads from RDB$RELATIONS / 343 (!) reads from RDB$RELATION_FIELDS


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



--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-3979) Server crashes while unwinding changes in an autonomous transaction

2012-11-12 Thread Dmitry Yemanov (JIRA)
Server crashes while unwinding changes in an autonomous transaction
---

 Key: CORE-3979
 URL: http://tracker.firebirdsql.org/browse/CORE-3979
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.2
Reporter: Dmitry Yemanov


A part of the backtrace:

#1  pop (this=0x2aab64991a48, tdbb=0x2aab0897ea40, request=0x2aab60059bd0)
at 
../src/dsql/../dsql/../dsql/../dsql/../jrd/../jrd/../jrd/../common/classes/stack.h:146
tmp = 
#2  Jrd::InAutonomousTransactionNode::execute (this=0x2aab64991a48, 
tdbb=0x2aab0897ea40, request=0x2aab60059bd0)
at ../src/dsql/StmtNodes.cpp:265
savNumber = 0x2aab6005eb70
transaction = 0x2aab76e4dca8
#3  0x2aca82bdc936 in EXE_looper (tdbb=0x2aab0897ea40, 
request=0x2aab60059bd0, in_node=0x2aab6498fd18) at ../src/jrd/exe.cpp:2798
which_erase_trig = 0
which_sto_trig = 0
which_mod_trig = 0
top_node = 0x0
transaction = 0x2aab76e4dca8
dbb = 0x2aaaf7c9edf8
old_pool = 0x2aaaf80b52c0
context = { = {
savedPool = 0x2aaaf80b52c0}, savedThreadData = 0x2aab0897ea40, 
  savedPool = 0x2aaaf80b52c0}
old_request = 0x0
old_transaction = 0x2aab76e4dca8
save_point_number = 66
node = 0x2aab60059df0
error_pending = true
catch_disabled = true
result = 0x2aab0897ea40
#4  0x2aca82be0ee0 in execute_looper (tdbb=0x2aab0897ea40, 
request=0x2aab60059bd0, transaction=0x2aab76e4dca8, next_state=req_sync)
at ../src/jrd/exe.cpp:1410
dbb = 0x2aaaf7c9edf8

A quick look shows that execute(req_unwind) is called twice for the same node 
and during the second iteration req_auto_trans is already empty, causing a NULL 
pointer dereference failure.

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



--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-3978) Invalid transaction counters may be reported in firebird.log during the sweep

2012-11-12 Thread Dmitry Yemanov (JIRA)
Invalid transaction counters may be reported in firebird.log during the sweep
-

 Key: CORE-3978
 URL: http://tracker.firebirdsql.org/browse/CORE-3978
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.2
 Environment: Linux / MacOS 64-bit only
Reporter: Dmitry Yemanov


Log output example:

reservdb Sun Nov 11 02:26:56 2012
Sweep is started by SYSDBA
Database "idx_test"
OIT 855585, OAT 855586, OST 855586, Next 46909633725807


reservdb Sun Nov 11 02:29:00 2012
Sweep is finished
Database "idx_test"
OIT 855585, OAT 855586, OST 855586, Next 943545


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



--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-3977) DELETE FROM MON$STATEMENTS does not interrupt a longish fetch

2012-11-11 Thread Dmitry Yemanov (JIRA)
DELETE FROM MON$STATEMENTS does not interrupt a longish fetch
-

 Key: CORE-3977
 URL: http://tracker.firebirdsql.org/browse/CORE-3977
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.2, 2.5.1, 2.5.0
Reporter: Dmitry Yemanov


If the client application is fetching a large result set, this operation cannot 
be interrupted via deleting from MON$STATEMENTS until EOF is reached. Deletion 
from MON$ATTACHMENTS does interrupt it immediately though.

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



--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-3924) Bugcheck 291 (cannot find record back version) if GTT is modified concurrently using at least one read-committed read-only transaction

2012-09-11 Thread Dmitry Yemanov (JIRA)
Bugcheck 291 (cannot find record back version) if GTT is modified concurrently 
using at least one read-committed read-only transaction
--

 Key: CORE-3924
 URL: http://tracker.firebirdsql.org/browse/CORE-3924
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.1, 3.0 Initial, 2.5.2
Reporter: Dmitry Yemanov


It cannot be reproduced in ISQL as it requires two transactions per connection. 
Obviously, only connection-level GTTs (ON COMMIT PRESERVE ROWS) are affected.

create table t (col int) on commit preserve rows;
insert into t (col) values (0);
commit;

-- txn1 (read committed, read only):
update t set col = 1;
-- no commit here

- txn2 (snapshot):
delete from t;
-- BUGCHECK 291: cannot find record back version

An update conflict error is expected instead.

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



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-3881) Extend the error reported for index/constraint violations to include the offending key value

2012-06-28 Thread Dmitry Yemanov (JIRA)
Extend the error reported for index/constraint violations to include the 
offending key value


 Key: CORE-3881
 URL: http://tracker.firebirdsql.org/browse/CORE-3881
 Project: Firebird Core
  Issue Type: Improvement
  Components: Engine
Reporter: Dmitry Yemanov


Report the failed key in the textual form, so that the user would know what 
exactly field value / record has caused the error. Original column names could 
be reported as well (useful for compound indices).

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



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-3873) Server crashes while switching to the shadow if the disk I/O fault happens while flushing the cache during the engine shutdown

2012-06-20 Thread Dmitry Yemanov (JIRA)
Server crashes while switching to the shadow if the disk I/O fault happens 
while flushing the cache during the engine shutdown
--

 Key: CORE-3873
 URL: http://tracker.firebirdsql.org/browse/CORE-3873
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.1, 2.5.0, 3.0 Initial
Reporter: Dmitry Yemanov


There is no active attachment at this moment, but some code parts attempt to 
access the NULL pointer regardless.

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



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-3817) Forced database shutdown does not work if non-zero delay was specified

2012-04-14 Thread Dmitry Yemanov (JIRA)
Forced database shutdown does not work if non-zero delay was specified
--

 Key: CORE-3817
 URL: http://tracker.firebirdsql.org/browse/CORE-3817
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.0.7, 2.5.1, 2.1.4, 2.5.0, 2.0.6, 3.0 Initial, 2.1.3, 
2.1.2, 2.0.5, 2.1.1, 2.1.0
 Environment: Classic and SuperClassic only
Reporter: Dmitry Yemanov


There are two visible issues:

1) Any kind of shutdown attempt does not shut the active connections down
2) While they're connected nobody else (including SYSDBA) can connect even if 
the multi-user shutdown was requested

Everything works as expected with zero timeout interval (-force 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



--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-3814) SuperClassic server crashes when performing a database shutdown (FW=OFF)

2012-04-13 Thread Dmitry Yemanov (JIRA)
SuperClassic server crashes when performing a database shutdown (FW=OFF)


 Key: CORE-3814
 URL: http://tracker.firebirdsql.org/browse/CORE-3814
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.1
 Environment: With default config settings only Windows builds are 
affected. Forced writes must be disabled.
Reporter: Dmitry Yemanov


Can be easily reproduced with SuperClassic. Other architectures are either not 
affected or harder to reproduce.

Introduced with CORE-3521, so the only affected official version is v2.5.1.
It looks like a bad idea to acquire the backup state lock after it has been 
destroyed.

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



--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Reopened: (CORE-3557) AV in engine when preparing query against dropping table

2012-04-12 Thread Dmitry Yemanov (JIRA)

 [ 
http://tracker.firebirdsql.org/browse/CORE-3557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Yemanov reopened CORE-3557:
--


A new regression is found because of this change. Simple test case:

create  view v as
select t4.rdb$relation_name
from rdb$relations t1, rdb$relations t2, rdb$relations t3, rdb$relations t4;

-- reconnect

alter view v as
select 0 as rdb$relation_name from rdb$database;

-- no commit here

drop view v;

-- the engine crashes

When MET_scan_relation() is called during DROP, we have the new field list and 
view BLR out of sync with the RDB$RUNTIME which is modified at the commit time 
only and thus preserving the original structure.

> AV in engine when preparing query against dropping table
> 
>
> Key: CORE-3557
> URL: http://tracker.firebirdsql.org/browse/CORE-3557
> Project: Firebird Core
>  Issue Type: Bug
>  Components: Engine
>Affects Versions: 2.1.0, 2.0.4, 2.1.1, 2.0.5, 2.1.2, 2.1.3, 2.0.6, 2.5.0, 
> 2.1.4
>Reporter: Vlad Khorsun
>Assignee: Vlad Khorsun
> Fix For: 2.0.7, 2.1.5, 2.5.2, 3.0 Alpha 1
>
>


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



--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-3807) Error "Invalid expression in the select list" can be unexpectedly raised if a string literal is used inside a GROUP BY clause in a multi-byte connect

2012-04-04 Thread Dmitry Yemanov (JIRA)
Error "Invalid expression in the select list" can be unexpectedly raised if a 
string literal is used inside a GROUP BY clause in a multi-byte connection


 Key: CORE-3807
 URL: http://tracker.firebirdsql.org/browse/CORE-3807
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.1, 2.1.4, 2.5.0, 3.0 Initial, 2.1.3, 2.1.2, 2.1.1, 
2.1.0
Reporter: Dmitry Yemanov


Simplified test case (to be executed with connection charset = UTF-8):

select
'Current time is ' || cast(a.t as varchar(10))
from
(select current_time t from rdb$database) a
group by
'Current time is ' || cast(a.t as varchar(10))

-- ERROR:
-- Invalid expression in the select list (not contained in either an aggregate 
function or the GROUP BY clause)


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



--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


  1   2   >