source code improvements
------------------------

                 Key: DNET-247
                 URL: http://tracker.firebirdsql.org/browse/DNET-247
             Project: .NET Data provider
          Issue Type: Improvement
            Reporter: Konstantin Dombrugov
            Assignee: Jiri Cincura


1)
class DatabaseParameterBuffer has method with a bug
        public void Append(int type, byte value)
        {
            this.WriteByte(type);
            this.WriteByte(1);
            this.Write(value);   //this is a bug
        }
this method write 4 byte instread of 3 because base class ParameterBuffer has 
only Write(short) overload
2)
class FbCommand
method private void UpdateParameterValues()
issue occures when setting parameter value as byte[] for field with database 
type BLOB SUBTYPE TEXT
current source code accepts only string value
as a suggestion: replace
                                    
blob.Write((string)this.Parameters[index].Value);
with something like this
                                    var valueType = 
this.Parameters[index].Value.GetType();
                                    if (valueType.IsArray && 
valueType.GetElementType() == typeof(byte))
                                    {
                                        
blob.Write((byte[])this.Parameters[index].Value);
                                    }
                                    else
                                        
blob.Write((string)this.Parameters[index].Value);
3) 
class FbBatchExecution 
in method Execute() sometimes for raising events used constructions like this
      this.OnCommandExecuting(null);
...
      this.OnCommandExecuted(null,...
Events raised by such calls are useless. It is not possible to know neither 
statement type nor statement text. Why not to pass sqlCommand? 



-- 
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-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to