Hello SQLite maintainers,

I'm glad that my patch below has been incorporated (with some changes) into 
future releases:

[50e60cb4]<http://www.sqlite.org/src/info/50e60cb44fd3687d> Modify the ICU 
extension to use a static initializer, as VC++ complains about a dynamic 
initialization. Maybe the dynamic structure initialization is a GCC extension. 
(user: 
drh<http://www.sqlite.org/src/timeline?u=drh&c=2017-01-26+00%3A58%3A27&nd&n=200>,
 tags: 
trunk<http://www.sqlite.org/src/timeline?r=trunk&nd&c=2017-01-26+00%3A58%3A27&n=200>)

I think that SQLite is a great product, and I'm happy to be able to contribute 
to it.

HOWEVER, one thing bothers me:  You did not acknowledge my authorship of it.  
AFAICT, you NEVER seem to acknowledge third party contributions.  Clearly, I'm 
not user 'drh'.  Like with other open-source projects, I would expect my name 
and e-mail to appear in the commit message (and the changelog, if you had one), 
and definitely in the release notes.  This is the polite and professional thing 
to do, and may even encourage others to contribute to the project.

I have another patch in the works which will make 
SQLITE_ENABLE_UPDATE_DELETE_LIMIT directly accessible from the amalgamation, 
but am reluctant to submit it.

Thank you,

--Zem


From: Ziemowit Laski
Sent: Wednesday, 25 January 2017 12:36
To: sqlite-users@mailinglists.sqlite.org
Subject: BUG: Illegal initialization in icu.c : sqlite3IcuInit

Visual C++ correctly catches this.  The fragment

  struct IcuScalar {
    const char *zName;                        /* Function name */
    int nArg;                                 /* Number of arguments */
    int enc;                                  /* Optimal text encoding */
    void *pContext;                           /* sqlite3_user_data() context */
    void (*xFunc)(sqlite3_context*,int,sqlite3_value**);
  } scalars[] = {
    {"regexp", 2, SQLITE_ANY|SQLITE_DETERMINISTIC,          0, icuRegexpFunc},

    {"lower",  1, SQLITE_UTF16|SQLITE_DETERMINISTIC,        0, icuCaseFunc16},
    {"lower",  2, SQLITE_UTF16|SQLITE_DETERMINISTIC,        0, icuCaseFunc16},
    {"upper",  1, SQLITE_UTF16|SQLITE_DETERMINISTIC, (void*)1, icuCaseFunc16},
    {"upper",  2, SQLITE_UTF16|SQLITE_DETERMINISTIC, (void*)1, icuCaseFunc16},

    {"lower",  1, SQLITE_UTF8|SQLITE_DETERMINISTIC,         0, icuCaseFunc16},
    {"lower",  2, SQLITE_UTF8|SQLITE_DETERMINISTIC,         0, icuCaseFunc16},
    {"upper",  1, SQLITE_UTF8|SQLITE_DETERMINISTIC,  (void*)1, icuCaseFunc16},
    {"upper",  2, SQLITE_UTF8|SQLITE_DETERMINISTIC,  (void*)1, icuCaseFunc16},

    {"like",   2, SQLITE_UTF8|SQLITE_DETERMINISTIC,         0, icuLikeFunc},
    {"like",   3, SQLITE_UTF8|SQLITE_DETERMINISTIC,         0, icuLikeFunc},

    {"icu_load_collation",  2, SQLITE_UTF8, (void*)db, icuLoadCollation},
  };

  int rc = SQLITE_OK;
  int i;

should read

       struct IcuScalar {
              const char *zName;                        /* Function name */
              int nArg;                                 /* Number of arguments 
*/
              int enc;                                  /* Optimal text 
encoding */
              void *pContext;                           /* sqlite3_user_data() 
context */
              void(*xFunc)(sqlite3_context*, int, sqlite3_value**);
       } scalars[] = {
              { "regexp", 2, SQLITE_ANY | SQLITE_DETERMINISTIC,          0, 
icuRegexpFunc },

              { "lower",  1, SQLITE_UTF16 | SQLITE_DETERMINISTIC,        0, 
icuCaseFunc16 },
              { "lower",  2, SQLITE_UTF16 | SQLITE_DETERMINISTIC,        0, 
icuCaseFunc16 },
              { "upper",  1, SQLITE_UTF16 | SQLITE_DETERMINISTIC, (void*)1, 
icuCaseFunc16 },
              { "upper",  2, SQLITE_UTF16 | SQLITE_DETERMINISTIC, (void*)1, 
icuCaseFunc16 },

              { "lower",  1, SQLITE_UTF8 | SQLITE_DETERMINISTIC,         0, 
icuCaseFunc16 },
              { "lower",  2, SQLITE_UTF8 | SQLITE_DETERMINISTIC,         0, 
icuCaseFunc16 },
              { "upper",  1, SQLITE_UTF8 | SQLITE_DETERMINISTIC,  (void*)1, 
icuCaseFunc16 },
              { "upper",  2, SQLITE_UTF8 | SQLITE_DETERMINISTIC,  (void*)1, 
icuCaseFunc16 },

              { "like",   2, SQLITE_UTF8 | SQLITE_DETERMINISTIC,         0, 
icuLikeFunc },
              { "like",   3, SQLITE_UTF8 | SQLITE_DETERMINISTIC,         0, 
icuLikeFunc },

              { "icu_load_collation",  2, SQLITE_UTF8, 0, icuLoadCollation }
       };

       int rc = SQLITE_OK;
       int i;

       scalars[11].pContext = (void*)db;

Thank you,

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

Reply via email to