Skip to content

Commit fb2510a

Browse files
committed
fk support removed
1 parent 20620da commit fb2510a

File tree

3 files changed

+11
-30
lines changed

3 files changed

+11
-30
lines changed

src/MySQLReplication/Event/RowEvent/Columns.php

+1-8
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,7 @@ public static function parse($columnType, array $columnSchema, BinaryDataReader
3535
self::$field['unsigned'] = !(stripos($columnSchema['COLUMN_TYPE'], 'unsigned') === false);
3636
self::$field['type_is_bool'] = false;
3737
self::$field['is_primary'] = $columnSchema['COLUMN_KEY'] === 'PRI';
38-
self::$field['is_foreign'] = null !== $columnSchema['REFERENCED_TABLE_NAME'] && null !== $columnSchema['REFERENCED_COLUMN_NAME'];
39-
40-
if (self::$field['is_foreign'])
41-
{
42-
self::$field['referenced_table_name'] = $columnSchema['REFERENCED_TABLE_NAME'];
43-
self::$field['referenced_column_name'] = $columnSchema['REFERENCED_COLUMN_NAME'];
44-
}
45-
38+
4639
if (self::$field['type'] === ConstFieldType::VARCHAR)
4740
{
4841
self::$field['max_length'] = $binaryDataReader->readInt16();

src/MySQLReplication/Event/RowEvent/RowEvent.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,7 @@ public function makeTableMapDTO()
161161
'CHARACTER_SET_NAME' => null,
162162
'COLUMN_COMMENT' => null,
163163
'COLUMN_TYPE' => 'BLOB',
164-
'COLUMN_KEY' => '',
165-
'REFERENCED_TABLE_NAME' => '',
166-
'REFERENCED_COLUMN_NAME' => '',
164+
'COLUMN_KEY' => ''
167165
];
168166

169167
$type = ConstFieldType::IGNORE;

src/MySQLReplication/Repository/MySQLRepository.php

+9-19
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,18 @@ public function getFields($schema, $table)
3434
{
3535
$sql = '
3636
SELECT
37-
c.`COLUMN_NAME`,
38-
c.`COLLATION_NAME`,
39-
c.`CHARACTER_SET_NAME`,
40-
c.`COLUMN_COMMENT`,
41-
c.`COLUMN_TYPE`,
42-
c.`COLUMN_KEY`,
43-
`kcu`.`REFERENCED_TABLE_NAME`,
44-
`kcu`.`REFERENCED_COLUMN_NAME`
37+
`COLUMN_NAME`,
38+
`COLLATION_NAME`,
39+
`CHARACTER_SET_NAME`,
40+
`COLUMN_COMMENT`,
41+
`COLUMN_TYPE`,
42+
`COLUMN_KEY`
4543
FROM
46-
`information_schema`.`COLUMNS` c
47-
LEFT JOIN
48-
`information_schema`.KEY_COLUMN_USAGE kcu
49-
ON
50-
c.`TABLE_SCHEMA` = kcu.`TABLE_SCHEMA`
51-
AND
52-
c.`TABLE_NAME` = kcu.`TABLE_NAME`
53-
AND
54-
c.`COLUMN_NAME` = kcu.`COLUMN_NAME`
44+
`information_schema`.`COLUMNS`
5545
WHERE
56-
c.`TABLE_SCHEMA` = ?
46+
`TABLE_SCHEMA` = ?
5747
AND
58-
c.`TABLE_NAME` = ?
48+
`TABLE_NAME` = ?
5949
';
6050

6151
return $this->getConnection()->fetchAll($sql, [$schema, $table]);

0 commit comments

Comments
 (0)