MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Chad MILLER Date:October 9 2006 10:55pm
Subject:bk commit into 5.1 tree (cmiller:1.2356)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of cmiller. When cmiller does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-10-09 18:55:09-04:00, cmiller@stripped +4 -0
  Merge bk-internal.mysql.com:/home/bk/mysql-5.1-maint
  into  zippy.cornsilk.net:/home/cmiller/work/mysql/bug17583/my51-bug17583
  MERGE: 1.2340.2.1

  BitKeeper/etc/collapsed@stripped, 2006-10-09 18:54:37-04:00, cmiller@stripped +0 -0
    auto-union
    MERGE: 1.8.2.1

  client/mysql.cc@stripped, 2006-10-09 18:54:55-04:00, cmiller@stripped +0 -0
    Auto merged
    MERGE: 1.234.1.1

  mysql-test/r/mysql.result@stripped, 2006-10-09 18:54:56-04:00, cmiller@stripped +0 -0
    Auto merged
    MERGE: 1.15.1.3

  mysql-test/t/mysql.test@stripped, 2006-10-09 18:54:56-04:00, cmiller@stripped +0 -0
    Auto merged
    MERGE: 1.20.1.1

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	cmiller
# Host:	zippy.cornsilk.net
# Root:	/home/cmiller/work/mysql/bug17583/my51-bug17583/RESYNC

--- 1.235/client/mysql.cc	2006-10-09 18:55:19 -04:00
+++ 1.236/client/mysql.cc	2006-10-09 18:55:19 -04:00
@@ -386,6 +386,21 @@ int main(int argc,char *argv[])
   else
     status.add_to_history=1;
   status.exit_status=1;
+
+  {
+    /* 
+     The file descriptor-layer may be out-of-sync with the file-number layer,
+     so we make sure that "stdout" is really open.  If its file is closed then
+     explicitly close the FD layer. 
+    */
+    int stdout_fileno_copy;
+    stdout_fileno_copy= dup(fileno(stdout)); /* Okay if fileno fails. */
+    if (stdout_fileno_copy == -1)
+      fclose(stdout);
+    else
+      close(stdout_fileno_copy);             /* Clean up dup(). */
+  }
+
   load_defaults("my",load_default_groups,&argc,&argv);
   defaults_argv=argv;
   if (get_options(argc, (char **) argv))

--- 1.11/BitKeeper/etc/collapsed	2006-10-09 18:55:19 -04:00
+++ 1.12/BitKeeper/etc/collapsed	2006-10-09 18:55:19 -04:00
@@ -9,3 +9,4 @@
 451ab499rgdjXyOnUDqHu-wBDoS-OQ
 45214442pBGT9KuZEGixBH71jTzbOA
 45214a07hVsIGwvwa-WrO-jpeaSwVw
+452a92d0-31-8wSzSfZi165fcGcXPA

--- 1.18/mysql-test/r/mysql.result	2006-10-09 18:55:19 -04:00
+++ 1.19/mysql-test/r/mysql.result	2006-10-09 18:55:19 -04:00
@@ -149,4 +149,17 @@ ERROR at line 1: USE must be followed by
 \\
 ';
 ';
+create table t17583 (a int);
+insert into t17583 (a) values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+insert into t17583 select a from t17583;
+insert into t17583 select a from t17583;
+insert into t17583 select a from t17583;
+insert into t17583 select a from t17583;
+insert into t17583 select a from t17583;
+insert into t17583 select a from t17583;
+insert into t17583 select a from t17583;
+select count(*) from t17583;
+count(*)
+1280
+drop table t17583;
 End of 5.0 tests

--- 1.21/mysql-test/t/mysql.test	2006-10-09 18:55:19 -04:00
+++ 1.22/mysql-test/t/mysql.test	2006-10-09 18:55:19 -04:00
@@ -153,4 +153,21 @@ drop table t1;
 --exec echo "SELECT '\';';" >> $MYSQLTEST_VARDIR/tmp/bug20103.sql
 --exec $MYSQL              < $MYSQLTEST_VARDIR/tmp/bug20103.sql 2>&1
 
+#
+# Bug#17583: mysql drops connection when stdout is not writable
+#
+create table t17583 (a int);
+insert into t17583 (a) values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+insert into t17583 select a from t17583;
+insert into t17583 select a from t17583;
+insert into t17583 select a from t17583;
+insert into t17583 select a from t17583;
+insert into t17583 select a from t17583;
+insert into t17583 select a from t17583;
+insert into t17583 select a from t17583;
+# Close to the minimal data needed to exercise bug.
+select count(*) from t17583;
+--exec echo "select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; " |$MYSQL test >&-
+drop table t17583;
+
 --echo End of 5.0 tests
Thread
bk commit into 5.1 tree (cmiller:1.2356)Chad MILLER10 Oct