From: johnrreagan@earthlink.net   
      
   On 8/15/2025 9:35 AM, Arne Vajhøj wrote:   
   > On 8/15/2025 8:27 AM, Simon Clubley wrote:   
   >> On 2025-08-12, Arne Vajhøj wrote:   
   >>> Code:   
   >>>   
   >>> #include    
   >>>   
   >>> #include    
   >>>   
   >>> my_bool demo_init(UDF_INIT *initid, UDF_ARGS *args, char *message)   
   >>> {   
   >>> if(args->arg_count == 2 && args->arg_type[0] == STRING_RESULT &&   
   >>> args->arg_type[1] == INT_RESULT)   
   >>   
   >> Is it guaranteed that arg_type[] will always have at least elements ?   
   >> If not, that's dangerous unless the compiler you are using does   
   >> expression short-circuiting.   
   >   
   > Isn't C required to do short circuiting on && ?   
      
   Yes, C and C++ short-circuits. Other languages may not. For example,   
   Pascal does promise short-circuit which is why our Pascal also provides   
   an AND_THEN and OR_ELSE operator much like you find in Ada.   
      
   >   
   >>> {   
   >>> return 0;   
   >>> }   
   >>> else   
   >>> {   
   >>> strcpy(message, "demo function requires two arguments:   
   one   
   >>> string and one integer");   
   >>> return 1;   
   >>   
   >> YUCK!!! :-) Does MySQL provide a maximum error message size field or   
   >> constant that you can use with strncpy() instead ?   
   >   
   > Not that I am aware of.   
   >   
   > No such used in the example provided by MySQL/Oracle.   
   >   
   > Arne   
   >   
   >   
   >   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|