List:MySQL++« Previous MessageNext Message »
From:Dan Cook (dancook) Date:May 19 2011 4:09pm
Subject:RE: SSQLS: Number of colomns in a table
View as plain text  
> On Wed, May 18, 2011 at 9:45 PM, Warren Young
> wrote:
> > On May 18, 2011, at 9:27 PM, Adrian Cornish wrote:
> >
> >> Index: lib/ssqls.pl
> >> ===================================================================
> >> --- lib/ssqls.pl        (revision 2690)
> >> +++ lib/ssqls.pl        (working copy)
> >> @@ -499,8 +499,9 @@
> >>        sql_compare_define_##CMP(NAME, $parmC)
> >>        sql_construct_define_##CONTR(NAME, $parmC)
> >>        static const char* names[];
> >> +       static const size_t field_count = NAME##_NULL;
> >
> > Instead of defining the new one in terms of the old, why not just
> make this the new constant, and replace all the other ones?  ssqls_NULL
> isn't nearly as C++ish as ssqls::field_count.
>
> I tried quickly to remove the enum - but ssqls_NULL is used internally
> in some places like:
> $create_list .= "    if (i$j == NAME##_NULL) return;\n" unless $i == 1;
> 
> Also even though it isnt documented - maybe someone is using it. (Not
> sure if that is an issue)
> 
> I prefer 'ends' to enums (which is basically index for names[])
> 
> With a bit more work I can probably remove the ssqls_NULL and replace
> with the ssqls::field_count if people prefer.

Wow! Thank you for the patches.   
If I have a choice, I would prefer Warren's "field_count" since it's obviously the "field
count".

Thread
Crash in DBDriver::fetch_row on a heavily loaded system...dancook)12 Apr
  • Re: Crash in DBDriver::fetch_row on a heavily loaded system...Adrian Cornish12 Apr
    • RE: Crash in DBDriver::fetch_row on a heavily loaded system...dancook)12 Apr
    • RE: Crash in DBDriver::fetch_row on a heavily loaded system...dancook)13 Apr
      • Re: Crash in DBDriver::fetch_row on a heavily loaded system...Warren Young13 Apr
        • Re: Crash in DBDriver::fetch_row on a heavily loaded system...Adrian Cornish13 Apr
          • Re: Crash in DBDriver::fetch_row on a heavily loaded system...Warren Young13 Apr
        • RE: Crash in DBDriver::fetch_row on a heavily loaded system...dancook)15 Apr
          • Re: Crash in DBDriver::fetch_row on a heavily loaded system...Warren Young15 Apr
            • Re: Crash in DBDriver::fetch_row on a heavily loaded system...Warren Young15 Apr
            • RE: Crash in DBDriver::fetch_row on a heavily loaded system...dancook)16 Apr
              • Re: Crash in DBDriver::fetch_row on a heavily loaded system...Warren Young16 Apr
          • SSQLS: Number of colomns in a tabledancook)19 May
            • Re: SSQLS: Number of colomns in a tableAdrian Cornish19 May
            • Re: SSQLS: Number of colomns in a tableAdrian Cornish19 May
              • Re: SSQLS: Number of colomns in a tableWarren Young19 May
                • Re: SSQLS: Number of colomns in a tableAdrian Cornish19 May
                  • RE: SSQLS: Number of colomns in a tabledancook)19 May
                  • Re: SSQLS: Number of colomns in a tableWarren Young19 May
                    • Re: SSQLS: Number of colomns in a tableWarren Young20 May
      • Re: Crash in DBDriver::fetch_row on a heavily loaded system...Adrian Cornish13 Apr
        • Re: Crash in DBDriver::fetch_row on a heavily loaded system...Warren Young13 Apr