Use buildTableConstraint instead of buildSchemaConstraint to find the datatype of a column if using a table from a different database schema

(cherry picked from commit b450b778cb)
This commit is contained in:
Dominik Henneke
2018-12-10 14:32:55 +01:00
committed by Torkel Ödegaard
parent 80ecd8ea8e
commit 9699133501
@@ -151,8 +151,7 @@ table_schema IN (
buildDatatypeQuery(column: string) {
let query = 'SELECT udt_name FROM information_schema.columns WHERE ';
query += this.buildSchemaConstraint();
query += ' AND table_name = ' + this.quoteIdentAsLiteral(this.target.table);
query += this.buildTableConstraint(this.target.table);
query += ' AND column_name = ' + this.quoteIdentAsLiteral(column);
return query;
}