[Firebird-devel] [FB-Tracker] Created: (CORE-5079) Maximal length of user attribute (first-, middle- and lastname) can not exceed 32 OCTETS (rather than CHARACTERS) on FB-3, 31 octets on FB 2.5

2016-01-21 Thread Pavel Zotov (JIRA)
Maximal length of user attribute (first-, middle- and lastname) can not exceed 
32 OCTETS (rather than CHARACTERS) on FB-3, 31 octets on FB 2.5
--

 Key: CORE-5079
 URL: http://tracker.firebirdsql.org/browse/CORE-5079
 Project: Firebird Core
  Issue Type: Bug
  Components: Charsets/Collation, Engine, Security
Affects Versions: 2.5.5, 3.0 RC1
Reporter: Pavel Zotov


Consider following script:

shell del C:\MIX\firebird\QA\fbt-repo\c0856.fdb 2>nul;
set names utf8;
create database 'localhost/:C:\MIX\firebird\QA\fbt-repo\c0856.fdb' user 
'SYSDBA' password 'masterke';
-- show table sec$users;
commit;

set echo on;
create or alter user tmp$c0856 password '123' 
firstname ':1:2:3è' -- octet_length = 32
;

create or alter user tmp$c0856 password '123' 
firstname ':1:2:3∑'-- octet_length = 33
;


create or alter user tmp$c0856 password '123' 
firstname ':1:2:3.è' -- octet_length = 33
;


Its running will issue:

1) on  WI-V2.5.6.26963:
===
Statement failed, SQLSTATE = 22001
arithmetic exception, numeric overflow, or string truncation
-string right truncation
-unknown ISC error 335545033
After line 3 in file c0856.sql
Command error: show table sec$users
create or alter user tmp$c0856 password '123' 
firstname ':1:2:3è' -- octet_length = 32
;

create or alter user tmp$c0856 password '123' 
firstname ':1:2:3∑'-- octet_length = 33
;
Statement failed, SQLSTATE = HY000
modify record error

create or alter user tmp$c0856 password '123' 
firstname ':1:2:3.è' -- octet_length = 33
;
Statement failed, SQLSTATE = HY000
modify record error
===

2) on WI-V3.0.0.32281:
===
create or alter user tmp$c0856 password '123' 
firstname ':1:2:3è' -- octet_length = 32
;

create or alter user tmp$c0856 password '123' 
firstname ':1:2:3∑'-- octet_length = 33
;
Statement failed, SQLSTATE = HY000
modify record error

create or alter user tmp$c0856 password '123' 
firstname ':1:2:3.è' -- octet_length = 33
;
Statement failed, SQLSTATE = HY000
modify record error
===

But:

1) on 2.5:
SQL> show table rdb$users;

RDB$USER_NAME   (RDB$USER_NAME) VARCHAR(128) CHARACTER SET 
UNICODE_FSS Not Null
. . .
RDB$FIRST_NAME  (RDB$NAME_PART) VARCHAR(32) CHARACTER SET 
UNICODE_FSS Nullable DEFAULT _UNICODE_FSS ''
RDB$MIDDLE_NAME (RDB$NAME_PART) VARCHAR(32) CHARACTER SET 
UNICODE_FSS Nullable DEFAULT _UNICODE_FSS ''
RDB$LAST_NAME   (RDB$NAME_PART) VARCHAR(32) CHARACTER SET 
UNICODE_FSS Nullable DEFAULT _UNICODE_FSS ''
. . .

2) on 3.0:

SQL> show table sec$users;

SEC$USER_NAME   (RDB$USER) CHAR(31) CHARACTER SET UNICODE_FSS 
Nullable 
SEC$FIRST_NAME  (SEC$NAME_PART) VARCHAR(32) CHARACTER SET 
UNICODE_FSS Nullable 
SEC$MIDDLE_NAME (SEC$NAME_PART) VARCHAR(32) CHARACTER SET 
UNICODE_FSS Nullable 
SEC$LAST_NAME   (SEC$NAME_PART) VARCHAR(32) CHARACTER SET 
UNICODE_FSS Nullable 
. . .


PS. As reference. 
Each of following characters requires:

1) čřžéèêάëïüäöüêŝçęđøłŲĖŪґůőűčž--  two bytes for symbol;

2) ∑∫≈-- three bytes for symbol.


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


Re: [Firebird-devel] ODP: Re: fb3 connections limit

2016-01-21 Thread Dimitry Sibiryakov
21.01.2016 16:45, Mark Rotteveel wrote:
> That doesn't really answer the why :)

   Firebird uses only one thread for receiving network packets and the limit is 
related to 
select()/WSASelect() function that operate with fixed size array of socket 
handles.

-- 
   WBR, SD.

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


Re: [Firebird-devel] ODP: Re: fb3 connections limit

2016-01-21 Thread Dmitry Kuzmenko
Hello!

Thursday, January 21, 2016, 6:06:06 PM, you wrote:

l> may i ask what is the reason of that limit on windows?

