MariaDB server is a community developed fork of MySQL server. Started by core members of the original MySQL team, MariaDB actively works with outside developers to deliver the most featureful, stable, and sanely licensed open SQL server in the industry.
Find a file
anozdrin/alik@quad. d3575ce0e4 A fix for Bug#35289: Too many connections -- wrong SQL state
in some case.

ER_CON_COUNT_ERROR is defined with SQL state 08004. However, this SQL state is not always
returned.

This error can be thrown in two cases:

  1. when an ordinary user (a user w/o SUPER privilege) is connecting,
    and the number of active user connections is equal or greater than
    max_connections.

  2. when a user is connecting and the number of active user connections is
    already (max_connections + 1) -- that means that no more connections will
    be accepted regardless of the user credentials.

In the 1-st case, SQL state is correct.

The bug happens in the 2-nd case -- on UNIX the client gets 00000 SQL state, which is
absolutely wrong (00000 means "not error SQL state); on Windows
the client accidentally gets HY000 (which means "unknown SQL state).

The cause of the problem is that the server rejects extra connection
prior to read a packet with client capabilities. Thus, the server
does not know if the client supports SQL states or not (if the client
supports 4.1 protocol or not). So, the server supposes the worst and
does not send SQL state at all.

The difference in behavior on UNIX and Windows occurs because on Windows
CLI_MYSQL_REAL_CONNECT() invokes create_shared_memory(), which returns
an error (in default configuration, where shared memory is not configured).
Then, the client does not reset this error, so when the connection is
rejected, SQL state is HY000 (from the error from create_shared_memory()).

The bug appeared after test case for Bug#33507 -- before that, this behavior
just had not been tested.

The fix is to 1) reset the error after create_shared_memory();
2) set SQL state to 'unknown error' if it was not received from
the server.

A separate test case is not required, since the behavior is already
tested in connect.test.

