Re: [Firebird-net-provider] Bug in FbConnection.GetSchema("Columns")
André Knappstein wrote: > I am a bit worried, in any case, that you would expect different > results for the 2 cases, because in both cases the column literally > "is not nullable". > > Maybe what you want and need is a (new?) property "NOT_NULL_SET" which > could result to false for the column while "is_nullable" still _CAN_ > return false because of the underlying domain. I think the problem here is all the double-negatives :-) So let's get this straight... A column is nullable by default, so if you don't specify anything at all, "is_nullable" should be 1. HOWEVER, if you specify "NOT NULL" on *either* the domain *or* the column, is_nullable should be 0. I hope we can all agree on that, at least... Now, whether that is actually the case, is something that I think we need to test. But I don't have a test environment on which I can test this right now :-) Dean. - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Re: [Firebird-net-provider] Bug in FbConnection.GetSchema("Columns")
Jürgen, reading this I am quite glad that I have not needed this property in .net provider so far, because I admit it would exceed my comprehension of FB internals. Just in case I need it in future, I would like to get an additional clarification: Looking at a column which is not nullable because you set "NOT NULL" to the column, you would EXPECT the property "is_nullable" to be true, where "true" is represented by the numeric value 1. I would NOT, because literally the column is not nullable, and so I would not want to have this situation concluded as "column is nullable". Instead I would either expect that the result is 0 where 0 means "false" or 1 where 1 means "false" (because the NOT-NULL flag in the system table is set to 1 as Helen described...) Looking at a column which is not nullable because you (only) set it's domain to a domain for which you set "NOT NULL", not touching the NOT NULL constraint of the column itself, you would EXPECT the property "is_nullable" false. I also would, because the column is indeed not nullable. I am a bit worried, in any case, that you would expect different results for the 2 cases, because in both cases the column literally "is not nullable". Maybe what you want and need is a (new?) property "NOT_NULL_SET" which could result to false for the column while "is_nullable" still _CAN_ return false because of the underlying domain. -- Mit freundlichen Grüssen, André Knappstein, EDV und Controlling Verwaltungs- und Erlebniszentrum Marina Rünthe beta Eigenheim GmbH Hafenweg 4 59192 Bergkamen-Rünthe Durchwahl: +49 2389 9240 140 - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Re: [Firebird-net-provider] Bug in FbConnection.GetSchema("Columns")
Hello Jiri, >> Maybe what you want and need is a (new?) property "NOT_NULL_SET" which >> could result to false for the column while "is_nullable" still _CAN_ >> return false because of the underlying domain. JC> Isn't this just negation of is_nullable? BTW in schema table are some JC> well-known columns so you cannot adding/removing some in a free way. No, not necessarily. You can set the column's "NOT NULL" in addition to it's Domain's "NOT NULL". That would be double for now. Once you remove the "NOT NULL" from the domain, this column would still remain "not nullable". Jürgen might have exactly a situation where he needs this information. - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
[Firebird-net-provider] Bug in FbConnection.GetSchema("Columns")
Hi, Jiri Cincura wrote: > "is_nullable" means, that column accepts NULL values. So it should be > (keep eyes on me Helen :)): > 1. domain has "NOT NULL" clause (no matter what's on column > definition) > is_nullable = false > 2. column has "NOT NULL" clause > is_nullable = false > 3. Othervise is_nullable = true > > I agree. That's the way I expect the result value. > I'll check the problem during weekend. > If you have more important things to do, you can wait until I set a corrected version of the SELECT command in Schema\FbColumns.cs into DNET-151. All the best to you all, Juergen -- *_Juergen Thomas_* Verlags-Software Samlaendische Str. 3 13189 Berlin Germany - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Re: [Firebird-net-provider] Bug in FbConnection.GetSchema("Columns")
On 1/11/08, André Knappstein, Controlling <[EMAIL PROTECTED]> wrote: > Once you remove the "NOT NULL" from the domain, this column would > still remain "not nullable". OK, now I see. I missed, that the column will be evaluated only for column definition without domain. PS: I haven't looked to the reported problem yet, so I'm little confused, 'cause seems, that the thread has splited into two (about the wrong results of code and about the not null on column (without domain). If there's a problem, I'll try to fix it asap. If there's another problem (not related to DNET-151), please kick me. :) -- Jiri {x2} Cincura (Microsoft Student Partner) http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Re: [Firebird-net-provider] Bug in FbConnection.GetSchema("Columns")
On 1/11/08, André Knappstein, Controlling <[EMAIL PROTECTED]> wrote: > Looking at a column which is not nullable because you set "NOT NULL" > to the column, you would EXPECT the property "is_nullable" to be > true, where "true" is represented by the numeric value 1. > I would NOT, because literally the column is not nullable, and so I > would not want to have this situation concluded as "column is > nullable". > > Instead I would either expect that the result is 0 where 0 means > "false" or 1 where 1 means "false" (because the NOT-NULL flag in the > system table is set to 1 as Helen described...) > > Looking at a column which is not nullable because you (only) set it's > domain to a domain for which you set "NOT NULL", not touching the NOT > NULL constraint of the column itself, you would EXPECT the > property "is_nullable" false. I also would, because the column is > indeed not nullable. > > I am a bit worried, in any case, that you would expect different > results for the 2 cases, because in both cases the column literally > "is not nullable". "is_nullable" means, that column accepts NULL values. So it should be (keep eyes on me Helen :)): 1. domain has "NOT NULL" clause (no matter what's on column definition) > is_nullable = false 2. column has "NOT NULL" clause > is_nullable = false 3. Othervise is_nullable = true I'll check the problem during weekend. > Maybe what you want and need is a (new?) property "NOT_NULL_SET" which > could result to false for the column while "is_nullable" still _CAN_ > return false because of the underlying domain. Isn't this just negation of is_nullable? BTW in schema table are some well-known columns so you cannot adding/removing some in a free way. -- Jiri {x2} Cincura (Microsoft Student Partner) http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
[Firebird-net-provider] Misprint in FbDataReader.cs of latest build
Hi Jiri, i found one little mistake in GetSchemaCommandText() function of FbDataReader (i downloaded source and binary just few minutes ago) so, we have following sql statement SELECT fld.rdb$computed_blr AS computed_blr, fld.rdb$computed_source AS computed_source, (SELECT COUNT(*) FROM rdb$relation_constraints rel INNER JOIN rdb$indices idx ON rel.rdb$index_name = idx.rdb$index_name INNER JOIN rdb$index_segments seg ON idx.rdb$index_name = seg.rdb$index_name WHERE rel.rdb$constraint_type = 'PRIMARY KEY' AND rel.rdb$relation_name = rfr.rdb$relation_name AND seg.rdb$field_name = rfr.rdb$field_name) AS primary_key, (SELECT COUNT(*) FROM rdb$relation_constraints rel INNER JOIN rdb$indices idx ON rel.rdb$index_name = idx.rdb$index_name INNER JOIN rdb$index_segments seg ON idx.rdb$index_name = seg.rdb$index_name WHERE rel.rdb$constraint_type = 'UNIQUE' AND rel.rdb$relation_name = rfr.rdb$relation_name AND seg.rdb$field_name = rfr.rdb$field_name) AS unique_key, fld.rdb$field_precision AS numeric_precision FROM rdb$relation_fields rfr INNER JOIN rdb$fields fld ON rfr.rdb$field_source = fld.rdb$field_name WHERE [r]fr.rdb$relation_name = ? AND rfr.rdb$field_name = ? ORDER BY rfr.rdb$relation_name, rfr.rdb$field_position do you see the bolded "r"-letter (the third line from the end) ? it is not present in source code, that brings sql syntax error :) -- View this message in context: http://www.nabble.com/Misprint-in-FbDataReader.cs-of-latest-build-tp14753060p14753060.html Sent from the firebird-net-provider mailing list archive at Nabble.com. - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Re: [Firebird-net-provider] Misprint in FbDataReader.cs of latest build
On 1/11/08, paha <[EMAIL PROTECTED]> wrote: > > Hi Jiri, > > i found one little mistake in GetSchemaCommandText() function of > FbDataReader (i downloaded source and binary just few minutes ago) > so, we have following sql statement Sorry man, damn typo (during formating, rewriting to inner joins and creating it as constant). Fixed on SVN. -- Jiri {x2} Cincura (Microsoft Student Partner) http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Re: [Firebird-net-provider] Bug in FbConnection.GetSchema("Columns")
>On 1/11/08, André Knappstein, Controlling <[EMAIL PROTECTED]> wrote: >> Once you remove the "NOT NULL" from the domain, this column would >> still remain "not nullable". You cannot remove the NOT NULL constraint. At 09:33 PM 11/01/2008, Jiri wrote: >OK, now I see. I missed, that the column will be evaluated only for >column definition without domain. Incorrect. All column definitions have a domain, including those that are defined independently of a user-defined domain. All of the domain definitions are stored in RDB$FIELDS. The column RDB$FIELD_SOURCE in RDB$RELATION_FIELDS points to the name of the domain in RDB$FIELDS, viz., RDB$FIELD_NAME. The nullability check is performed on the record that stores the domain definition, i.e. RDB$FIELDS.RDB$NULL_FLAG. >PS: I haven't looked to the reported problem yet, so I'm little >confused, 'cause seems, that the thread has splited into two (about >the wrong results of code and about the not null on column (without >domain). >If there's a problem, I'll try to fix it asap. If there's another >problem (not related to DNET-151), please kick me. :) Just make sure you understand a) the difference between NULL and nullable b) that "nullable" means the field is allowed to be null: it does not mean that it is always null; while "non-nullable" will always mean that the field has been constrained to be NOT NULL c) that the VALUE of 1 on RDB$FIELDS.RDB$NULL_FLAG means that the field is NOT nullable and that the nullABLE flag does not have the value 0: it is null. d) that there will be more potential for confusion in the code, in case the GetSchema call is reading the null indicator field (sqlind) directly from the output descriptor: after the query on the system tables has been prepared, sqlind will be -1 if the field is nullable, or 0 if it is non-nullable. For anyone who doesn't get what null is (and is not), please go to the Documentation Index at the Firebird website and read the Null Guide. Helen - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
[Firebird-net-provider] FbConnection.GetSchema() bool values not consistent
Hi Jiri, in addition to the GetSchema methods, I started to write a documentation like http://msdn2.microsoft.com/en-us/library/ms254969(VS.80).aspx. I found out that some bool values are returned as bool, others as short, others as integer. Is it useful to change the related fields in the returned DataTables? Example: GetSchema("Tables") has DataColumn "Is_System_Table" as short, but really is bool. I know that needs a lot of simple changes. Is it useful to do so? Shall I prepare these changes? Greetings, Juergen Jiri Cincura wrote: > No problem, it's just a simple case statement. > > I hope DNET-151 and 152 will be resolved during weekend. :) > > -- *_Juergen Thomas_* Verlags-Software Samlaendische Str. 3 13189 Berlin Germany - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Re: [Firebird-net-provider] Bug in FbConnection.GetSchema("Columns")
On 1/11/08, VS-Polis <[EMAIL PROTECTED]> wrote: > If you have more important things to do, you can wait until I set a > corrected version of the SELECT command in Schema\FbColumns.cs into > DNET-151. No problem, it's just a simple case statement. I hope DNET-151 and 152 will be resolved during weekend. :) -- Jiri {x2} Cincura (Microsoft Student Partner) http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Re: [Firebird-net-provider] How to detect transaction failure due to a conflict?
On 1/11/08, Martin Fay <[EMAIL PROTECTED]> wrote: > Can anyone suggest what logical test I should use on this? Checking error code is the best way. You can also distinguish what exactly happend. > Also are the error codes defined anywhere in the .net provider source? Error codes and messages for it are defined in isc_error_msg.txt [http://firebird.svn.sourceforge.net/viewvc/firebird/NETProvider/trunk/NETProvider/source/FirebirdSql/Data/Resources/isc_error_msg.txt?view=markup]. There's no "error structure" in provider (it will be huge and the naming will be problematic) you can check directly the numbers or create some small for you. -- Jiri {x2} Cincura (Microsoft Student Partner) http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
[Firebird-net-provider] How to detect transaction failure due to a conflict?
I'm currently trying to write a transaction handler which will retry the transaction if there has been a conflict with another transaction... however... I'm failing to find any solid documentation on how to detect this state. The FbException I get when an update conflict occurs contains: FbException Message "deadlock\r\nupdate conflicts with concurrent update" string ErrorCode -2147467259 int (no idea of any definition of this numner!) FbError 0 Number 335544336 int (isc_deadlock) FbError 1 Number 335544451 int (isc_update_conflict) FbError 2 Message "deadlock\r\nupdate conflicts with concurrent update" string Number 335544336 int (isc_deadlock) Can anyone suggest what logical test I should use on this? Also are the error codes defined anywhere in the .net provider source? Thanks in advance, Martin - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Re: [Firebird-net-provider] Bug in FbConnection.GetSchema("Columns")
On 1/11/08, Helen Borrie <[EMAIL PROTECTED]> wrote: > >OK, now I see. I missed, that the column will be evaluated only for > >column definition without domain. > > Incorrect. All column definitions have a domain, including those that are > defined independently of a user-defined domain. All of the domain > definitions are stored in RDB$FIELDS. The column RDB$FIELD_SOURCE in > RDB$RELATION_FIELDS points to the name of the domain in RDB$FIELDS, viz., > RDB$FIELD_NAME. The nullability check is performed on the record that stores > the domain definition, i.e. RDB$FIELDS.RDB$NULL_FLAG. > I know this. I was just responding to "request" for new column SET_NOT_NULL (which I still don't know why should be usefull, but ...). > Just make sure you understand > a) the difference between NULL and nullable > b) that "nullable" means the field is allowed to be null: it does not mean > that it is always null; while "non-nullable" will always mean that the field > has been constrained to be NOT NULL > c) that the VALUE of 1 on RDB$FIELDS.RDB$NULL_FLAG means that the field is > NOT nullable and that the nullABLE flag does not have the value 0: it is > null. > d) that there will be more potential for confusion in the code, in case the > GetSchema call is reading the null indicator field (sqlind) directly from the > output descriptor: after the query on the system tables has been prepared, > sqlind will be -1 if the field is nullable, or 0 if it is non-nullable. > I'm completely clear with this behavior. I'm using RDB$RELATION_FIELDS.RDB$NULL_FLAG and RDB$FIELDS.RDB$NULL_FLAG in my "create ddl for table" apllication and works like a charm and same as isql. :) -- Jiri {x2} Cincura (Microsoft Student Partner) http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider