Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-3407

databases promise is broken

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: (None)
    • Resolution: Unresolved
    • Affects Version/s: 3.15.2
    • Fix Version/s: None
    • Component/s: cf-agent
    • Labels:
      None

      Description

      QueryTableColumns contains an SQL syntax error accidentally included in c588174e78, whose fix is trivial (cfe-db-patch-1.patch).

      Still QueryTableColumns doesn't work for Postgres, as, given a "db.table" promisee, the MariaDB connector creates a table identified by:

      TABLE_CATALOG = def, TABLE_SCHEMA = db, TABLE_NAME = table

      while the PostgreSQL one creates a table identified by:

      TABLE_CATALOG = db, TABLE_SCHEMA = public, TABLE_NAME = table

      Again, the fix is trivial (cfe-db-patch-2.patch).

      Still this doesn't fix the promise, and things are getting more complicated. I haven't had the time to fully investigate, so I'm just scratching the surface. At least with MariaDB, the QueryTableColumns fails when an int column is involved, as in that case CHARACTER_MAXIMUM_LENGTH is always NULL and the field length is embedded in the COLUMN_TYPE column in the form int.

      Tested on Debian sid (unstable) with CFEngine=3.15.2, MariaDB=10.3, PostgreSQL=12.4. Confirmed on CFEngine core git HEAD.

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              gpiero Gian Piero Carrubba
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Summary Panel