Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-16376

eZDbInterface::prepareSqlQuery does not handle oracle triggers

    XMLWordPrintable

Details

    Description

      eZDbInterface::prepareSqlQuery() does not handle oracle triggers correctly.

      How to reproduce the problem :

      CREATE SEQUENCE s_xport_process_logs;
      
      CREATE OR REPLACE TRIGGER ezxport_customers_id_tr
      BEFORE INSERT ON ezxport_customers FOR EACH ROW WHEN ( new.id IS NULL )
      BEGIN
        SELECT s_xport_customers.nextval INTO :new.id FROM dual;
      END;
      /
      

      And now use the following code :

      <?php
      $file = 'path/to/file';
      
      $db = eZDB::instance(  );
      $db->insertFile( $file, 'schema.sql', false );
      ?>
      

      eZDbInterface sees the trigger as two strings :

      string(197) "/
      
      CREATE OR REPLACE TRIGGER ezxport_process_logs_id_tr
      BEFORE INSERT ON ezxport_process_logs FOR EACH ROW WHEN ( new.id IS NULL )
      BEGIN
        SELECT s_xport_process_logs.nextval INTO :new.id FROM dual"
      string(3) "END"
      

      Whereas it should be one string.

      Attachments

        Activity

          People

            unknown unknown
            qwix qwix
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: