{"type":"rich","version":"1.0","provider_name":"phorkie","provider_url":"https:\/\/p.cweiske.de\/","title":"TYPO3 v8: Support POINT SQL data type fields","author_name":"Christian Weiske","cache_age":86400,"width":900,"height":900,"html":"<!-- embedding all files of https:\/\/p.cweiske.de\/709 -->\n<link rel=\"stylesheet\" href=\"https:\/\/p.cweiske.de\/css\/embed.css\"\/>\n<div class=\"phork\" id=\"709\">\n    <div class=\"phork-file\">\n <div class=\"phork-content\">\n  \n<div class=\"document\">\n\n\n<p>See <a class=\"reference external\" href=\"https:\/\/forge.typo3.org\/issues\/79990\">https:\/\/forge.typo3.org\/issues\/79990<\/a><\/p>\n<\/div>\n\n <\/div>\n <div class=\"phork-meta\">\n  <a href=\"https:\/\/p.cweiske.de\/709\/rev-raw\/68fd7ced9562310fc8a1d09ef6761cc08ae5d50e\/README.rst\" style=\"float: right\">view raw source<\/a>\n  <a href=\"https:\/\/p.cweiske.de\/709#README.rst\">README.rst<\/a>\n <\/div>\n<\/div>\n    <div class=\"phork-file\">\n <div class=\"phork-content\">\n  <style type=\"text\/css\">\/**\n * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2014 Benny Baumann\n * (http:\/\/qbnz.com\/highlighter\/ and http:\/\/geshi.org\/)\n *\/\n.diff .de1, .diff .de2 {font: normal normal 1em\/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}\n.diff  {font-family:monospace;}\n.diff .imp {font-weight: bold; color: red;}\n.diff li, .diff .li1 {color: #DDD;}\n.diff .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}\n.diff .kw1 {color: #aaaaaa; font-style: italic;}\n.diff .re0 {color: #440088;}\n.diff .re1 {color: #991111;}\n.diff .re2 {color: #00b000;}\n.diff .re3 {color: #888822;}\n.diff .re4 {color: #888822;}\n.diff .re5 {color: #0011dd;}\n.diff .re6 {color: #440088;}\n.diff .re7 {color: #991111;}\n.diff .re8 {color: #00b000;}\n.diff .re9 {color: #888822;}\n.diff span.xtra { display:block; }\n<\/style><div class=\"code\"><table class=\"diff\"><tbody><tr class=\"li1\"><td class=\"ln\"><pre class=\"de1\">1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n53\n54\n55\n56\n57\n58\n59\n60\n61\n62\n63\n64\n65\n66\n67\n68\n69\n70\n71\n72\n73\n74\n75\n76\n77\n78\n79\n80\n81\n82\n83\n84\n85\n86\n87\n88\n89\n90\n91\n92\n93\n94\n95\n96\n97\n98\n99\n100\n101\n102\n103\n104\n105\n106\n107\n108\n109\n110\n111\n112\n113\n114\n115\n116\n117\n118\n119\n120\n121\n122\n123\n124\n125\n126\n127\n128\n129\n130\n131\n132\n133\n134\n135\n136\n137\n138\n139\n140\n141\n142\n143\n144\n145\n146\n147\n148\n149\n150\n151\n152\n153\n154\n155\n156\n157\n158\n159\n160\n161\n162\n163\n164\n165\n166\n167\n168\n169\n170\n171\n<\/pre><\/td><td class=\"de1\"><pre class=\"de1\">commit ae0ca<span class=\"re0\">945d1<\/span>ad39f5b2ca1efa804de964129f025e\nAuthor: Christian Weiske &lt;weiske@mogic.com&gt;\nDate: &#160; Fri Jan <span class=\"nu0\">22<\/span> <span class=\"nu0\">10<\/span>:<span class=\"nu0\">57<\/span>:<span class=\"nu0\">21<\/span> <span class=\"nu0\">2021<\/span> +0100\n&#160;\n&#160; &#160; Support POINT SQL data type in TYPO3 core v8.7\n&#160;\ndiff --git typo3\/sysext\/core\/Classes\/Database\/ConnectionPool.php typo3\/sysext\/core\/Classes\/Database\/ConnectionPool.php\nindex 8f81e615..1b038cb9 <span class=\"nu0\">100644<\/span>\n<span class=\"re3\">--- typo3\/sysext\/core\/Classes\/Database\/ConnectionPool.php<\/span>\n<span class=\"re4\">+++ typo3\/sysext\/core\/Classes\/Database\/ConnectionPool.php<\/span>\n<span class=\"re6\">@@ -24,6 +24,7 @@<\/span>\n&#160;use TYPO3\\CMS\\Core\\Database\\Schema\\EventListener\\SchemaColumnDefinitionListener;\n&#160;use TYPO3\\CMS\\Core\\Database\\Schema\\EventListener\\SchemaIndexDefinitionListener;\n&#160;use TYPO3\\CMS\\Core\\Database\\Schema\\Types\\EnumType;\n<span class=\"re8\">+use TYPO3\\CMS\\Core\\Database\\Schema\\Types\\PointType;<\/span>\n&#160;use TYPO3\\CMS\\Core\\Database\\Schema\\Types\\SetType;\n&#160;use TYPO3\\CMS\\Core\\Utility\\GeneralUtility;\n&#160;\n<span class=\"re6\">@@ -54,6 +55,7 @@ class ConnectionPool<\/span>\n&#160; &#160; &#160; *\/\n&#160; &#160; &#160;protected $customDoctrineTypes = <span class=\"br0\">&#91;<\/span>\n&#160; &#160; &#160; &#160; &#160;EnumType::TYPE =&gt; EnumType::class,\n<span class=\"re8\">+ &#160; &#160; &#160; &#160;PointType::TYPE =&gt; PointType::class,<\/span>\n&#160; &#160; &#160; &#160; &#160;SetType::TYPE =&gt; SetType::class,\n&#160; &#160; &#160;<span class=\"br0\">&#93;<\/span>;\n&#160;\ndiff --git typo3\/sysext\/core\/Classes\/Database\/Schema\/Parser\/AST\/DataType\/PointDataType.php typo3\/sysext\/core\/Classes\/Database\/Schema\/Parser\/AST\/DataType\/PointDataType.php\nnew file mode <span class=\"nu0\">100644<\/span>\nindex 00000000..0222357e\n<span class=\"re3\">--- \/dev\/null<\/span>\n<span class=\"re4\">+++ typo3\/sysext\/core\/Classes\/Database\/Schema\/Parser\/AST\/DataType\/PointDataType.php<\/span>\n<span class=\"re6\">@@ -0,0 +1,32 @@<\/span>\n<span class=\"re8\">+&lt;?php<\/span>\n<span class=\"re8\">+declare<span class=\"br0\">&#40;<\/span>strict_types = <span class=\"nu0\">1<\/span><span class=\"br0\">&#41;<\/span>;<\/span>\n<span class=\"re8\">+<\/span>\n<span class=\"re8\">+namespace TYPO3\\CMS\\Core\\Database\\Schema\\Parser\\AST\\DataType;<\/span>\n<span class=\"re8\">+<\/span>\n<span class=\"re8\">+\/*<\/span>\n<span class=\"re8\">+ * This file is part of the TYPO3 CMS project.<\/span>\n<span class=\"re8\">+ *<\/span>\n<span class=\"re8\">+ * It is free software; you can redistribute it and\/or modify it under<\/span>\n<span class=\"re8\">+ * the terms of the GNU General Public License, either version 2<\/span>\n<span class=\"re8\">+ * of the License, or any later version.<\/span>\n<span class=\"re8\">+ *<\/span>\n<span class=\"re8\">+ * For the full copyright and license information, please read the<\/span>\n<span class=\"re8\">+ * LICENSE.txt file that was distributed with this source code.<\/span>\n<span class=\"re8\">+ *<\/span>\n<span class=\"re8\">+ * The TYPO3 project - inspiring people to share!<\/span>\n<span class=\"re8\">+ *\/<\/span>\n<span class=\"re8\">+<\/span>\n<span class=\"re8\">+\/**<\/span>\n<span class=\"re8\">+ * Node representing the POINT SQL column type<\/span>\n<span class=\"re8\">+ *\/<\/span>\n<span class=\"re8\">+class PointDataType extends AbstractDataType<\/span>\n<span class=\"re8\">+<span class=\"br0\">&#123;<\/span><\/span>\n<span class=\"re8\">+ &#160; &#160;\/**<\/span>\n<span class=\"re8\">+ &#160; &#160; * BlobDataType constructor.<\/span>\n<span class=\"re8\">+ &#160; &#160; *\/<\/span>\n<span class=\"re8\">+ &#160; &#160;public function __construct<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><\/span>\n<span class=\"re8\">+ &#160; &#160;<span class=\"br0\">&#123;<\/span><\/span>\n<span class=\"re8\">+ &#160; &#160; &#160; &#160;\/\/ MySQL BLOB can store 64KB<\/span>\n<span class=\"re8\">+ &#160; &#160; &#160; &#160;$this-&gt;length = <span class=\"nu0\">65535<\/span>;<\/span>\n<span class=\"re8\">+ &#160; &#160;<span class=\"br0\">&#125;<\/span><\/span>\n<span class=\"re8\">+<span class=\"br0\">&#125;<\/span><\/span>\ndiff --git typo3\/sysext\/core\/Classes\/Database\/Schema\/Parser\/Lexer.php typo3\/sysext\/core\/Classes\/Database\/Schema\/Parser\/Lexer.php\nindex 2222583f..<span class=\"re0\">5d106<\/span>b6d <span class=\"nu0\">100644<\/span>\n<span class=\"re3\">--- typo3\/sysext\/core\/Classes\/Database\/Schema\/Parser\/Lexer.php<\/span>\n<span class=\"re4\">+++ typo3\/sysext\/core\/Classes\/Database\/Schema\/Parser\/Lexer.php<\/span>\n<span class=\"re6\">@@ -78,6 +78,8 @@ class Lexer extends \\Doctrine\\Common\\Lexer\\AbstractLexer<\/span>\n&#160; &#160; &#160;const T_SET = <span class=\"nu0\">231<\/span>;\n&#160; &#160; &#160;const T_JSON = <span class=\"nu0\">232<\/span>;\n&#160;\n<span class=\"re8\">+ &#160; &#160;const T_POINT = <span class=\"nu0\">240<\/span>;<\/span>\n<span class=\"re8\">+<\/span>\n&#160; &#160; &#160;\/\/ All keyword tokens should be &gt;= <span class=\"nu0\">300<\/span>\n&#160; &#160; &#160;const T_CREATE = <span class=\"nu0\">300<\/span>;\n&#160; &#160; &#160;const T_TEMPORARY = <span class=\"nu0\">301<\/span>;\ndiff --git typo3\/sysext\/core\/Classes\/Database\/Schema\/Parser\/Parser.php typo3\/sysext\/core\/Classes\/Database\/Schema\/Parser\/Parser.php\nindex 3986fa23..a83714fd <span class=\"nu0\">100644<\/span>\n<span class=\"re3\">--- typo3\/sysext\/core\/Classes\/Database\/Schema\/Parser\/Parser.php<\/span>\n<span class=\"re4\">+++ typo3\/sysext\/core\/Classes\/Database\/Schema\/Parser\/Parser.php<\/span>\n<span class=\"re6\">@@ -970,6 +970,10 @@ protected function columnDataType<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span>: AST\\DataType\\AbstractDataType<\/span>\n&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;$this-&gt;match<span class=\"br0\">&#40;<\/span>Lexer::T_JSON<span class=\"br0\">&#41;<\/span>;\n&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;$dataType = new AST\\DataType\\JsonDataType<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span>;\n&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;break;\n<span class=\"re8\">+ &#160; &#160; &#160; &#160; &#160; &#160;case Lexer::T_POINT:<\/span>\n<span class=\"re8\">+ &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;$this-&gt;match<span class=\"br0\">&#40;<\/span>Lexer::T_POINT<span class=\"br0\">&#41;<\/span>;<\/span>\n<span class=\"re8\">+ &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;$dataType = new AST\\DataType\\PointDataType<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span>;<\/span>\n<span class=\"re8\">+ &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;break;<\/span>\n&#160; &#160; &#160; &#160; &#160; &#160; &#160;default:\n&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;$this-&gt;syntaxError<span class=\"br0\">&#40;<\/span>\n&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;'BIT, TINYINT, SMALLINT, MEDIUMINT, INT, INTEGER, BIGINT, REAL, DOUBLE, FLOAT, DECIMAL, NUMERIC, ' .\ndiff --git typo3\/sysext\/core\/Classes\/Database\/Schema\/Parser\/TableBuilder.php typo3\/sysext\/core\/Classes\/Database\/Schema\/Parser\/TableBuilder.php\nindex 3ce00198..a04f360b <span class=\"nu0\">100644<\/span>\n<span class=\"re3\">--- typo3\/sysext\/core\/Classes\/Database\/Schema\/Parser\/TableBuilder.php<\/span>\n<span class=\"re4\">+++ typo3\/sysext\/core\/Classes\/Database\/Schema\/Parser\/TableBuilder.php<\/span>\n<span class=\"re6\">@@ -31,6 +31,7 @@<\/span>\n&#160;use TYPO3\\CMS\\Core\\Database\\Schema\\Parser\\AST\\IndexColumnName;\n&#160;use TYPO3\\CMS\\Core\\Database\\Schema\\Parser\\AST\\ReferenceDefinition;\n&#160;use TYPO3\\CMS\\Core\\Database\\Schema\\Types\\EnumType;\n<span class=\"re8\">+use TYPO3\\CMS\\Core\\Database\\Schema\\Types\\PointType;<\/span>\n&#160;use TYPO3\\CMS\\Core\\Database\\Schema\\Types\\SetType;\n&#160;use TYPO3\\CMS\\Core\\Utility\\GeneralUtility;\n&#160;\n<span class=\"re6\">@@ -372,6 +373,9 @@ protected function getDoctrineColumnTypeName<span class=\"br0\">&#40;<\/span>DataType\\AbstractDataType $dataType<\/span>\n&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;\/\/ Using a SMALLINT covers the value range and ensures database compatibility.\n&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;$doctrineType = SetType::SMALLINT;\n&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;break;\n<span class=\"re8\">+ &#160; &#160; &#160; &#160; &#160; &#160;case DataType\\PointDataType::class:<\/span>\n<span class=\"re8\">+ &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;$doctrineType = PointType::TYPE;<\/span>\n<span class=\"re8\">+ &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;break;<\/span>\n&#160; &#160; &#160; &#160; &#160; &#160; &#160;default:\n&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;throw new \\RuntimeException<span class=\"br0\">&#40;<\/span>\n&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;'Unsupported data type: ' . get_class<span class=\"br0\">&#40;<\/span>$dataType<span class=\"br0\">&#41;<\/span> . '!',\ndiff --git typo3\/sysext\/core\/Classes\/Database\/Schema\/Types\/PointType.php typo3\/sysext\/core\/Classes\/Database\/Schema\/Types\/PointType.php\nnew file mode <span class=\"nu0\">100644<\/span>\nindex 00000000..540f6bc2\n<span class=\"re3\">--- \/dev\/null<\/span>\n<span class=\"re4\">+++ typo3\/sysext\/core\/Classes\/Database\/Schema\/Types\/PointType.php<\/span>\n<span class=\"re6\">@@ -0,0 +1,50 @@<\/span>\n<span class=\"re8\">+&lt;?php<\/span>\n<span class=\"re8\">+declare<span class=\"br0\">&#40;<\/span>strict_types = <span class=\"nu0\">1<\/span><span class=\"br0\">&#41;<\/span>;<\/span>\n<span class=\"re8\">+namespace TYPO3\\CMS\\Core\\Database\\Schema\\Types;<\/span>\n<span class=\"re8\">+<\/span>\n<span class=\"re8\">+\/*<\/span>\n<span class=\"re8\">+ * This file is part of the TYPO3 CMS project.<\/span>\n<span class=\"re8\">+ *<\/span>\n<span class=\"re8\">+ * It is free software; you can redistribute it and\/or modify it under<\/span>\n<span class=\"re8\">+ * the terms of the GNU General Public License, either version 2<\/span>\n<span class=\"re8\">+ * of the License, or any later version.<\/span>\n<span class=\"re8\">+ *<\/span>\n<span class=\"re8\">+ * For the full copyright and license information, please read the<\/span>\n<span class=\"re8\">+ * LICENSE.txt file that was distributed with this source code.<\/span>\n<span class=\"re8\">+ *<\/span>\n<span class=\"re8\">+ * The TYPO3 project - inspiring people to share!<\/span>\n<span class=\"re8\">+ *\/<\/span>\n<span class=\"re8\">+<\/span>\n<span class=\"re8\">+use Doctrine\\DBAL\\Platforms\\AbstractPlatform;<\/span>\n<span class=\"re8\">+use Doctrine\\DBAL\\Types\\Type;<\/span>\n<span class=\"re8\">+<\/span>\n<span class=\"re8\">+\/**<\/span>\n<span class=\"re8\">+ * Type that maps an TYPE field.<\/span>\n<span class=\"re8\">+ *\/<\/span>\n<span class=\"re8\">+class PointType extends Type<\/span>\n<span class=\"re8\">+<span class=\"br0\">&#123;<\/span><\/span>\n<span class=\"re8\">+ &#160; &#160;const TYPE = 'point';<\/span>\n<span class=\"re8\">+<\/span>\n<span class=\"re8\">+ &#160; &#160;\/**<\/span>\n<span class=\"re8\">+ &#160; &#160; * Gets the SQL declaration snippet for a field of this type.<\/span>\n<span class=\"re8\">+ &#160; &#160; *<\/span>\n<span class=\"re8\">+ &#160; &#160; * @param array $fieldDeclaration The field declaration.<\/span>\n<span class=\"re8\">+ &#160; &#160; * @param \\Doctrine\\DBAL\\Platforms\\AbstractPlatform $platform The currently used database platform.<\/span>\n<span class=\"re8\">+ &#160; &#160; *<\/span>\n<span class=\"re8\">+ &#160; &#160; * @return string<\/span>\n<span class=\"re8\">+ &#160; &#160; *\/<\/span>\n<span class=\"re8\">+ &#160; &#160;public function getSQLDeclaration<span class=\"br0\">&#40;<\/span>array $fieldDeclaration, AbstractPlatform $platform<span class=\"br0\">&#41;<\/span>: string<\/span>\n<span class=\"re8\">+ &#160; &#160;<span class=\"br0\">&#123;<\/span><\/span>\n<span class=\"re8\">+ &#160; &#160; &#160; &#160;return 'POINT';<\/span>\n<span class=\"re8\">+ &#160; &#160;<span class=\"br0\">&#125;<\/span><\/span>\n<span class=\"re8\">+<\/span>\n<span class=\"re8\">+ &#160; &#160;\/**<\/span>\n<span class=\"re8\">+ &#160; &#160; * Gets the name of this type.<\/span>\n<span class=\"re8\">+ &#160; &#160; *<\/span>\n<span class=\"re8\">+ &#160; &#160; * @return string<\/span>\n<span class=\"re8\">+ &#160; &#160; *\/<\/span>\n<span class=\"re8\">+ &#160; &#160;public function getName<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span>: string<\/span>\n<span class=\"re8\">+ &#160; &#160;<span class=\"br0\">&#123;<\/span><\/span>\n<span class=\"re8\">+ &#160; &#160; &#160; &#160;return static::TYPE;<\/span>\n<span class=\"re8\">+ &#160; &#160;<span class=\"br0\">&#125;<\/span><\/span>\n<span class=\"re8\">+<span class=\"br0\">&#125;<\/span><\/span>\n&#160;<\/pre><\/td><\/tr><\/tbody><\/table><\/div>\n <\/div>\n <div class=\"phork-meta\">\n  <a href=\"https:\/\/p.cweiske.de\/709\/rev-raw\/68fd7ced9562310fc8a1d09ef6761cc08ae5d50e\/typo3-point.diff\" style=\"float: right\">view raw source<\/a>\n  <a href=\"https:\/\/p.cweiske.de\/709#typo3-point.diff\">typo3-point.diff<\/a>\n <\/div>\n<\/div>\n<\/div>\n"}
