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

ODBC CLOB CREATE TABLE error

Expand Messages
  • Charlie Killian
    (cc dev@binarycloud.tigris.org) The metabase odbc driver is producing incorrect sql when creating a table with a clob type. Here s the query metabase is trying
    Message 1 of 30 , Apr 5, 2002
    • 0 Attachment
      (cc dev@...)

      The metabase odbc driver is producing incorrect sql when creating a table
      with a clob type.

      Here's the query metabase is trying to execute:

      CREATE TABLE beach(id INT DEFAULT 0 NOT NULL,sand )

      Notice no column type for sand. In the schema it's defined as "clob".

      The latest version of Metabase is running.

      Any ideas?

      Charlie
    • Manuel Lemos
      Hello, Hello, ... That means that Metabase was not able to find how that ODBC driver support LOBs. You should have checked MetabaseSupport($database, LOBs ).
      Message 2 of 30 , Apr 6, 2002
      • 0 Attachment
        Hello,

        Hello,

        Charlie Killian wrote:
        >
        > (cc dev@...)
        >
        > The metabase odbc driver is producing incorrect sql when creating a table
        > with a clob type.
        >
        > Here's the query metabase is trying to execute:
        >
        > CREATE TABLE beach(id INT DEFAULT 0 NOT NULL,sand )
        >
        > Notice no column type for sand. In the schema it's defined as "clob".
        >
        > The latest version of Metabase is running.
        >
        > Any ideas?

        That means that Metabase was not able to find how that ODBC driver
        support LOBs. You should have checked MetabaseSupport($database,"LOBs").
        What database are you using?

        Regards,
        Manuel Lemos
      • Charles Killian
        ... MetabaseSupport($database, LOBs ) returns 1. ... I m using sapdb. It is supported in PHP through the odbc functions. It s clob column type is long . Has
        Message 3 of 30 , Apr 6, 2002
        • 0 Attachment
          > That means that Metabase was not able to find how that ODBC driver
          > support LOBs. You should have checked
          > MetabaseSupport($database,"LOBs").

          MetabaseSupport($database,"LOBs") returns 1.

          > What database are you using?

          I'm using sapdb. It is supported in PHP through the odbc functions.
          It's clob column type is "long".

          Has Metabase worked with sapdb before?

          Charlie



          __________________________________________________
          Do You Yahoo!?
          Yahoo! Tax Center - online filing with TurboTax
          http://taxes.yahoo.com/
        • Manuel Lemos
          Hello, ... humm..., I am afraid that is an inconsistency in the ODBC API implementation. Anyway, can you just put a var_dump($this); statatement in the end of
          Message 4 of 30 , Apr 6, 2002
          • 0 Attachment
            Hello,

            Charles Killian wrote:
            >
            > > That means that Metabase was not able to find how that ODBC driver
            > > support LOBs. You should have checked
            > > MetabaseSupport($database,"LOBs").
            >
            > MetabaseSupport($database,"LOBs") returns 1.

            humm..., I am afraid that is an inconsistency in the ODBC API
            implementation. Anyway, can you just put a var_dump($this); statatement
            in the end of Setup() function of metabase_odbc.php and send me what it
            dumped?


            > > What database are you using?
            >
            > I'm using sapdb. It is supported in PHP through the odbc functions.
            > It's clob column type is "long".
            >
            > Has Metabase worked with sapdb before?

            Never tried. Metabase does not deal with database specific constructs
            that about which ODBC API does not provide any information.

            Regards,
            Manuel Lemos
          • Charles Killian
            ... Here you go: object(metabase_odbc_class)(55) { [ database ]= int(0) [ host ]= string(0) [ user ]= string(0) [ password ]= string(0)
            Message 5 of 30 , Apr 6, 2002
            • 0 Attachment
              > humm..., I am afraid that is an inconsistency in the ODBC API
              > implementation. Anyway, can you just put a var_dump($this);
              > statatement
              > in the end of Setup() function of metabase_odbc.php and send me what
              > it
              > dumped?

              Here you go:

              object(metabase_odbc_class)(55) {
              ["database"]=>
              int(0)
              ["host"]=>
              string(0) ""
              ["user"]=>
              string(0) ""
              ["password"]=>
              string(0) ""
              ["options"]=>
              array(3) {
              ["DBADSN"]=>
              string(7) "db:TST"
              ["DBAUser"]=>
              string(3) "*"
              ["DBAPassword"]=>
              string(3) "*"
              }
              ["supported"]=>
              array(2) {
              ["SelectRowRanges"]=>
              int(1)
              ["AffectedRows"]=>
              int(1)
              }
              ["persistent"]=>
              int(1)
              ["database_name"]=>
              string(0) ""
              ["warning"]=>
              string(0) ""
              ["affected_rows"]=>
              int(-1)
              ["auto_commit"]=>
              int(1)
              ["prepared_queries"]=>
              array(0) {
              }
              ["decimal_places"]=>
              int(2)
              ["first_selected_row"]=>
              int(0)
              ["selected_row_limit"]=>
              int(0)
              ["lob_buffer_length"]=>
              int(8000)
              ["escape_quotes"]=>
              string(1) "'"
              ["log_line_break"]=>
              string(1) "
              "
              ["lobs"]=>
              array(0) {
              }
              ["clobs"]=>
              array(0) {
              }
              ["blobs"]=>
              array(0) {
              }
              ["last_error"]=>
              string(0) ""
              ["in_transaction"]=>
              int(0)
              ["debug"]=>
              string(0) ""
              ["debug_output"]=>
              string(0) ""
              ["pass_debug_handle"]=>
              int(0)
              ["result_types"]=>
              array(0) {
              }
              ["error_handler"]=>
              string(0) ""
              ["dba_access"]=>
              int(0)
              ["connection"]=>
              resource(3) of type (odbc link)
              ["types_result"]=>
              int(0)
              ["selected_database"]=>
              string(7) "db:TST"
              ["opened_persistent"]=>
              int(0)
              ["current_row"]=>
              array(0) {
              }
              ["limits"]=>
              array(0) {
              }
              ["highest_fetched_row"]=>
              array(0) {
              }
              ["supported_types"]=>
              array(0) {
              }
              ["results"]=>
              array(0) {
              }
              ["rows"]=>
              array(0) {
              }
              ["row_buffer"]=>
              array(0) {
              }
              ["columns"]=>
              array(0) {
              }
              ["query_parameters"]=>
              array(0) {
              }
              ["query_parameter_values"]=>
              array(0) {
              }
              ["decimal_factor"]=>
              float(1)
              ["decimal_scale"]=>
              int(-1)
              ["size_field"]=>
              string(9) "PRECISION"
              ["support_defaults"]=>
              bool(true)
              ["support_decimal_scale"]=>
              bool(true)
              ["blob_declaration"]=>
              string(0) ""
              ["clob_declaration"]=>
              string(0) ""
              ["type_field_names"]=>
              array(0) {
              }
              ["type_index"]=>
              array(0) {
              }
              ["type_property_names"]=>
              array(15) {
              ["TYPE_NAME"]=>
              int(0)
              ["DATA_TYPE"]=>
              int(1)
              ["PRECISION"]=>
              int(2)
              ["LITERAL_PREFIX"]=>
              int(3)
              ["LITERAL_SUFFIX"]=>
              int(4)
              ["CREATE_PARAMS"]=>
              int(5)
              ["NULLABLE"]=>
              int(6)
              ["CASE_SENSITIVE"]=>
              int(7)
              ["SEARCHABLE"]=>
              int(8)
              ["UNSIGNED_ATTRIBUTE"]=>
              int(9)
              ["MONEY"]=>
              int(10)
              ["AUTO_INCREMENT"]=>
              int(11)
              ["LOCAL_TYPE_NAME"]=>
              int(12)
              ["MINIMUM_SCALE"]=>
              int(13)
              ["MAXIMUM_SCALE"]=>
              int(14)
              }
              ["connected_user"]=>
              string(3) "*"
              ["connected_password"]=>
              string(3) "*"
              }


              __________________________________________________
              Do You Yahoo!?
              Yahoo! Tax Center - online filing with TurboTax
              http://taxes.yahoo.com/
            • Charles Killian
              Manuel, will Metabase work with sapdb and long/clob column types? Charlie __________________________________________________ Do You Yahoo!? Yahoo! Tax Center -
              Message 6 of 30 , Apr 6, 2002
              • 0 Attachment
                Manuel, will Metabase work with sapdb and long/clob column types?

                Charlie


                __________________________________________________
                Do You Yahoo!?
                Yahoo! Tax Center - online filing with TurboTax
                http://taxes.yahoo.com/
              • Manuel Lemos
                Hello, ... Yes, like I suspected, odbc_gettypeinfo returns a valid result set but since PHP 4.2.0 odbc_fetch_into had its arguments swapped! It seems yet
                Message 7 of 30 , Apr 7, 2002
                • 0 Attachment
                  Hello,

                  Charles Killian wrote:
                  >
                  > > humm..., I am afraid that is an inconsistency in the ODBC API
                  > > implementation. Anyway, can you just put a var_dump($this);
                  > > statatement
                  > > in the end of Setup() function of metabase_odbc.php and send me what
                  > > it
                  > > dumped?

                  Yes, like I suspected, odbc_gettypeinfo returns a valid result set but
                  since PHP 4.2.0 odbc_fetch_into had its arguments swapped!

                  It seems yet another case of backward compantibility breaking!

                  Just do not use a version before PHP 4.2 for now and see if it works for
                  you!

                  Regards,
                  Manuel Lemos
                • Charles Killian
                  ... How do I get it to work? The error has been occuring on PHP 4.1.2. Did you modify any files? Charlie __________________________________________________ Do
                  Message 8 of 30 , Apr 7, 2002
                  • 0 Attachment
                    > Just do not use a version before PHP 4.2 for now and see if it works
                    > for
                    > you!

                    How do I get it to work? The error has been occuring on PHP 4.1.2. Did
                    you modify any files?

                    Charlie

                    __________________________________________________
                    Do You Yahoo!?
                    Yahoo! Tax Center - online filing with TurboTax
                    http://taxes.yahoo.com/
                  • Manuel Lemos
                    Hello, ... No, I did not try anything. I just looked at the dump. The documentation says it was changed in 4.2 but it may have been sooner. Try for instance
                    Message 9 of 30 , Apr 7, 2002
                    • 0 Attachment
                      Hello,

                      Charles Killian wrote:
                      >
                      > > Just do not use a version before PHP 4.2 for now and see if it works
                      > > for
                      > > you!
                      >
                      > How do I get it to work? The error has been occuring on PHP 4.1.2. Did
                      > you modify any files?

                      No, I did not try anything. I just looked at the dump.

                      The documentation says it was changed in 4.2 but it may have been
                      sooner. Try for instance 4.0.6 .

                      I suspect that there may be other problems. You said support LOBs
                      returned 1, but it should not be the case according to that dump because
                      the supported array did not have that value as expected.

                      You are probably experiencing intermitent problems. I experienced this
                      depending on where I would free the type info result set, but that was
                      with the real ODBC under Windows. PHP ODBC API is broken in more places
                      that I could figure. :-(

                      Regards,
                      Manuel Lemos
                    • Charles Killian
                      ... I need to use 4.1.2 because it has sabdb support. What can I fix to get Metabase to work? Charlie __________________________________________________ Do You
                      Message 10 of 30 , Apr 8, 2002
                      • 0 Attachment
                        > The documentation says it was changed in 4.2 but it may have been
                        > sooner. Try for instance 4.0.6 .
                        >
                        > I suspect that there may be other problems. You said support LOBs
                        > returned 1, but it should not be the case according to that dump
                        > because
                        > the supported array did not have that value as expected.

                        I need to use 4.1.2 because it has sabdb support.

                        What can I fix to get Metabase to work?

                        Charlie

                        __________________________________________________
                        Do You Yahoo!?
                        Yahoo! Tax Center - online filing with TurboTax
                        http://taxes.yahoo.com/
                      • Manuel Lemos
                        Hello, ... The problem is not in Metabase. It is in ODBC API. I am not sure if it is just a matter of switching the arguments of odbc_fetch_into . Look at the
                        Message 11 of 30 , Apr 8, 2002
                        • 0 Attachment
                          Hello,

                          Charles Killian wrote:
                          >
                          > > The documentation says it was changed in 4.2 but it may have been
                          > > sooner. Try for instance 4.0.6 .
                          > >
                          > > I suspect that there may be other problems. You said support LOBs
                          > > returned 1, but it should not be the case according to that dump
                          > > because
                          > > the supported array did not have that value as expected.
                          >
                          > I need to use 4.1.2 because it has sabdb support.
                          >
                          > What can I fix to get Metabase to work?

                          The problem is not in Metabase. It is in ODBC API. I am not sure if it
                          is just a matter of switching the arguments of odbc_fetch_into . Look at
                          the manual page. You may try doing that and see if it works. If it
                          doesn't, the problem is in something else that you need to make a bug
                          report to have it fixed in PHP.

                          Regards,
                          Manuel Lemos
                        • Charles Killian
                          ... Manuel, Thanks for your advice and guidance. One more question: If I do get Metabase and PHP 4.1.2 working together, are CLOBs supported using SAPDB and
                          Message 12 of 30 , Apr 8, 2002
                          • 0 Attachment
                            > The problem is not in Metabase. It is in ODBC API. I am not sure if
                            > it
                            > is just a matter of switching the arguments of odbc_fetch_into . Look
                            > at
                            > the manual page. You may try doing that and see if it works. If it
                            > doesn't, the problem is in something else that you need to make a bug
                            > report to have it fixed in PHP.

                            Manuel,
                            Thanks for your advice and guidance. One more question:

                            If I do get Metabase and PHP 4.1.2 working together, are CLOBs
                            supported using SAPDB and the Meatabase ODBC driver?

                            Thanks again,
                            Charlie

                            __________________________________________________
                            Do You Yahoo!?
                            Yahoo! Tax Center - online filing with TurboTax
                            http://taxes.yahoo.com/
                          • Manuel Lemos
                            Hello, ... Yes, if that ODBC API implementation returns correct type metadata information with odbc_gettypeinfo information. You may need to use the driver
                            Message 13 of 30 , Apr 8, 2002
                            • 0 Attachment
                              Hello,

                              Charles Killian wrote:
                              >
                              > > The problem is not in Metabase. It is in ODBC API. I am not sure if
                              > > it
                              > > is just a matter of switching the arguments of odbc_fetch_into . Look
                              > > at
                              > > the manual page. You may try doing that and see if it works. If it
                              > > doesn't, the problem is in something else that you need to make a bug
                              > > report to have it fixed in PHP.
                              >
                              > Manuel,
                              > Thanks for your advice and guidance. One more question:
                              >
                              > If I do get Metabase and PHP 4.1.2 working together, are CLOBs
                              > supported using SAPDB and the Meatabase ODBC driver?

                              Yes, if that ODBC API implementation returns correct type metadata
                              information with odbc_gettypeinfo information. You may need to use the
                              driver conformance test script to make sure it works as intended.

                              The problems are not with Metabase but with ODBC API implementations. I
                              could make it work with real ODBC drivers like MS Access and SQL server.
                              With PostgreSQL for instance with one of those Unix ODBC APIs, it did
                              not work because PostgreSQL does not suppport real LOB in table fields.
                              It only has a sort of internal file ID that should be used instead of
                              real LOBs and this does not really map with to ODBC LOB API.

                              I never tried SapDB ODBC API but since there is a real ODBC driver for
                              SAP DB under Windows, it should work fine if PHP ODBC API does not fail.

                              Also make sure you use a consistent DBADSN, DBAUser, and DBAPassword
                              options because Metabase will use that to retrieve type Metabase data.
                              In the worst case it should be the same as the database name and user
                              and password you used on setup.

                              Regards,
                              Manuel Lemos
                            • Charles Killian
                              So I m trying to get Metabase, PHP 4.1.2 and sapdb on speaking terms. I ran the driver_test.php. It installs the users table but gives throws this error: php
                              Message 14 of 30 , Apr 8, 2002
                              • 0 Attachment
                                So I'm trying to get Metabase, PHP 4.1.2 and sapdb on speaking terms.

                                I ran the driver_test.php. It installs the "users" table but gives
                                throws this error:

                                php -q ./metabase/driver_test.php

                                Error: Could not install database: indexes are not supported
                                Exiting.


                                Is this true? Or is this a bug a need to track down?

                                Charlie

                                __________________________________________________
                                Do You Yahoo!?
                                Yahoo! Tax Center - online filing with TurboTax
                                http://taxes.yahoo.com/
                              • Manuel Lemos
                                Hello, ... There seems to be no automatic way to determine how to create an index on a table using ODBC. This can only be solved by a Metabase ODBC driver sub
                                Message 15 of 30 , Apr 8, 2002
                                • 0 Attachment
                                  Hello,

                                  Charles Killian wrote:
                                  >
                                  > So I'm trying to get Metabase, PHP 4.1.2 and sapdb on speaking terms.
                                  >
                                  > I ran the driver_test.php. It installs the "users" table but gives
                                  > throws this error:
                                  >
                                  > php -q ./metabase/driver_test.php
                                  >
                                  > Error: Could not install database: indexes are not supported
                                  > Exiting.
                                  >
                                  > Is this true? Or is this a bug a need to track down?

                                  There seems to be no automatic way to determine how to create an index
                                  on a table using ODBC.

                                  This can only be solved by a Metabase ODBC driver sub class that is
                                  aware of how to create indexes and also other things like sequences
                                  eventually using DBMS specific SQL.

                                  I don't have time to do it right now. If you want to have a go, it would
                                  not be very hard. It would be just matter of adding a call to new
                                  function to be added named SetupODBC() at the end of the Setup()
                                  function of the ODBC driver class.

                                  If the default CreateIndex() and DropIndex() functions implemented by
                                  Metabase base driver class would work for SAPDB, the SetupODBC()
                                  function would just do something like $this->supported["Indexes"] and
                                  return 1.

                                  If you would like to try this and contribute back to Metabase, of course
                                  you would be credited in Metabase manual. I can't do it myself, but at
                                  least I can provide some recognition to those that contribute. :-)

                                  Regards,
                                  Manuel Lemos
                                • Charles Killian
                                  ... The default *Index() functions do in sapdb. But the BOOLEAN type of sap wants TRUE or FALSE passed. Not the 0 or 1 Metabase supplies. Can I change this
                                  Message 16 of 30 , Apr 8, 2002
                                  • 0 Attachment
                                    > If the default CreateIndex() and DropIndex() functions implemented by
                                    > Metabase base driver class would work for SAPDB, the SetupODBC()
                                    > function would just do something like $this->supported["Indexes"] and
                                    > return 1.

                                    The default *Index() functions do in sapdb.

                                    But the BOOLEAN type of sap wants TRUE or FALSE passed. Not the 0 or 1
                                    Metabase supplies.

                                    Can I change this easily?

                                    Charlie

                                    __________________________________________________
                                    Do You Yahoo!?
                                    Yahoo! Tax Center - online filing with TurboTax
                                    http://taxes.yahoo.com/
                                  • Manuel Lemos
                                    Hello, ... So, supporting indexes with SAP DB just requires what I mentioned. ... I was talking of the return value of PHP function named SetupODBC to be added
                                    Message 17 of 30 , Apr 8, 2002
                                    • 0 Attachment
                                      Hello,

                                      Charles Killian wrote:
                                      >
                                      > > If the default CreateIndex() and DropIndex() functions implemented by
                                      > > Metabase base driver class would work for SAPDB, the SetupODBC()
                                      > > function would just do something like $this->supported["Indexes"] and
                                      > > return 1.
                                      >
                                      > The default *Index() functions do in sapdb.

                                      So, supporting indexes with SAP DB just requires what I mentioned.


                                      > But the BOOLEAN type of sap wants TRUE or FALSE passed. Not the 0 or 1
                                      > Metabase supplies.
                                      >
                                      > Can I change this easily?

                                      I was talking of the return value of PHP function named SetupODBC to be
                                      added to Metabase ODBC driver class and sub classes. That has nothing to
                                      do with SAP DB SQL.

                                      Regards,
                                      Manuel Lemos
                                    • Charles Killian
                                      ... Yes. It works just like you mentioned. ... True. The SQL in driver_test.php needs to be changed. I ll give it a shot. Charlie
                                      Message 18 of 30 , Apr 8, 2002
                                      • 0 Attachment
                                        > So, supporting indexes with SAP DB just requires what I mentioned.

                                        Yes. It works just like you mentioned.

                                        > > But the BOOLEAN type of sap wants TRUE or FALSE passed. Not the 0
                                        > or 1
                                        > > Metabase supplies.
                                        > >
                                        > > Can I change this easily?
                                        >
                                        > I was talking of the return value of PHP function named SetupODBC to
                                        > be
                                        > added to Metabase ODBC driver class and sub classes. That has nothing
                                        > to
                                        > do with SAP DB SQL.

                                        True. The SQL in driver_test.php needs to be changed.

                                        I'll give it a shot.

                                        Charlie


                                        __________________________________________________
                                        Do You Yahoo!?
                                        Yahoo! Tax Center - online filing with TurboTax
                                        http://taxes.yahoo.com/
                                      • Manuel Lemos
                                        Hello, ... Huh? There is nothing to be changed in the driver_test.php script! Regards, Manuel Lemos
                                        Message 19 of 30 , Apr 9, 2002
                                        • 0 Attachment
                                          Hello,

                                          Charles Killian wrote:
                                          > > > But the BOOLEAN type of sap wants TRUE or FALSE passed. Not the 0
                                          > > or 1
                                          > > > Metabase supplies.
                                          > > >
                                          > > > Can I change this easily?
                                          > >
                                          > > I was talking of the return value of PHP function named SetupODBC to
                                          > > be
                                          > > added to Metabase ODBC driver class and sub classes. That has nothing
                                          > > to
                                          > > do with SAP DB SQL.
                                          >
                                          > True. The SQL in driver_test.php needs to be changed.

                                          Huh? There is nothing to be changed in the driver_test.php script!

                                          Regards,
                                          Manuel Lemos
                                        • Charles Killian
                                          I m stopping my work with sapdb and metabase because the deadline of the project is approaching rapidly. I m moving back to mysql and metabase so hopefully in
                                          Message 20 of 30 , Apr 10, 2002
                                          • 0 Attachment
                                            I'm stopping my work with sapdb and metabase because the deadline of
                                            the project is approaching rapidly. I'm moving back to mysql and
                                            metabase so hopefully in the future I can easily make the switch to
                                            sapdb.

                                            Below is the diff of the short SetupODBC() function I added to the end
                                            of metabase_odbc.php to get indexes working. As you can read all I did
                                            was add a $this->supported["Indexes"] = 1; assignment.

                                            Charlie

                                            Index: metabase/metabase_odbc.php
                                            ===================================================================
                                            RCS file: /metabase/metabase_odbc.php,v
                                            retrieving revision 1.1
                                            diff -r1.1 metabase_odbc.php
                                            883c883,898
                                            < return("");
                                            ---
                                            >
                                            > $this->SetupODBC();
                                            >
                                            > return("");
                                            > }
                                            >
                                            > Function SetupODBC()
                                            > {
                                            > $this->supported["Indexes"] = 1;
                                            >
                                            >
                                            >


                                            __________________________________________________
                                            Do You Yahoo!?
                                            Yahoo! Tax Center - online filing with TurboTax
                                            http://taxes.yahoo.com/
                                          • Charles Killian
                                            Are Metabase enabled MySQL transactions stable for MySQL version 3.23.41? In the manual it says: At the time of writing of this document the currently
                                            Message 21 of 30 , Apr 12, 2002
                                            • 0 Attachment
                                              Are Metabase enabled MySQL transactions stable for MySQL version
                                              3.23.41?

                                              In the manual it says:
                                              "At the time of writing of this document the currently available
                                              version of MySQL (3.23.23) is known to not work well with BDB tables.
                                              Specifically selecting data from BDB using the ORDER BY clause is known
                                              to fail. BDB are created by Metabase MySQL driver class to be able to
                                              support transactions."

                                              Thanks for any info,

                                              Charlie

                                              __________________________________________________
                                              Do You Yahoo!?
                                              Yahoo! Tax Center - online filing with TurboTax
                                              http://taxes.yahoo.com/
                                            • Charles Killian
                                              I ve turned Transations on and recreated the tables using metabase to make sure they are using bdb. But now I get this error from this query: Column count
                                              Message 22 of 30 , Apr 12, 2002
                                              • 0 Attachment
                                                I've turned Transations on and recreated the tables using metabase to
                                                make sure they are using bdb. But now I get this error from this query:

                                                "Column count doesn't match value count at row 1."

                                                INSERT INTO users VALUES
                                                (3, 'A transaction.', 'Y',530, 122.0000009,'1965-01-31',
                                                '12:59:00','2002-03-25 19:10:20')

                                                Called by $_db->Query($query)

                                                This is because a new column, "dummy_primary_key", is in the table.
                                                Shouldn't Metabase automatically take care of increment the
                                                "dummy_primary_key" field?

                                                Charlie




                                                --- Charles Killian <charles_killian@...> wrote:
                                                > Are Metabase enabled MySQL transactions stable for MySQL version
                                                > 3.23.41?
                                                >
                                                > In the manual it says:
                                                > "At the time of writing of this document the currently available
                                                > version of MySQL (3.23.23) is known to not work well with BDB tables.
                                                > Specifically selecting data from BDB using the ORDER BY clause is
                                                > known
                                                > to fail. BDB are created by Metabase MySQL driver class to be able to
                                                > support transactions."
                                                >
                                                > Thanks for any info,
                                                >
                                                > Charlie


                                                __________________________________________________
                                                Do You Yahoo!?
                                                Yahoo! Tax Center - online filing with TurboTax
                                                http://taxes.yahoo.com/
                                              • Manuel Lemos
                                                Hello, ... The dummy field is auto-incremented. That is not your problem. The problems is that since you do not specify the fields to be inserted, MySQL
                                                Message 23 of 30 , Apr 12, 2002
                                                • 0 Attachment
                                                  Hello,

                                                  Charles Killian wrote:
                                                  >
                                                  > I've turned Transations on and recreated the tables using metabase to
                                                  > make sure they are using bdb. But now I get this error from this query:
                                                  >
                                                  > "Column count doesn't match value count at row 1."
                                                  >
                                                  > INSERT INTO users VALUES
                                                  > (3, 'A transaction.', 'Y',530, 122.0000009,'1965-01-31',
                                                  > '12:59:00','2002-03-25 19:10:20')
                                                  >
                                                  > Called by $_db->Query($query)
                                                  >
                                                  > This is because a new column, "dummy_primary_key", is in the table.
                                                  > Shouldn't Metabase automatically take care of increment the
                                                  > "dummy_primary_key" field?

                                                  The dummy field is auto-incremented. That is not your problem. The
                                                  problems is that since you do not specify the fields to be inserted,
                                                  MySQL assumes that you will specify all, including the dummy field. To
                                                  make your code work portably you should specify the field list before
                                                  the VALUES clause. You should not mention the dummy field there.

                                                  Regards,
                                                  Manuel Lemos
                                                • Manuel Lemos
                                                  Hello, ... Yes, all driver conformance tests for transaction support with MySQL with BDB succeed. These tests verify, insertion and deletions doing commits and
                                                  Message 24 of 30 , Apr 12, 2002
                                                  • 0 Attachment
                                                    Hello,

                                                    Charles Killian wrote:
                                                    >
                                                    > Are Metabase enabled MySQL transactions stable for MySQL version
                                                    > 3.23.41?
                                                    >
                                                    > In the manual it says:
                                                    > "At the time of writing of this document the currently available
                                                    > version of MySQL (3.23.23) is known to not work well with BDB tables.
                                                    > Specifically selecting data from BDB using the ORDER BY clause is known
                                                    > to fail. BDB are created by Metabase MySQL driver class to be able to
                                                    > support transactions."

                                                    Yes, all driver conformance tests for transaction support with MySQL
                                                    with BDB succeed.

                                                    These tests verify, insertion and deletions doing commits and rollback.

                                                    When in doubt, always try the driver conformance test script. Quality
                                                    assurance is what it is meant for. I wanted Metabase to be reliable and
                                                    as bug free as software can be. This script has been very important to
                                                    assure that. Since you may use MySQL or some other database in a
                                                    different environment that I used, it is always wise to try it yourself
                                                    in your environment.

                                                    Regards,
                                                    Manuel Lemos
                                                  • Charles Killian
                                                    Thanks for all your help. Transactions are working correctly and all tests in driver_test.php or OK. Rolling back transactions work but here is a warning
                                                    Message 25 of 30 , Apr 12, 2002
                                                    • 0 Attachment
                                                      Thanks for all your help. Transactions are working correctly and all
                                                      tests in driver_test.php or OK.

                                                      Rolling back transactions work but here is a warning issued each time:

                                                      Warning: Some non-transactional changed tables couldn't be rolled back

                                                      What does it mean and why is it being issued?

                                                      Also, I get this php warning:
                                                      E_WARNING: Variable passed to reset() is not an array or object
                                                      d:\tools\metabase\metabase_database.php on line 26

                                                      Any suggestions?

                                                      Charlie

                                                      __________________________________________________
                                                      Do You Yahoo!?
                                                      Yahoo! Tax Center - online filing with TurboTax
                                                      http://taxes.yahoo.com/
                                                    • Manuel Lemos
                                                      Hello, ... It means you have some non-BDB tables that were changed during a transaction but MySQL ROLLBACK did not fail despite it did not revert the changes.
                                                      Message 26 of 30 , Apr 12, 2002
                                                      • 0 Attachment
                                                        Hello,

                                                        Charles Killian wrote:
                                                        >
                                                        > Thanks for all your help. Transactions are working correctly and all
                                                        > tests in driver_test.php or OK.
                                                        >
                                                        > Rolling back transactions work but here is a warning issued each time:
                                                        >
                                                        > Warning: Some non-transactional changed tables couldn't be rolled back
                                                        >
                                                        > What does it mean and why is it being issued?

                                                        It means you have some non-BDB tables that were changed during a
                                                        transaction but MySQL ROLLBACK did not fail despite it did not revert
                                                        the changes. You need to recreate the tables as BDB.


                                                        > Also, I get this php warning:
                                                        > E_WARNING: Variable passed to reset() is not an array or object
                                                        > d:\tools\metabase\metabase_database.php on line 26
                                                        >
                                                        > Any suggestions?

                                                        This seems like a PHP bug. It is saying that the global variable
                                                        $metabase_databases is not an array. Since this is being called from a
                                                        script shutdown handler function to close any pending transactions, it
                                                        seems like a new bug that exists ion newer PHP versions. What PHP
                                                        version are you using?

                                                        Regards,
                                                        Manuel Lemos
                                                      • Charles Killian
                                                        ... This warning is happening because of the sequence tables metabase sets up. The sequence tables are not rolled back. How can I make the squence tables as
                                                        Message 27 of 30 , Apr 13, 2002
                                                        • 0 Attachment
                                                          > > Warning: Some non-transactional changed tables couldn't be rolled
                                                          > back
                                                          > >
                                                          > > What does it mean and why is it being issued?
                                                          >
                                                          > It means you have some non-BDB tables that were changed during a
                                                          > transaction but MySQL ROLLBACK did not fail despite it did not revert
                                                          > the changes. You need to recreate the tables as BDB.

                                                          This warning is happening because of the sequence tables metabase sets
                                                          up. The sequence tables are not rolled back. How can I make the squence
                                                          tables as BDB?

                                                          > > Also, I get this php warning:
                                                          > > E_WARNING: Variable passed to reset() is not an array or object
                                                          > > d:\tools\metabase\metabase_database.php on line 26
                                                          > >
                                                          > > Any suggestions?
                                                          >
                                                          > This seems like a PHP bug. It is saying that the global variable
                                                          > $metabase_databases is not an array. Since this is being called from
                                                          > a
                                                          > script shutdown handler function to close any pending transactions,
                                                          > it
                                                          > seems like a new bug that exists ion newer PHP versions. What PHP
                                                          > version are you using?

                                                          PHP version 4.1.2.

                                                          Thanks, for your help.

                                                          Charlie

                                                          __________________________________________________
                                                          Do You Yahoo!?
                                                          Yahoo! Tax Center - online filing with TurboTax
                                                          http://taxes.yahoo.com/
                                                        • Manuel Lemos
                                                          Hello, ... Oh, I see. It was harmless, but I have just fixed that and a fixed version is avalilable here:
                                                          Message 28 of 30 , Apr 13, 2002
                                                          • 0 Attachment
                                                            Hello,

                                                            Charles Killian wrote:
                                                            >
                                                            > > > Warning: Some non-transactional changed tables couldn't be rolled
                                                            > > back
                                                            > > >
                                                            > > > What does it mean and why is it being issued?
                                                            > >
                                                            > > It means you have some non-BDB tables that were changed during a
                                                            > > transaction but MySQL ROLLBACK did not fail despite it did not revert
                                                            > > the changes. You need to recreate the tables as BDB.
                                                            >
                                                            > This warning is happening because of the sequence tables metabase sets
                                                            > up. The sequence tables are not rolled back. How can I make the squence
                                                            > tables as BDB?

                                                            Oh, I see. It was harmless, but I have just fixed that and a fixed
                                                            version is avalilable here:

                                                            http://groups.yahoo.com/group/metabase-dev/files/beta/


                                                            >
                                                            > > > Also, I get this php warning:
                                                            > > > E_WARNING: Variable passed to reset() is not an array or object
                                                            > > > d:\tools\metabase\metabase_database.php on line 26
                                                            > > >
                                                            > > > Any suggestions?
                                                            > >
                                                            > > This seems like a PHP bug. It is saying that the global variable
                                                            > > $metabase_databases is not an array. Since this is being called from
                                                            > > a
                                                            > > script shutdown handler function to close any pending transactions,
                                                            > > it
                                                            > > seems like a new bug that exists ion newer PHP versions. What PHP
                                                            > > version are you using?
                                                            >
                                                            > PHP version 4.1.2.

                                                            I will look into this. This shouls only be happening if there were any
                                                            pending transactions when the script ended. So, there may be a small bug
                                                            in the driver test script somewhere.

                                                            Regards,
                                                            Manuel Lemos
                                                          • Charles Killian
                                                            ... Thanks, for the quick fix. I m no longer receiving the Warning. ... Keep me updated. For now I just @silenced the reset() function. It still seems to be
                                                            Message 29 of 30 , Apr 14, 2002
                                                            • 0 Attachment
                                                              > Oh, I see. It was harmless, but I have just fixed that

                                                              Thanks, for the quick fix. I'm no longer receiving the Warning.

                                                              > I will look into this. This shouls only be happening if there were
                                                              > any
                                                              > pending transactions when the script ended. So, there may be a small
                                                              > bug
                                                              > in the driver test script somewhere.

                                                              Keep me updated. For now I just @silenced the reset() function. It
                                                              still seems to be working fine.

                                                              Charlie

                                                              __________________________________________________
                                                              Do You Yahoo!?
                                                              Yahoo! Tax Center - online filing with TurboTax
                                                              http://taxes.yahoo.com/
                                                            • Manuel Lemos
                                                              Hello, ... I tried with 4.1.2 and I can t reproduce the problem. Anyway, when running PHP as Web server module you will not see that anyway because that code
                                                              Message 30 of 30 , Apr 14, 2002
                                                              • 0 Attachment
                                                                Hello,

                                                                Charles Killian wrote:
                                                                > > I will look into this. This shouls only be happening if there were
                                                                > > any
                                                                > > pending transactions when the script ended. So, there may be a small
                                                                > > bug
                                                                > > in the driver test script somewhere.
                                                                >
                                                                > Keep me updated. For now I just @silenced the reset() function. It
                                                                > still seems to be working fine.

                                                                I tried with 4.1.2 and I can't reproduce the problem. Anyway, when
                                                                running PHP as Web server module you will not see that anyway because
                                                                that code is only run from a script shutdown handler which does not
                                                                output anything. Still it seems like a PHP problem which is beyhond my
                                                                power to fix.

                                                                Regards,
                                                                Manuel Lemos
                                                              Your message has been successfully submitted and would be delivered to recipients shortly.