Permalink
Browse files

Fix for multiple results from subquery

If the table name is the same between multiple schemas, multiple
results get returned from the subquery which causes the query to fail.
  • Loading branch information...
1 parent 9f35d26 commit b6c3abf3c252691cdfa6033f0327dce2badecee7 @Kwal Kwal committed Jan 10, 2013
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/mysql.js
View
@@ -19,6 +19,7 @@ var MySQL = function(credentials){
select column_name from \
information_schema.key_column_usage \
where table_name = ist.table_name \
+ and constraint_schema = ist.table_schema \
and constraint_name = 'PRIMARY' \
) as 'pk' \
from information_schema.tables ist \

0 comments on commit b6c3abf

Please sign in to comment.