Task #83414 » typo3-7.6-DatabaseConnection-MariaDB.diff

Ayke Halder, 2020-09-22 10:46

View differences:

typo3/sysext/core/Classes/Database/DatabaseConnection.php 2018-07-12 13:01:26.000000000 +0200 → typo3/sysext/core/Classes/Database/DatabaseConnection.php 2020-09-22 10:41:07.363800363 +0200
521
        // Quote and escape values
521
        // Quote and escape values
522
        $fields_values = $this->fullQuoteArray($fields_values, $table, $no_quote_fields, true);
522
        $fields_values = $this->fullQuoteArray($fields_values, $table, $no_quote_fields, true);
523
        // Build query
523
        // Build query
524
        $query = 'INSERT INTO ' . $table . ' (' . implode(',', array_keys($fields_values)) . ') VALUES ' . '(' . implode(',', $fields_values) . ')';
524
        $query = 'INSERT INTO ' . $table . ' (`' . implode('`,`', array_keys($fields_values)) . '`) VALUES ' . '(' . implode(',', $fields_values) . ')';
525
        // Return query
525
        // Return query
526
        if ($this->debugOutput || $this->store_lastBuiltQuery) {
526
        if ($this->debugOutput || $this->store_lastBuiltQuery) {
527
            $this->debug_lastBuiltQuery = $query;
527
            $this->debug_lastBuiltQuery = $query;
......
550
            $hookObject->INSERTmultipleRows_preProcessAction($table, $fields, $rows, $no_quote_fields, $this);
550
            $hookObject->INSERTmultipleRows_preProcessAction($table, $fields, $rows, $no_quote_fields, $this);
551
        }
551
        }
552
        // Build query
552
        // Build query
553
        $query = 'INSERT INTO ' . $table . ' (' . implode(', ', $fields) . ') VALUES ';
553
        $query = 'INSERT INTO ' . $table . ' (`' . implode('`,`', $fields) . '`) VALUES ';
554
        $rowSQL = [];
554
        $rowSQL = [];
555
        foreach ($rows as $row) {
555
        foreach ($rows as $row) {
556
            // Quote and escape values
556
            // Quote and escape values
......
590
                // Quote and escape values
590
                // Quote and escape values
591
                $nArr = $this->fullQuoteArray($fields_values, $table, $no_quote_fields, true);
591
                $nArr = $this->fullQuoteArray($fields_values, $table, $no_quote_fields, true);
592
                foreach ($nArr as $k => $v) {
592
                foreach ($nArr as $k => $v) {
593
                    $fields[] = $k . '=' . $v;
593
                    $fields[] = '`' . $k . '`=' . $v;
594
                }
594
                }
595
            }
595
            }
596
            // Build query
596
            // Build query
......
777
        $queryParts = [];
777
        $queryParts = [];
778
        foreach ($searchWords as $sw) {
778
        foreach ($searchWords as $sw) {
779
            $like = ' LIKE \'%' . $this->quoteStr($this->escapeStrForLike($sw, $table), $table) . '%\'';
779
            $like = ' LIKE \'%' . $this->quoteStr($this->escapeStrForLike($sw, $table), $table) . '%\'';
780
            $queryParts[] = $table . '.' . implode(($like . ' OR ' . $table . '.'), $fields) . $like;
780
            $queryParts[] = $table . '.`' . implode(('`' . $like . ' OR ' . $table . '.`'), $fields) . '`' .$like;
781
        }
781
        }
782
        $query = '(' . implode(') ' . $constraint . ' (', $queryParts) . ')';
782
        $query = '(' . implode(') ' . $constraint . ' (', $queryParts) . ')';
783

  
783

  
    (1-1/1)