[Firebird-devel] [FB-Tracker] Created: (CORE-4737) Ignore additional useless parameters at execute statement

2015-04-04 Thread JIRA
Ignore additional useless parameters at execute statement
-

 Key: CORE-4737
 URL: http://tracker.firebirdsql.org/browse/CORE-4737
 Project: Firebird Core
  Issue Type: Improvement
Reporter: Omacht András
Priority: Minor


It would be easier to create and mantain dynamic (build up with changing 
parameters) execute statements if the engine ignores the actually useless 
paramteres.

Example:
select * from people_by_gender_and_age('F', 16, 30)-- works fine

select * from people_by_gender_and_age(null, 16, 30)   -- dies with error: 
"input parameter mismatch' - also this should work too

Business logic:
CREATE TABLE PEOPLE (
GENDER  VARCHAR(1) NOT NULL,
AGE INTEGER NOT NULL
);
commit;


INSERT INTO PEOPLE (GENDER, AGE) VALUES ('F', 15);
INSERT INTO PEOPLE (GENDER, AGE) VALUES ('F', 20);
INSERT INTO PEOPLE (GENDER, AGE) VALUES ('M', 17);
INSERT INTO PEOPLE (GENDER, AGE) VALUES ('M', 19);
commit;


create or alter procedure people_by_gender_and_age (
filter_gender type of column people.gender,
filter_min_age type of column people.age,
filter_max_age type of column people.age)
returns (gender type of column people.gender,
age type of column people.age)
as
begin
  filter_min_age = coalesce(filter_min_age, 0);
  filter_max_age = coalesce(filter_max_age, 200);
  for execute statement
('select gender, age
from people
where age between :filter_min_age and :filter_max_age ' ||
-- Here is the dynamic part
iif(:filter_gender in ('F', 'M'), ' and gender = :filter_gender', ''))
(filter_gender := :filter_gender,  -- sometimes this parameter is 
useless depends on the dynamic part
 filter_min_age := :filter_min_age,
 filter_max_age := :filter_max_age)
  into :gender,
   :age do
begin
  suspend;
end
end



Thanks!


-- 
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-4736) Ignore additional useless parameters at execute statement

2015-04-04 Thread JIRA
Ignore additional useless parameters at execute statement
-

 Key: CORE-4736
 URL: http://tracker.firebirdsql.org/browse/CORE-4736
 Project: Firebird Core
  Issue Type: Improvement
Reporter: Omacht András
Priority: Minor


It would be easier to create and mantain dynamic (build up with changing 
parameters) execute statements if the engine ignores the actually useless 
paramteres.

Example:
select * from people_by_gender_and_age('F', 16, 30)-- works fine

select * from people_by_gender_and_age(null, 16, 30)   -- dies with error: 
"input parameter mismatch' - also this should work too

Business logic:
CREATE TABLE PEOPLE (
GENDER  VARCHAR(1) NOT NULL,
AGE INTEGER NOT NULL
);
commit;


INSERT INTO PEOPLE (GENDER, AGE) VALUES ('F', 15);
INSERT INTO PEOPLE (GENDER, AGE) VALUES ('F', 20);
INSERT INTO PEOPLE (GENDER, AGE) VALUES ('M', 17);
INSERT INTO PEOPLE (GENDER, AGE) VALUES ('M', 19);
commit;


create or alter procedure people_by_gender_and_age (
filter_gender type of column people.gender,
filter_min_age type of column people.age,
filter_max_age type of column people.age)
returns (gender type of column people.gender,
age type of column people.age)
as
begin
  filter_min_age = coalesce(filter_min_age, 0);
  filter_max_age = coalesce(filter_max_age, 200);
  for execute statement
('select gender, age
from people
where age between :filter_min_age and :filter_max_age ' ||
-- Here is the dynamic part
iif(:filter_gender in ('F', 'M'), ' and gender = :filter_gender', ''))
(filter_gender := :filter_gender,  -- sometimes this parameter is 
useless depends on the dynamic part
 filter_min_age := :filter_min_age,
 filter_max_age := :filter_max_age)
  into :gender,
   :age do
begin
  suspend;
end
end



Thanks!


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


Re: [Firebird-devel] Events in Firebird 3 client library

2015-04-04 Thread Michal Kubecek
On Sat, Apr 04, 2015 at 06:39:06PM +0200, Mark Rotteveel wrote:
> What is the current status of events in the Firebird 3 client library? 
> Are there known problems?

While testing the IPv6 implementation, I also tested events (as there
were some changes to aux connection handling). I repeated the test about
a week ago while testing the cleanup of SockAddr.h. Neither time I saw
any problem but my test was really trivial: a simple C program watching
two events and isql session triggering them using a stored procedure.
I'm not sure if I also tested events with FB 2.5 on one side and FB 3.0
on the other.

 Michal Kubecek


--
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] Events in Firebird 3 client library

2015-04-04 Thread Mark Rotteveel
What is the current status of events in the Firebird 3 client library? 
Are there known problems?

I am currently reimplementing events in Jaybird, and when I talk to a 
Firebird 2.5.4 fbclient.dll it works ok, but when I talk to a Firebird 
3.0.0.31733 fbclient.dll (snapshot from last week), it fails with an 
"Unrecognized events block" (error code:335544973, isc_bad_epb_form) 
when calling isc_que_events, the application exits with error code 
-1073741819 (0xC005).

In both cases I talk to the same server (3.0.0.31733).

The interesting thing is that if I remove or add(!) certain debug 
statements (which print out the content of the event block) then 
suddenly it works OK again. This seems to indicate there is some kind of 
timing or thread interference problem.

