Commit 658de93d authored by Ralf Habacker's avatar Ralf Habacker

Add parse support for mysql 'CHARACTER SET <format>'.

Currently we ignore the parsed character set because
class UMLEntityAttribute, UMLEntityAttributeDialog
and MySQLWriter do not support it.

CCBUG:353668
parent 6aabd97e
......@@ -290,6 +290,7 @@ QString SQLImport::parseDefaultExpression(QString &token)
* [ CONSTRAINT constraint_name ]
* { NOT NULL |
* NULL |
* CHARACTER SET <format> |
* CHECK ( expression ) |
* DEFAULT default_expr |
* UNIQUE index_parameters |
......@@ -311,6 +312,18 @@ SQLImport::ColumnConstraints SQLImport::parseColumnConstraints(QString &token)
int index = m_srcIndex;
while(token != QLatin1String(",") && token != QLatin1String(")")) {
if (token.toLower() == QLatin1String("character")) { // mysql
token = advance(); // set
if (token.toLower() == QLatin1String("set")) {
constraints.characterSet = advance(); // <value>
token = advance();
}
else {
m_srcIndex--; // take back
token = m_source[m_srcIndex];
}
}
if (token.toLower() == QLatin1String("collate")) { // mysql
constraints.collate = advance();
token = advance();
......
......@@ -59,6 +59,7 @@ protected:
QString collate;
QString defaultValue;
QString constraintName;
QString characterSet;
};
class TableConstraints {
......
Markdown is supported
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