Skip to content
Snippets Groups Projects
Commit fd75dffe authored by Thomas Hohn's avatar Thomas Hohn Committed by Helmut Hummel
Browse files

[BUGFIX] Add support for multi-line INSERT statements in static data

Join consecutive lines for INSERT statements in ext_tables_static+adt.sql
using a space instead of a linefeed to avoid parser errors.

Resolves: #78892
Releases: master
Change-Id: Ide550419b7ef41109a660a671b8aba65a33eb6b3
Reviewed-on: https://review.typo3.org/51854


Reviewed-by: default avatarMorton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: default avatarMorton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarHelmut Hummel <typo3@helhum.io>
Tested-by: default avatarHelmut Hummel <typo3@helhum.io>
parent b534440e
Branches
Tags
No related merge requests found
......@@ -102,7 +102,7 @@ class SqlReader
}
$statementArrayPointer++;
} else {
$statementArray[$statementArrayPointer] .= LF;
$statementArray[$statementArrayPointer] .= ' ';
}
}
......
......@@ -83,6 +83,23 @@ class SqlReaderTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
$this->assertStringStartsWith('INSERT', array_pop($result));
}
/**
* @test
*/
public function getInsertStatementArrayResultWithNewline()
{
$result = $this->subject->getInsertStatementArray(
'CREATE TABLE aTestTable(' . LF . ' aTestField INT(11)' . LF . ');' .
LF .
'INSERT INTO aTestTable(`aTestField`) ' .
LF .
'VALUES(1);'
);
$this->assertCount(1, $result);
$this->assertSame('INSERT INTO aTestTable(`aTestField`) VALUES(1);', array_pop($result));
}
/**
* @test
*/
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment