home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.os.vms      DEC's VAX* line of computers & VMS.      264,096 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 262,728 of 264,096   
   =?UTF-8?Q?Arne_Vajh=C3=B8j?= to Craig A. Berry   
   Re: FreeTDS port to VMS V9.x on x86?   
   01 Jul 25 15:57:19   
   
   From: arne@vajhoej.dk   
      
   On 6/25/2025 8:15 AM, Craig A. Berry wrote:   
   > On 6/24/25 7:38 PM, Arne Vajhøj wrote:   
   >> On 6/24/2025 12:25 PM, Arne Vajhøj wrote:   
   >>> I don't like the #elif HAVE_VSNPRINTF code in tds_vasprintf.   
   >>>   
   >>> :-)   
   >>>   
   >>> The algorithm is basically to try vsnprintf with buffers   
   >>> increasing in size 512, 1024, 1536, ... until there is space.   
   >>>   
   >>> That is very inefficient compared to just use the return value.   
   >>>   
   >>> And since it does not use va_copy, then only the first call to   
   >>> vsnprintf will work.   
   >>   
   >> Even if va_copy was called and we ignore the option of   
   >> using vsnprintf return value, then +512 is not good   
   >> compared to *2. +512 with a 1 GB CLOB value would mean   
   >> 2 million calls to vsnprintf.   
   >>   
   >> (I have not checked if TDS actually allow that long   
   >> statements, but +512 is a problem)   
   >   
   > TDS packet length is negotiated but must be between 512 and 32,767 bytes:   
   >   
   > https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-tds/   
   > c1cddd03-b448-470a-946a-9b1b908f27a7   
   >   
   > And vasprintf appears to be used in FreeTDS only for query strings and   
   > commands, not for data.   
      
   dbfcmd (which calls vasprintf) are for SQL statements in general.   
      
   SELECT and DELETE statements are not likely to be really long.   
      
   But INSERT and UPDATE statements does contain data and can   
   therefore be very long.   
      
   I tried using dbfcmd to insert 100 KB, 200 KB and 400 KB values.   
   They all succeeded (very slow but I don't know if that is the library   
   or something in my setup). So somewhere it must be able to chunk up such   
   a long SQL statement into multiple TDS packets.   
      
   > You aren't wrong, but improving the vasprintf implementation isn't my   
   > highest priority;   
      
   There are 8 billion people on this planet. It is not your   
   responsibility.   
      
   >                   feel free to take a crack at it and submit a PR.  To   
   > work against current sources, you either need to use autoconf with a git   
   > checkout or get a nightly snapshot from .   
      
   I may take a look.   
      
   Submitting a PR may be a problem. I have never had a personal   
   Github account and I suspect that my work Github account has   
   been deactivated. But I will worry about that when/if I have   
   a good fix.   
      
   Arne   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca