bug 760648 export SELECT DISTINCT results
This commit is contained in:
@@ -7,6 +7,8 @@ $Source$
|
|||||||
|
|
||||||
2003-06-25 Marc Delisle <lem9@users.sourceforge.net>
|
2003-06-25 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* scripts/create-release.sh: typo, bzip should be bzip2
|
* scripts/create-release.sh: typo, bzip should be bzip2
|
||||||
|
* libraries/sqlparser.lib.php3, tbl_properties_export.php3:
|
||||||
|
bug 760648 export SELECT DISTINCT results
|
||||||
|
|
||||||
2003-06-25 Michal Cihar <nijel@users.sourceforge.net>
|
2003-06-25 Michal Cihar <nijel@users.sourceforge.net>
|
||||||
* libraries/sqlparser.lib.php3: Fixed XSS problem.
|
* libraries/sqlparser.lib.php3: Fixed XSS problem.
|
||||||
|
@@ -711,6 +711,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
|
|||||||
*
|
*
|
||||||
* ['queryflags']['need_confirm'] = 1; if the query needs confirmation
|
* ['queryflags']['need_confirm'] = 1; if the query needs confirmation
|
||||||
* ['queryflags']['select_from'] = 1; if this is a real SELECT...FROM
|
* ['queryflags']['select_from'] = 1; if this is a real SELECT...FROM
|
||||||
|
* ['queryflags']['distinct'] = 1; for a DISTINCT
|
||||||
*
|
*
|
||||||
* lem9: query clauses
|
* lem9: query clauses
|
||||||
* -------------
|
* -------------
|
||||||
@@ -1213,6 +1214,9 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
|
|||||||
$in_select_expr = TRUE;
|
$in_select_expr = TRUE;
|
||||||
$select_expr_clause = '';
|
$select_expr_clause = '';
|
||||||
}
|
}
|
||||||
|
if ($upper_data == 'DISTINCT') {
|
||||||
|
$subresult['queryflags']['distinct'] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
// if this is a real SELECT...FROM
|
// if this is a real SELECT...FROM
|
||||||
if ($upper_data == 'FROM' && isset($subresult['queryflags']['select_from']) && $subresult['queryflags']['select_from'] == 1) {
|
if ($upper_data == 'FROM' && isset($subresult['queryflags']['select_from']) && $subresult['queryflags']['select_from'] == 1) {
|
||||||
|
@@ -27,7 +27,13 @@ if (isset($sql_query)) {
|
|||||||
|
|
||||||
$parsed_sql = PMA_SQP_parse($sql_query);
|
$parsed_sql = PMA_SQP_parse($sql_query);
|
||||||
$analyzed_sql = PMA_SQP_analyze($parsed_sql);
|
$analyzed_sql = PMA_SQP_analyze($parsed_sql);
|
||||||
$sql_query = 'SELECT ' . $analyzed_sql[0]['select_expr_clause'];
|
$sql_query = 'SELECT ';
|
||||||
|
|
||||||
|
if (isset($analyzed_sql[0]['queryflags']['distinct'])) {
|
||||||
|
$sql_query .= ' DISTINCT ';
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql_query .= $analyzed_sql[0]['select_expr_clause'];
|
||||||
|
|
||||||
if (!empty($analyzed_sql[0]['from_clause'])) {
|
if (!empty($analyzed_sql[0]['from_clause'])) {
|
||||||
$sql_query .= ' FROM ' . $analyzed_sql[0]['from_clause'];
|
$sql_query .= ' FROM ' . $analyzed_sql[0]['from_clause'];
|
||||||
|
Reference in New Issue
Block a user