The dumps of the memory blocks do seem to indicate that the event block 
sometimes get zeroed out.

Has something changed in the parallelism of the client library, or the 
cleanup/release of event blocks?

Mark
-- 
Mark Rotteveel

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


Re: [Firebird-devel] Semantics of field [NOT] NULL flag based on domains

2015-04-04 Thread Leyne, Sean

> What percent of our users cares about auto-generated domains?

Percent?  Too small to measure (less than 20 people in the world!)


Sean


--
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-4735) Expression 'where bool_field IS true | false' should also use index as 'where bool_field = true | false' (if such index exists)

2015-04-04 Thread Pavel Zotov (JIRA)
Expression 'where bool_field IS true | false' should also use index as 'where 
bool_field = true | false' (if such index exists)
---

 Key: CORE-4735
 URL: http://tracker.firebirdsql.org/browse/CORE-4735
 Project: Firebird Core
  Issue Type: Improvement
Reporter: Pavel Zotov
Priority: Minor


SQL> recreate table t(boo boolean);
SQL> commit;
SQL> create index t_boo on t(boo);
SQL> commit;

SQL> set plan on;

SQL> select * from t where boo is null;
PLAN (T INDEX (T_BOO))

SQL> select * from t where boo is not distinct from true;
PLAN (T INDEX (T_BOO))

SQL> select * from t where boo = true;
PLAN (T INDEX (T_BOO))

SQL> select * from t where boo IS true;
PLAN (T NATURAL)

It will be useful if optimizer will also use index in the last expression 
because for boolean values one may easy to get mistake by typing 'x IS true' 
instead of 'x = true' -- simply because first case  "sounds" more natively in 
english language when such expression is pronounced.

-- 
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] LocalStatus - check or throw

2015-04-04 Thread Dimitry Sibiryakov
   Hello, All.

   I have two question about latest changes in interfaces:

1) In pluginmanager.cpp::findDefConfig() the only thing that is done with 
status vector is 
call of check() that throw. Why ThrowStatusWrapper isn't used there?
2) Why wrapper is needed at all instead of declaring LocalStatus to be always a 
throw-type 
status?

-- 
   WBR, SD.

--
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-4734) Select on empty database generate: internal Firebird consistency check (cannot find tip page (165), file: tra.cpp line: 2369

2015-04-04 Thread Carl-Johan Wik (JIRA)
Select on empty database generate: internal Firebird consistency check (cannot 
find tip page (165), file: tra.cpp line: 2369


 Key: CORE-4734
 URL: http://tracker.firebirdsql.org/browse/CORE-4734
 Project: Firebird Core
  Issue Type: Bug
Affects Versions: 2.5.4
 Environment: Visual Studio 2013, Windows 8.1, Firebird 2.5.4 and 
Firebird ADO.NET Data provider. 4.5.0.0
Reporter: Carl-Johan Wik
Priority: Blocker


Hi

Below you will find the code for the connection information object that the 
test program.

This done in Visual Studio 2013, Windows 8.1, Firebird 2.5.4 and Firebird 
ADO.NET Data provider. 4.5.0.0

The thing I find is that if the database is empty and I do select, then it goes 
into a failed state that I cannot resolve and have to recreate the database.

Procedure to reproduce:
Run the program, the program will pass con.Open and throw exception on the 
cmd.ExecuteScalar and the exception says table unknown. I.e. an expected 
exception.
Re-run the program, now the con.Open will throw an exception with the 
information:  internal Firebird consistency check (cannot find tip page (165), 
file: tra.cpp line: 2369
If I try to re-run the program again the same exception happen on the con.Open 
statement. I cannot get pass this and have to recreate the database. I.e. the 
database in failed state.

New test run.
I run the program but this time execute the create table statement. No 
exception.
Re-run the program but with the select statement on a table that do not exist. 
Program will pass con.Open and throw exception on the cmd.ExecuteScalar and the 
exception says table unknown. I.e. an expected exception.
I can now re-run the program several times and the con.Open will always work 
and I get the expected exception of table unknown.

It seems that if I do a Select on at table on an empty database then this error 
happen, otherwise not.

Was not sure to report this as blocker, but it is a blocker for me as I cannot 
use Firebird with such a error in a production environment.

*
class ConnectionInformation
{
public ConnectionInformation()
{
this.User = "SYSDBA";
this.Password = "masterkey";
this.ServerType = FbServerType.Embedded;
this.DatabaseFileName = "TaragonTrader.fdb";
this.CharacterSet = "UTF8";
this.ClientLibraryPath = @"fbembed.dll";
this.Dialect = 3;


class Program
{
static void Main(string[] args)
{

var connectionInformation = new ConnectionInformation();

if (File.Exists(connectionInformation.DatabaseFileName) == false)

FbConnection.CreateDatabase(connectionInformation.ConnectionString);

var con = new FbConnection(connectionInformation.ConnectionString);
try
{
con.Open();
}
catch (Exception ex)
{
throw ex;
}

//string sqlStatement = @"CREATE TABLE QuoteDataProvider (" +
//"Id INT Not Null Primary Key, " +
//"MyCol1 VarChar(15), " +
//"MyCol2 VarChar(80) " +
//")";


string sqlStatement = "Select Count(*) From QuoteDataProvider2";

FbCommand cmd = new FbCommand();
cmd.CommandText = sqlStatement;
cmd.Connection = con;

try
{
var e = cmd.ExecuteScalar();
}
catch (Exception ex)
{
//this.Close();
throw ex;
} 

}
}


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