that type of interest is suspicious. Currently, huge companies works
in client-server mode with 500-700 simultaneous connections, without
any problem.
When someone asks about 2000 connections, seems that he need
connection pooling and 3-tier architecture, rather than
client-server.
Because, for example, maybe 10 years ago Linux had limit of 600
connections, and to increase it, you needed to recomplire the core.

So, question like that is not normal. As it was said, Firebird have
limits close to OS limits, or depends on OS limits. Well, then, what
else do you need? Want 3000 connections at Windows? Ask Microsoft
about that.

But anyway, even ~1000 client-server connections are VERY huge number,
that needs special hardware infrastructure to implement that. So, this
is not only about "firebird limits".

-- 
Dmitry Kuzmenko, www.ibase.ru


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


Re: [Firebird-devel] ODP: Re: fb3 connections limit

2016-01-21 Thread liviuslivius
> That doesn't really answer the why :)

>>It does if you google FD_SETSIZE and winsock
>>https://msdn.microsoft.com/en-us/library/windows/desktop/ms739169%28v=vs.85%29.aspx

>>Paul

Hi,

i read this but i still do not know the reason. Is this declared by Firebird 
in code.
Because i read in this article that there is no limit in Winsock at all.
Only constant FD_SETSIZE at compilation time which can by changed in code.
But maybe i can understand this incorrectly


regards,
Karol Bieniaszewski





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


Re: [Firebird-devel] ODP: Re: fb3 connections limit

2016-01-21 Thread Dimitry Sibiryakov
21.01.2016 18:20, Leyne, Sean wrote:
> Operationally, your app will die/fail which you try to exceed the Windows 
> FD_Size value -- it is a OS level limit.

   Nope, it is truly set at compile time and only application-defined 
structures are used 
by OS.
   Problem is not a size of structure itself, but very ineffective methods to 
find out 
which socket is signaled after select() has returned.
   I wonder if someone tried to use bit-scanning instructions of modern x86 
processors to 
solve the problem...

-- 
   WBR, SD.

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


Re: [Firebird-devel] ODP: Re: fb3 connections limit

2016-01-21 Thread Jim Starkey
On 1/21/2016 12:41 PM, Dimitry Sibiryakov wrote:
> 21.01.2016 18:20, Leyne, Sean wrote:
>> Operationally, your app will die/fail which you try to exceed the Windows 
>> FD_Size value -- it is a OS level limit.
> Nope, it is truly set at compile time and only application-defined 
> structures are used
> by OS.
> Problem is not a size of structure itself, but very ineffective methods 
> to find out
> which socket is signaled after select() has returned.
> I wonder if someone tried to use bit-scanning instructions of modern x86 
> processors to
> solve the problem...
>

Microsoft is now supporting the Linux poll() as WSAPoll().  Much more 
intelligent data structures and is smart enough to wake up when the 
remote end of a socket is closed.  I don't know what platforms do or 
don't support poll(), so select() would have to be conditional, but 
poll() beats the pants off select().

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


Re: [Firebird-devel] ODP: Re: fb3 connections limit

2016-01-21 Thread Leyne, Sean

> Microsoft is now supporting the Linux poll() as WSAPoll().  Much more
> intelligent data structures and is smart enough to wake up when the remote
> end of a socket is closed.  I don't know what platforms do or don't support
> poll()

Client OS == Windows Vista+
Server OS == Windows 2008+


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


Re: [Firebird-devel] ODP: Re: fb3 connections limit

2016-01-21 Thread Paul Beach
>> may i ask what is the reason of that limit on windows?
> 
> http://tracker.firebirdsql.org/browse/CORE-4439

> That doesn't really answer the why :)

It does if you google FD_SETSIZE and winsock
https://msdn.microsoft.com/en-us/library/windows/desktop/ms739169%28v=vs.85%29.aspx

Paul

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


Re: [Firebird-devel] ODP: Re: fb3 connections limit

2016-01-21 Thread Leyne, Sean


> i read this but i still do not know the reason. Is this declared by Firebird 
> in code.
> Because i read in this article that there is no limit in Winsock at all.
> Only constant FD_SETSIZE at compilation time which can by changed in code.
> But maybe i can understand this incorrectly

Technically, yes, you can change the size at compilation.

Operationally, your app will die/fail which you try to exceed the Windows 
FD_Size value -- it is a OS level limit.

That fact that it is exposed as a constant is a matter of convenience, as it 
allows a developer to program knowing that a limit exist and has to be managed, 
without hard coding the limit.


Sean


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


Re: [Firebird-devel] ODP: Re: fb3 connections limit

2016-01-21 Thread liviuslivius
Hi,

..
>>But anyway, even ~1000 client-server connections are VERY huge number,
>>that needs special hardware infrastructure to implement that. So, this
>>is not only about "firebird limits".

i have now near 400 connections and do not see any problems with resources 
or server response.
But i really care about query plans and optimizations - may be this is the 
reason.
Within a year I expect a tripling of the number of connections (fixed not 
pooled)
And this is the reason of question. I see that i still not reach limit 
2048 - then i still have reserves.


