diff options
author | unknown <bar@mysql.com> | 2004-09-15 13:26:47 +0500 |
---|---|---|
committer | unknown <bar@mysql.com> | 2004-09-15 13:26:47 +0500 |
commit | 2c742dba63e2a6ac0240fa81d64bf4b3c4cb3dab (patch) | |
tree | b7ccb5a1bff3880016b9d15612d97126720c1475 /client | |
parent | 63bb02128de898e0c62da112ba33e95c2c48aaec (diff) | |
download | mariadb-git-2c742dba63e2a6ac0240fa81d64bf4b3c4cb3dab.tar.gz |
mysql.cc:
SQL_SELECT_LIMIT=0 protection
client/mysql.cc:
SQL_SELECT_LIMIT=0 protection
Diffstat (limited to 'client')
-rw-r--r-- | client/mysql.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index 643e0dcfaae..1afcda6476c 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2842,6 +2842,10 @@ com_status(String *buffer __attribute__((unused)), if (connected) { tee_fprintf(stdout, "\nConnection id:\t\t%lu\n",mysql_thread_id(&mysql)); + /* + Don't remove "limit 1", + it is protection againts SQL_SELECT_LIMIT=0 + */ if (!mysql_query(&mysql,"select DATABASE(), USER() limit 1") && (result=mysql_use_result(&mysql))) { @@ -2886,7 +2890,11 @@ com_status(String *buffer __attribute__((unused)), if ((id= mysql_insert_id(&mysql))) tee_fprintf(stdout, "Insert id:\t\t%s\n", llstr(id, buff)); - if (!mysql_query(&mysql,"select @@character_set_client, @@character_set_connection, @@character_set_server, @@character_set_database") && + /* + Don't remove "limit 1", + it is protection againts SQL_SELECT_LIMIT=0 + */ + if (!mysql_query(&mysql,"select @@character_set_client, @@character_set_connection, @@character_set_server, @@character_set_database limit 1") && (result=mysql_use_result(&mysql))) { MYSQL_ROW cur=mysql_fetch_row(result); |