[Oledb-dev] Is it time for 1.0.0.20?

Victor Snezhko snezhko at indorsoft.ru
Thu Apr 20 18:01:39 UTC 2006


Shachar Shemesh <psql at shemesh.biz> writes:

>>         if( cBindings!=num_params )
>>-            throw(DB_E_PARAMNOTOPTIONAL);
>>+        {
>>+            // Parameter binding information were specified earlier, but for
>>+            // the different number of parameters. We will not make any 
>>+            // decision in this case.
>>+            if( num_params != 0 )
>>+            {
>>+                throw(DB_E_PARAMNOTOPTIONAL);
>>+            } 
>>  
>>
> What reason (aside from unexplained respect to the old code) is there
> for enforcing this? In theory, at least, the user can call
> "SetParameterInfo" only detailing the info for two parameters (which
> will be parameter 2 and parameter 4), and giving the rest of the
> information during Execute. Is there any reason to block this?

Hmm, I didn't know about this possibility at the time I wrote the
patch. We definitely should handle this. I'll update the patch.
Or we can commit it in two steps. First as is, and then add support
for this unusual case.

>>+                    //m_params[i].ulParamSize=rgBindings[i].ulParamSize;

Wow, what I have left here... Sorry, my fault.

>>+                    m_params[i].bPrecision=rgBindings[i].bPrecision;
>>+                    m_params[i].bScale=rgBindings[i].bScale;
>>  
>>
> Memory is going hazy on me. Aren't these filled in by the copy out
> status functions?

You mean GetStatus_time and the similar ones? They fill data needed
for GetColumnInfo, and m_params is needed for GetParameterInfo.

>>+        *paramValues=auto_array<char*>(new char*[cBindings]);
>>+        *paramLengths=auto_array<int>(new int[cBindings]);
>>  
>>
> This is ugly and error prone. 

It's a tradeoff. When using references, we don't see that paramLengths
and Values are modified by FillInValues at the place we call
it. However, I agree that pointers make the code inside FillInValues
uglier.

> I'm using references instead. It's a good
> thing, too, as you neglected to send the patch for PgCommand.h

Hmm, one more fault...

>This will make the entire rest of the patch unnecessary:

I find the two variants equal. As you are the project leader, I'll
agree with you.

I'll add the functionality for handling SetParameterInfo data and will
replace pointers with references. But I'll not send the patch today -
previous version I sent late at night had a couple of severe flaws.

-- 
WBR, Victor V. Snezhko
E-mail: snezhko at indorsoft.ru




More information about the Oledb-devel mailing list