regards,
Karol Bieniaszewski

-Oryginalna wiadomość- 
From: Dmitry Kuzmenko
Sent: Thursday, January 21, 2016 4:56 PM
To: For discussion among Firebird Developers
Subject: Re: [Firebird-devel] ODP: Re: fb3 connections limit

Hello!

Thursday, January 21, 2016, 6:06:06 PM, you wrote:

l> may i ask what is the reason of that limit on windows?

that type of interest is suspicious. Currently, huge companies works
in client-server mode with 500-700 simultaneous connections, without
any problem.
When someone asks about 2000 connections, seems that he need
connection pooling and 3-tier architecture, rather than
client-server.
Because, for example, maybe 10 years ago Linux had limit of 600
connections, and to increase it, you needed to recomplire the core.

So, question like that is not normal. As it was said, Firebird have
limits close to OS limits, or depends on OS limits. Well, then, what
else do you need? Want 3000 connections at Windows? Ask Microsoft
about that.

But anyway, even ~1000 client-server connections are VERY huge number,
that needs special hardware infrastructure to implement that. So, this
is not only about "firebird limits".

-- 
Dmitry Kuzmenko, www.ibase.ru


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


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


Re: [Firebird-devel] ODP: Re: fb3 connections limit

2016-01-21 Thread Michal Kubecek
On Thu, Jan 21, 2016 at 01:20:02PM -0500, Jim Starkey wrote:
> On 1/21/2016 12:41 PM, Dimitry Sibiryakov wrote:
> > 21.01.2016 18:20, Leyne, Sean wrote:
> >> Operationally, your app will die/fail which you try to exceed the
> >> Windows FD_Size value -- it is a OS level limit.
> > Nope, it is truly set at compile time and only application-defined
> > structures are used by OS.  Problem is not a size of structure
> > itself, but very ineffective methods to find out which socket is
> > signaled after select() has returned.  I wonder if someone tried to
> > use bit-scanning instructions of modern x86 processors to solve the
> > problem...
> 
> Microsoft is now supporting the Linux poll() as WSAPoll().  Much more 
> intelligent data structures and is smart enough to wake up when the 
> remote end of a socket is closed.  I don't know what platforms do or 
> don't support poll(), so select() would have to be conditional, but 
> poll() beats the pants off select().

For really large sets of sockets, epoll() would be even better. IIRC the
FB3 code uses poll() if available, select() otherwise. On Windows,
select() is used always.

Anyway, IIRC we only use poll() or select() for connections belonging to
one client so that technical limitations of that syscall should not
matter for the client connections limit.

  Michal Kubecek


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


[Firebird-devel] [FB-Tracker] Created: (CORE-5080) Config parameter 'DeadlockTimeout ': mystic affect of its PARITY / ODDNESS on DDL results

2016-01-21 Thread Pavel Zotov (JIRA)
Config parameter 'DeadlockTimeout ': mystic affect of  its PARITY / ODDNESS on 
DDL results
--

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


Found for current snapshots of 2.5.6 and 3.0, all arch (SS/SC/CS).

Create this script:
===
set term ^;
execute block as
begin
execute statement 'drop sequence g';
when any do begin end
end
^
-- commit -- [ 1 ]
^
create sequence g
^
-- commit -- [ 2 ]
^

create or alter procedure sp_get_remote_data returns(received_value int) as
begin
  for 
  execute statement ('execute block returns(curr_gen int) as begin curr_gen 
= gen_id(g,1); suspend; end')
  on external rdb$get_context('SYSTEM','DB_NAME')
  as user 'SYSDBA' password 'masterkey' role 'R_' || right( 
uuid_to_char(gen_uuid()),12 )
  into received_value
  do
  suspend;
end
^
commit
^
set term ;^

set list on;

select g.*, gen_id(g,0) as gen_current_value 
from rdb$generators g
where g.rdb$generator_name = upper('g');
===

Then open firebird.conf and set DeadlockTimeout to any ODD value (7,9,11,... - 
whatever, up to 32767).

Running this script will result (show for 2.5 only; on 3.0 we'll have more info 
but outcome is the same):

RDB$GENERATOR_NAME  G
RDB$GENERATOR_ID35
RDB$SYSTEM_FLAG 0
RDB$DESCRIPTION 
GEN_CURRENT_VALUE   0

Then change DeadlockTimeout  to EVEN value (2,4,6, ...) and run script again 
(NOTE: restart of server can be skipped, its no matter here).
Result will be:

Statement failed, SQLSTATE = 40001
deadlock
-deadlock
-concurrent transaction number is 329

Statement failed, SQLSTATE = 42000
invalid request BLR at offset 75
-generator G is not defined


Also, not on lines marked as [ 1 ] and [ 2 ]. When comments from these COMMIT 
statements are removed, all work fine.
PS. Checked on:

WI-V2.5.6.26963
WI-V3.0.0.32281

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