Loading ...
Sorry, an error occurred while loading the content.

sqlite driver and centos

Expand Messages
  • subscriber@viliar.net.ru
    (Looks like my previous letters has been failed to deliver. so I resend it) Due version of sqlite in CentOS5 last snapshots 20100618 and alter does not compile
    Message 1 of 13 , Aug 2, 2010
    • 0 Attachment
      (Looks like my previous letters has been failed to deliver. so I resend
      it)

      Due version of sqlite in CentOS5 last snapshots 20100618 and alter does
      not compile
      with next error:

      dict_sqlite.c:71:2: error: #error "Your SQLite version is too old"
      dict_sqlite.c: In function 'dict_sqlite_lookup':
      dict_sqlite.c:203: warning: implicit declaration of function
      'sqlite3_prepare_v2'
      make: *** [dict_sqlite.o] Error 1
      make: *** [update] Error 1
      error: Bad exit status from /var/tmp/rpm-tmp.38770 (%build)


      RPM build errors:
      Bad exit status from /var/tmp/rpm-tmp.38770 (%build)


      I use postfix with sqlite patch about 2 years with small fix to function
      name. I
      suggest to make something like this for postfix 2.8. Or maybe check sqlite
      version at compile time and use ifdef's.




      -------- Original Message --------
      Subject: [SPAM] Re: [Fwd: postfix sqlite patch.]
      Date: Wed, 12 Mar 2008 10:09:22 +0100
      From: Axel Steiner <ast@...>
      To: xxx

      Hi,


      Yeah, looks like where is no such function in CentOS 5.1 version of
      sqlite. strings /usr/lib/libsqlite3.so | grep prepare sqlite3_prepare
      sqlite3_prepare16 # grep prepare /usr/include/sqlite3.h | grep int int
      sqlite3_prepare( int sqlite3_prepare16( ... I'm very far away C/Cxx
      programming. Can you, please, say, can function be safely replaced with
      sqlite3_prepare or sqlite3_prepare16 ? From the whishes to your very good
      idea of patch - include some documentaion with requirements (INSTALL,
      README).


      yes. It should work, use sqlite3_prepare(). The function arguments
      are the same.
      This patch has no SQLite version check, because I don't wanted to
      support deprecated
      functions. This is the only function which is not present in SQLite
      versions
      prior 3.3.9.

      Manpages and documentation are on my todo list :-)
      That's the only stuff which is missing.

      Axel
    • Brian Evans - Postfix List
      ... You might like this from the archives... http://archives.neohapsis.com/archives/postfix/2010-06/0539.html
      Message 2 of 13 , Aug 2, 2010
      • 0 Attachment
        On 8/2/2010 5:18 AM, subscriber@... wrote:
        > I use postfix with sqlite patch about 2 years with small fix to function
        > name. I
        > suggest to make something like this for postfix 2.8. Or maybe check sqlite
        > version at compile time and use ifdef's.

        You might like this from the archives...
        http://archives.neohapsis.com/archives/postfix/2010-06/0539.html
      • subscriber@viliar.net.ru
        On Mon, 02 Aug 2010 09:02:41 -0400, Brian Evans - Postfix List ... function ... Thank you. Do you think I should re-post it in that thread? I didn t find there
        Message 3 of 13 , Aug 2, 2010
        • 0 Attachment
          On Mon, 02 Aug 2010 09:02:41 -0400, Brian Evans - Postfix List
          <grknight@...> wrote:
          > On 8/2/2010 5:18 AM, subscriber@... wrote:
          >> I use postfix with sqlite patch about 2 years with small fix to
          function
          >> name. I
          >> suggest to make something like this for postfix 2.8. Or maybe check
          >> sqlite
          >> version at compile time and use ifdef's.
          >
          > You might like this from the archives...
          > http://archives.neohapsis.com/archives/postfix/2010-06/0539.html

          Thank you. Do you think I should re-post it in that thread? I didn't find
          there any relevant posts to this problem.
        • Wietse Venema
          ... Especially if you can also post concrete code for solving this. Otherwise, the Postfix xqlite driver is unlikely to change. Wietse
          Message 4 of 13 , Aug 2, 2010
          • 0 Attachment
            subscriber@...:
            > On Mon, 02 Aug 2010 09:02:41 -0400, Brian Evans - Postfix List
            > <grknight@...> wrote:
            > > On 8/2/2010 5:18 AM, subscriber@... wrote:
            > >> I use postfix with sqlite patch about 2 years with small fix to
            > function
            > >> name. I
            > >> suggest to make something like this for postfix 2.8. Or maybe check
            > >> sqlite
            > >> version at compile time and use ifdef's.
            > >
            > > You might like this from the archives...
            > > http://archives.neohapsis.com/archives/postfix/2010-06/0539.html
            >
            > Thank you. Do you think I should re-post it in that thread? I didn't find
            > there any relevant posts to this problem.

            Especially if you can also post concrete code for solving this.
            Otherwise, the Postfix xqlite driver is unlikely to change.

            Wietse
          • subscriber@viliar.net.ru
            On Mon, 2 Aug 2010 14:36:35 -0400 (EDT), Wietse Venema ... find ... certainly. ... +++ ./src/global/dict_sqlite.c 2010-08-03 17:18:20.000000000 +0400 @@ -200,7
            Message 5 of 13 , Aug 3, 2010
            • 0 Attachment
              On Mon, 2 Aug 2010 14:36:35 -0400 (EDT), Wietse Venema
              <wietse@...> wrote:
              > subscriber@...:
              >> On Mon, 02 Aug 2010 09:02:41 -0400, Brian Evans - Postfix List
              >> <grknight@...> wrote:
              >> > On 8/2/2010 5:18 AM, subscriber@... wrote:
              >> >> I use postfix with sqlite patch about 2 years with small fix to
              >> function
              >> >> name. I
              >> >> suggest to make something like this for postfix 2.8. Or maybe check
              >> >> sqlite
              >> >> version at compile time and use ifdef's.
              >> >
              >> > You might like this from the archives...
              >> > http://archives.neohapsis.com/archives/postfix/2010-06/0539.html
              >>
              >> Thank you. Do you think I should re-post it in that thread? I didn't
              find
              >> there any relevant posts to this problem.
              >
              > Especially if you can also post concrete code for solving this.
              > Otherwise, the Postfix xqlite driver is unlikely to change.
              >
              > Wietse

              certainly.

              --- ./src/global/dict_sqlite.c.orig 2010-08-03 17:17:52.000000000 +0400
              +++ ./src/global/dict_sqlite.c 2010-08-03 17:18:20.000000000 +0400
              @@ -200,7 +200,7 @@ static const char *dict_sqlite_lookup(DI
              msg_info("%s: %s: Searching with query %s",
              myname, dict_sqlite->parser->name, vstring_str(query));

              - if (sqlite3_prepare_v2(dict_sqlite->db, vstring_str(query), -1,
              + if (sqlite3_prepare(dict_sqlite->db, vstring_str(query), -1,
              &sql_stmt, &query_remainder) != SQLITE_OK)
              msg_fatal("%s: %s: SQL prepare failed: %s\n",
              myname, dict_sqlite->parser->name,


              :-)
            • subscriber@viliar.net.ru
              On Mon, 2 Aug 2010 14:36:35 -0400 (EDT), Wietse Venema ... find ... Pardon. We have to also remove sqlite version or change it to something apropriate. ... +++
              Message 6 of 13 , Aug 3, 2010
              • 0 Attachment
                On Mon, 2 Aug 2010 14:36:35 -0400 (EDT), Wietse Venema
                <wietse@...> wrote:
                > subscriber@...:
                >> On Mon, 02 Aug 2010 09:02:41 -0400, Brian Evans - Postfix List
                >> <grknight@...> wrote:
                >> > On 8/2/2010 5:18 AM, subscriber@... wrote:
                >> >> I use postfix with sqlite patch about 2 years with small fix to
                >> function
                >> >> name. I
                >> >> suggest to make something like this for postfix 2.8. Or maybe check
                >> >> sqlite
                >> >> version at compile time and use ifdef's.
                >> >
                >> > You might like this from the archives...
                >> > http://archives.neohapsis.com/archives/postfix/2010-06/0539.html
                >>
                >> Thank you. Do you think I should re-post it in that thread? I didn't
                find
                >> there any relevant posts to this problem.
                >
                > Especially if you can also post concrete code for solving this.
                > Otherwise, the Postfix xqlite driver is unlikely to change.
                >
                > Wietse

                Pardon. We have to also remove sqlite version or change it to something
                apropriate.

                --- ./src/global/dict_sqlite.c.orig 2010-08-03 17:37:29.000000000 +0400
                +++ ./src/global/dict_sqlite.c 2010-08-03 17:37:48.000000000 +0400
                @@ -67,10 +67,6 @@
                #ifdef HAS_SQLITE
                #include <sqlite3.h>

                -#if !defined(SQLITE_VERSION_NUMBER) || (SQLITE_VERSION_NUMBER < 3005004)
                -#error "Your SQLite version is too old"
                -#endif
                -
                /* Utility library. */

                #include <msg.h>
                @@ -200,7 +196,7 @@ static const char *dict_sqlite_lookup(DI
                msg_info("%s: %s: Searching with query %s",
                myname, dict_sqlite->parser->name, vstring_str(query));

                - if (sqlite3_prepare_v2(dict_sqlite->db, vstring_str(query), -1,
                + if (sqlite3_prepare(dict_sqlite->db, vstring_str(query), -1,
                &sql_stmt, &query_remainder) != SQLITE_OK)
                msg_fatal("%s: %s: SQL prepare failed: %s\n",
                myname, dict_sqlite->parser->name,
              • Wietse Venema
                ... If you want Postfix to support the obsolete API then you cannot remove support for the preferred API. Wietse
                Message 7 of 13 , Aug 3, 2010
                • 0 Attachment
                  subscriber@...:
                  > On Mon, 2 Aug 2010 14:36:35 -0400 (EDT), Wietse Venema
                  > <wietse@...> wrote:
                  > > subscriber@...:
                  > >> On Mon, 02 Aug 2010 09:02:41 -0400, Brian Evans - Postfix List
                  > >> <grknight@...> wrote:
                  > >> > On 8/2/2010 5:18 AM, subscriber@... wrote:
                  > >> >> I use postfix with sqlite patch about 2 years with small fix to
                  > >> function
                  > >> >> name. I
                  > >> >> suggest to make something like this for postfix 2.8. Or maybe check
                  > >> >> sqlite
                  > >> >> version at compile time and use ifdef's.
                  > >> >
                  > >> > You might like this from the archives...
                  > >> > http://archives.neohapsis.com/archives/postfix/2010-06/0539.html
                  > >>
                  > >> Thank you. Do you think I should re-post it in that thread? I didn't
                  > find
                  > >> there any relevant posts to this problem.
                  > >
                  > > Especially if you can also post concrete code for solving this.
                  > > Otherwise, the Postfix xqlite driver is unlikely to change.
                  > >
                  > > Wietse
                  >
                  > Pardon. We have to also remove sqlite version or change it to something
                  > apropriate.

                  If you want Postfix to support the obsolete API then you
                  cannot remove support for the preferred API.

                  Wietse

                  > --- ./src/global/dict_sqlite.c.orig 2010-08-03 17:37:29.000000000 +0400
                  > +++ ./src/global/dict_sqlite.c 2010-08-03 17:37:48.000000000 +0400
                  > @@ -67,10 +67,6 @@
                  > #ifdef HAS_SQLITE
                  > #include <sqlite3.h>
                  >
                  > -#if !defined(SQLITE_VERSION_NUMBER) || (SQLITE_VERSION_NUMBER < 3005004)
                  > -#error "Your SQLite version is too old"
                  > -#endif
                  > -
                  > /* Utility library. */
                  >
                  > #include <msg.h>
                  > @@ -200,7 +196,7 @@ static const char *dict_sqlite_lookup(DI
                  > msg_info("%s: %s: Searching with query %s",
                  > myname, dict_sqlite->parser->name, vstring_str(query));
                  >
                  > - if (sqlite3_prepare_v2(dict_sqlite->db, vstring_str(query), -1,
                  > + if (sqlite3_prepare(dict_sqlite->db, vstring_str(query), -1,
                  > &sql_stmt, &query_remainder) != SQLITE_OK)
                  > msg_fatal("%s: %s: SQL prepare failed: %s\n",
                  > myname, dict_sqlite->parser->name,
                  >
                  >
                  >
                  >
                  >
                  >
                • subscriber@viliar.net.ru
                  On Tue, 3 Aug 2010 10:43:56 -0400 (EDT), Wietse Venema ... check ... Sorry for delay with answer. I ll send this diff as workaround. Because I m not a
                  Message 8 of 13 , Sep 9, 2010
                  • 0 Attachment
                    On Tue, 3 Aug 2010 10:43:56 -0400 (EDT), Wietse Venema
                    <wietse@...> wrote:
                    > subscriber@...:
                    >> On Mon, 2 Aug 2010 14:36:35 -0400 (EDT), Wietse Venema
                    >> <wietse@...> wrote:
                    >> > subscriber@...:
                    >> >> On Mon, 02 Aug 2010 09:02:41 -0400, Brian Evans - Postfix List
                    >> >> <grknight@...> wrote:
                    >> >> > On 8/2/2010 5:18 AM, subscriber@... wrote:
                    >> >> >> I use postfix with sqlite patch about 2 years with small fix to
                    >> >> function
                    >> >> >> name. I
                    >> >> >> suggest to make something like this for postfix 2.8. Or maybe
                    check
                    >> >> >> sqlite
                    >> >> >> version at compile time and use ifdef's.
                    >> >> >
                    >> >> > You might like this from the archives...
                    >> >> > http://archives.neohapsis.com/archives/postfix/2010-06/0539.html
                    >> >>
                    >> >> Thank you. Do you think I should re-post it in that thread? I didn't
                    >> find
                    >> >> there any relevant posts to this problem.
                    >> >
                    >> > Especially if you can also post concrete code for solving this.
                    >> > Otherwise, the Postfix xqlite driver is unlikely to change.
                    >> >
                    >> > Wietse
                    >>
                    >> Pardon. We have to also remove sqlite version or change it to something
                    >> apropriate.
                    >
                    > If you want Postfix to support the obsolete API then you
                    > cannot remove support for the preferred API.

                    Sorry for delay with answer. I'll send this diff as workaround. Because
                    I'm not a programmer/coder. Probably correct decision is using some another
                    ifdefs here.

                    P.S. For me it's not a problem to live with own patched postfix as I do
                    now. But the way you integrate sqlite support in postfix - is a 'kick off'
                    CentOS 5 users from using postfix 2.8. It wouldn't compile anymore and I
                    don't think is good. How much people will search&patch&compile postfix on
                    their own?
                    P.S2. It's not about flame.
                  • Wietse Venema
                    ... Will this work? Unfortunately I can t test Postfix myself on every version of everything. Wietse ... *************** *** 68,74 **** #include
                    Message 9 of 13 , Sep 9, 2010
                    • 0 Attachment
                      subscriber@...:
                      > > If you want Postfix to support the obsolete API then you
                      > > cannot remove support for the preferred API.
                      >
                      > Sorry for delay with answer. I'll send this diff as workaround. Because
                      > I'm not a programmer/coder. Probably correct decision is using some another
                      > ifdefs here.
                      >
                      > P.S. For me it's not a problem to live with own patched postfix as I do
                      > now. But the way you integrate sqlite support in postfix - is a 'kick off'
                      > CentOS 5 users from using postfix 2.8. It wouldn't compile anymore and I
                      > don't think is good. How much people will search&patch&compile postfix on
                      > their own?
                      > P.S2. It's not about flame.

                      Will this work? Unfortunately I can't test Postfix myself on every
                      version of everything.

                      Wietse

                      *** ./dict_sqlite.c- Fri Jun 18 20:19:15 2010
                      --- ./dict_sqlite.c Thu Sep 9 11:01:12 2010
                      ***************
                      *** 68,74 ****
                      #include <sqlite3.h>

                      #if !defined(SQLITE_VERSION_NUMBER) || (SQLITE_VERSION_NUMBER < 3005004)
                      ! #error "Your SQLite version is too old"
                      #endif

                      /* Utility library. */
                      --- 68,74 ----
                      #include <sqlite3.h>

                      #if !defined(SQLITE_VERSION_NUMBER) || (SQLITE_VERSION_NUMBER < 3005004)
                      ! #define sqlite3_prepare_v2 sqlite3_prepare
                      #endif

                      /* Utility library. */
                    • subscriber@viliar.net.ru
                      On Thu, 9 Sep 2010 11:06:07 -0400 (EDT), Wietse Venema ... I ... on ... 3005004) ... 3005004) ... Thank you, I ll check it today later.
                      Message 10 of 13 , Sep 9, 2010
                      • 0 Attachment
                        On Thu, 9 Sep 2010 11:06:07 -0400 (EDT), Wietse Venema
                        <wietse@...> wrote:
                        > subscriber@...:
                        >> > If you want Postfix to support the obsolete API then you
                        >> > cannot remove support for the preferred API.
                        >>
                        >> Sorry for delay with answer. I'll send this diff as workaround. Because
                        >> I'm not a programmer/coder. Probably correct decision is using some
                        >> another
                        >> ifdefs here.
                        >>
                        >> P.S. For me it's not a problem to live with own patched postfix as I do
                        >> now. But the way you integrate sqlite support in postfix - is a 'kick
                        >> off'
                        >> CentOS 5 users from using postfix 2.8. It wouldn't compile anymore and
                        I
                        >> don't think is good. How much people will search&patch&compile postfix
                        on
                        >> their own?
                        >> P.S2. It's not about flame.
                        >
                        > Will this work? Unfortunately I can't test Postfix myself on every
                        > version of everything.
                        >
                        > Wietse
                        >
                        > *** ./dict_sqlite.c- Fri Jun 18 20:19:15 2010
                        > --- ./dict_sqlite.c Thu Sep 9 11:01:12 2010
                        > ***************
                        > *** 68,74 ****
                        > #include <sqlite3.h>
                        >
                        > #if !defined(SQLITE_VERSION_NUMBER) || (SQLITE_VERSION_NUMBER <
                        3005004)
                        > ! #error "Your SQLite version is too old"
                        > #endif
                        >
                        > /* Utility library. */
                        > --- 68,74 ----
                        > #include <sqlite3.h>
                        >
                        > #if !defined(SQLITE_VERSION_NUMBER) || (SQLITE_VERSION_NUMBER <
                        3005004)
                        > ! #define sqlite3_prepare_v2 sqlite3_prepare
                        > #endif
                        >
                        > /* Utility library. */

                        Thank you, I'll check it today later.
                      • subscriber@viliar.net.ru
                        On Thu, 9 Sep 2010 11:06:07 -0400 (EDT), Wietse Venema ... 3005004) ... 3005004) ... Right now I have checked postfix compile and postconf out. Everything
                        Message 11 of 13 , Sep 10, 2010
                        • 0 Attachment
                          On Thu, 9 Sep 2010 11:06:07 -0400 (EDT), Wietse Venema
                          <wietse@...> wrote:
                          > Will this work? Unfortunately I can't test Postfix myself on every
                          > version of everything.
                          >
                          > Wietse
                          >
                          > *** ./dict_sqlite.c- Fri Jun 18 20:19:15 2010
                          > --- ./dict_sqlite.c Thu Sep 9 11:01:12 2010
                          > ***************
                          > *** 68,74 ****
                          > #include <sqlite3.h>
                          >
                          > #if !defined(SQLITE_VERSION_NUMBER) || (SQLITE_VERSION_NUMBER <
                          3005004)
                          > ! #error "Your SQLite version is too old"
                          > #endif
                          >
                          > /* Utility library. */
                          > --- 68,74 ----
                          > #include <sqlite3.h>
                          >
                          > #if !defined(SQLITE_VERSION_NUMBER) || (SQLITE_VERSION_NUMBER <
                          3005004)
                          > ! #define sqlite3_prepare_v2 sqlite3_prepare
                          > #endif
                          >
                          > /* Utility library. */


                          Right now I have checked postfix compile and postconf out. Everything
                          fine. Don't check only real work with sqlite database. I can do it later.

                          # cat /etc/redhat-release
                          CentOS release 5.5 (Final)
                          # postconf | grep mail_version
                          mail_version = 2.8-20100829
                          milter_macro_v = $mail_name $mail_version
                          # postconf -m
                          btree
                          cidr
                          environ
                          hash
                          internal
                          nis
                          pcre
                          proxy
                          regexp
                          sqlite
                          static
                          tcp
                          unix


                          Thank you again!
                        • Wietse Venema
                          ... I looked up the API documentation, and it should work, but no-one knows until it has been tested on a real system. Wietse
                          Message 12 of 13 , Sep 10, 2010
                          • 0 Attachment
                            subscriber@...:
                            > On Thu, 9 Sep 2010 11:06:07 -0400 (EDT), Wietse Venema
                            > <wietse@...> wrote:
                            > > Will this work? Unfortunately I can't test Postfix myself on every
                            > > version of everything.
                            > >
                            > > Wietse
                            > >
                            > > *** ./dict_sqlite.c- Fri Jun 18 20:19:15 2010
                            > > --- ./dict_sqlite.c Thu Sep 9 11:01:12 2010
                            > > ***************
                            > > *** 68,74 ****
                            > > #include <sqlite3.h>
                            > >
                            > > #if !defined(SQLITE_VERSION_NUMBER) || (SQLITE_VERSION_NUMBER <
                            > 3005004)
                            > > ! #error "Your SQLite version is too old"
                            > > #endif
                            > >
                            > > /* Utility library. */
                            > > --- 68,74 ----
                            > > #include <sqlite3.h>
                            > >
                            > > #if !defined(SQLITE_VERSION_NUMBER) || (SQLITE_VERSION_NUMBER <
                            > 3005004)
                            > > ! #define sqlite3_prepare_v2 sqlite3_prepare
                            > > #endif
                            > >
                            > > /* Utility library. */
                            >
                            >
                            > Right now I have checked postfix compile and postconf out. Everything
                            > fine. Don't check only real work with sqlite database. I can do it later.

                            I looked up the API documentation, and it should work, but no-one knows
                            until it has been tested on a real system.

                            Wietse
                          • subscriber@viliar.net.ru
                            On Fri, 10 Sep 2010 08:27:12 -0400 (EDT), Wietse Venema ... later. ... First time, then I try to use postfix with sqlite patch and small correct about function
                            Message 13 of 13 , Sep 10, 2010
                            • 0 Attachment
                              On Fri, 10 Sep 2010 08:27:12 -0400 (EDT), Wietse Venema
                              <wietse@...> wrote:
                              > subscriber@...:
                              >> On Thu, 9 Sep 2010 11:06:07 -0400 (EDT), Wietse Venema
                              >> <wietse@...> wrote:
                              >> > Will this work? Unfortunately I can't test Postfix myself on every
                              >> > version of everything.
                              >> >
                              >> > Wietse
                              >> >
                              >> > *** ./dict_sqlite.c- Fri Jun 18 20:19:15 2010
                              >> > --- ./dict_sqlite.c Thu Sep 9 11:01:12 2010
                              >> > ***************
                              >> > *** 68,74 ****
                              >> > #include <sqlite3.h>
                              >> >
                              >> > #if !defined(SQLITE_VERSION_NUMBER) || (SQLITE_VERSION_NUMBER <
                              >> 3005004)
                              >> > ! #error "Your SQLite version is too old"
                              >> > #endif
                              >> >
                              >> > /* Utility library. */
                              >> > --- 68,74 ----
                              >> > #include <sqlite3.h>
                              >> >
                              >> > #if !defined(SQLITE_VERSION_NUMBER) || (SQLITE_VERSION_NUMBER <
                              >> 3005004)
                              >> > ! #define sqlite3_prepare_v2 sqlite3_prepare
                              >> > #endif
                              >> >
                              >> > /* Utility library. */
                              >>
                              >>
                              >> Right now I have checked postfix compile and postconf out. Everything
                              >> fine. Don't check only real work with sqlite database. I can do it
                              later.
                              >
                              > I looked up the API documentation, and it should work, but no-one knows
                              > until it has been tested on a real system.
                              >
                              > Wietse

                              First time, then I try to use postfix with sqlite patch and small correct
                              about function (sqlite3_prepare) is December 2008. As you now, first of all
                              I have a look at sqlite API documentation and write a letter to author of
                              sqlite patch. Sorry for link, I wrote about it then in my blog
                              http://blog.viliar.net.ru/2008/03/12/opensource%D1%86/ (in russian) In
                              production on a small loads I using it for own mail server about half of
                              year. So, you can look on it as on example of real usage :-)
                            Your message has been successfully submitted and would be delivered to recipients shortly.