Note for doc-team: the manual should be updated to say that under
some circumstances, 'Too many connections' has HY000 SQL state.
2008-03-14 15:58:27 +03:00
BitKeeper Merge trift2.:/MySQL/M51/mysql-5.1 2008-01-28 15:16:40 +01:00
BUILD Merge trift2.:/MySQL/M51/clone-5.1 2008-02-13 13:40:53 +01:00
client Merge quad.:/mnt/raid/alik/MySQL/devel/5.1 2008-02-26 19:34:02 +03:00
cmd-line-utils Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build 2008-01-23 17:43:46 +01:00
config/ac-macros ha_ndbcluster.m4: 2008-02-12 19:08:04 +01:00
dbug Bug#34424 query_cache_debug.test leads to valgrind warnings 2008-02-26 12:03:59 -03:00
Docs ReadMe.txt, INSTALL-WIN-SOURCE, INSTALL-BINARY, INSTALL-SOURCE: 2007-11-23 10:15:55 +01:00
extra Merge bk-internal.mysql.com:/home/bk/mysql-5.1-build 2008-02-21 19:53:37 -05:00
include Bug#34655 Compile error 2008-02-28 14:55:46 -03:00
libmysql Bug#34655 Compile error 2008-02-28 14:55:46 -03:00
libmysql_r Makefile.am: 2007-10-08 20:55:44 +02:00
libmysqld Bug#34655 Compile error 2008-02-28 14:55:46 -03:00
man my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
mysql-test A fix for Bug#35289: Too many connections -- wrong SQL state 2008-03-14 15:58:27 +03:00
mysys Merge quad.:/mnt/raid/alik/MySQL/devel/5.1 2008-02-26 19:34:02 +03:00
netware Merge trift2.:/MySQL/M50/merge-5.0 2007-12-21 13:13:22 +01:00
plugin Makefile.am: 2007-09-26 18:47:55 +02:00
pstack Makefile.am, configure.in: 2007-09-27 21:39:23 +02:00
regex Fix for server bug experienced in Maria (wrong "Truncated incorrect <var_name> 2008-02-18 23:29:39 +01:00
scripts Merge ramayana.hindu.god:/home/tsmith/m/bk/build/50 2008-02-22 17:08:01 -07:00
server-tools Bug#34655 Compile error 2008-02-28 14:55:46 -03:00
sql Merge quad.:/mnt/raid/alik/MySQL/devel/5.1-rt 2008-03-13 20:45:18 +03:00
sql-bench Fixed compiler warnings 2007-02-23 13:13:55 +02:00
sql-common A fix for Bug#35289: Too many connections -- wrong SQL state 2008-03-14 15:58:27 +03:00
storage Fix for Bug #34786 Compiling ndb on Mac OS X 10.5.2 (Intel) fails 2008-03-05 14:57:13 +01:00
strings Merge mhansson@bk-internal:/home/bk/mysql-5.1-opt 2008-01-17 18:36:04 +01:00
support-files Merge trift2.:/MySQL/M51/mysql-5.1 2008-02-22 16:14:27 +01:00
tests Merge quad.:/mnt/raid/alik/MySQL/devel/5.0-rt 2008-03-12 15:52:38 +03:00
unittest Fix for server bug experienced in Maria (wrong "Truncated incorrect <var_name> 2008-02-18 23:29:39 +01:00
vio Merge bk-internal.mysql.com:/home/bk/mysql-5.1-build 2008-02-21 19:53:37 -05:00
win Merge ramayana.hindu.god:/home/tsmith/m/bk/51 2007-09-28 10:55:28 -06:00
zlib CMakeLists.txt, README, configure.js 2007-08-03 21:51:37 +02:00
.bzrignore Patch for bug#32664: event.test has timeout randomly. File is split into event_1.test and event_2.test. 2008-02-20 14:40:46 +01:00
.cvsignore Import changeset 2000-07-31 21:29:14 +02:00
CMakeLists.txt Merge alf.(none):/src/bug31319/my50-bug31319 2007-11-02 15:17:37 -04:00
configure.in Merge trift2.:/MySQL/M51/mysql-5.1 2008-02-13 13:05:07 +01:00
COPYING - manual.texi will be replaced with a manual written in DocBook/XML. This ChangeSet removes all 2005-04-13 11:51:38 +02:00
EXCEPTIONS-CLIENT EXCEPTIONS-CLIENT: 2007-03-14 18:28:16 +01:00
INSTALL-SOURCE ReadMe.txt, INSTALL-WIN-SOURCE, INSTALL-BINARY, INSTALL-SOURCE: 2007-11-23 10:15:55 +01:00
INSTALL-WIN-SOURCE ReadMe.txt, INSTALL-WIN-SOURCE, INSTALL-BINARY, INSTALL-SOURCE: 2007-11-23 10:15:55 +01:00
Makefile.am Merge debian.(none):/MySQL/M51/indent-5.1 2007-12-11 20:50:09 +01:00
README make_binary_distribution.sh: 2006-11-07 22:26:37 +01:00

This is a release of MySQL, a dual-license SQL database server.
MySQL is brought to you by the MySQL team at MySQL AB.

License information can be found in these files:
- For GPL (free) distributions, see the COPYING file and
  the EXCEPTIONS-CLIENT file.
- For commercial distributions, see the LICENSE.mysql file.


For further information about MySQL or additional documentation, see:
- The latest information about MySQL: http://www.mysql.com
- The current MySQL documentation: http://dev.mysql.com/doc

Some manual sections of special interest:

- If you are migrating from an older version of MySQL, please read the
  "Upgrading from..." section first!
- To see what MySQL can do, take a look at the features section.
- For installation instructions, see the Installing and Upgrading chapter.
- For the new features/bugfix history, see the Change History appendix.
- For the currently known bugs/misfeatures (known errors) see the Problems
  and Common Errors appendix.
- For a list of developers and other contributors, see the Credits
  appendix.

A local copy of the MySQL Reference Manual can be found in the Docs
directory in GNU Info format.  You can also browse the manual online or
download it in any of several formats at the URL given earlier in this
file.

************************************************************

IMPORTANT:

Bug or error reports should be sent to http://bugs.mysql.com.