On 12/30/18 6:10 PM, Richard Green wrote:
> I believe the struct PragmaName (in pragma.h) has an extra 'const'
> keyword for zName, in Version 3.26.0 (2018-12-01); probably has no
> effect.
>
> Currently,
>
> /* Definitions of all built-in pragmas */
> typedef struct PragmaName {
>   const char *constzName; /* Name of pragma */
>   u8 ePragTyp;             /* PragTyp_XXX value */
>   u8 mPragFlg;             /* Zero or more PragFlg_XXX values */
>   u8 iPragCName;           /* Start of column names in pragCName[] */
>   u8 nPragCName;           /* Num of col names. 0 means use pragma
> name */
>   u64 iArg;                /* Extra argument */
> } PragmaName;
>
>
> Probably should be,
>
> /* Definitions of all built-in pragmas */
> typedef struct PragmaName {
>   const char *zName;       /* Name of pragma */
>   u8 ePragTyp;             /* PragTyp_XXX value */
>   u8 mPragFlg;             /* Zero or more PragFlg_XXX values */
>   u8 iPragCName;           /* Start of column names in pragCName[] */
>   u8 nPragCName;           /* Num of col names. 0 means use pragma
> name */
>   u64 iArg;                /* Extra argument */
> } PragmaName;
>
>
>
> Thank you,
>
> Richard Green

const char *constzName;

is defining a member constzName, so changing that would require changing
everywhere it is used.

if it was

const char *const zName; // Note extra space

Then that is declaring that zName is an immutable pointer to a immutable
string/character, which is actually likely true, as the code shouldn't
be changing the names of pragmas.

Your modified definition says that the code is allowed to poke through
zName and change the string representing the pragma.

-- 
Richard Damon

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to