[Commits] ba8e630: Disable buffering when writing to mysqld's stdin.

wlad at mariadb.com wlad at mariadb.com
Wed Dec 2 19:20:01 EET 2015


revision-id: ba8e630d97af2b2ed3e527070f1cab05571911fd (mariadb-10.0.22-33-gba8e630)
parent(s): 3bae880887b7191711e02f206e9b559819fa7b45
committer: Vladislav Vaintroub
timestamp: 2015-12-02 18:19:43 +0100
message:

Disable buffering when writing to mysqld's stdin.

Due to a bug in Visual Studio 2015 runtime, some newlines get lost
which makes the bootstrapping fail (which also makes MSI installer
non-functional).

This does not have a visible effect on packages we produce so far,
because we do not use VS2015 yet for building them.

---
 sql/mysql_install_db.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sql/mysql_install_db.cc b/sql/mysql_install_db.cc
index 50454f0..9b4f45a 100644
--- a/sql/mysql_install_db.cc
+++ b/sql/mysql_install_db.cc
@@ -563,6 +563,10 @@ static int create_db_instance()
   if (!in)
     goto end;
 
+  if (setvbuf(in, NULL, _IONBF, 0))
+  {
+    verbose("WARNING: Cannot disable buffering on mysqld's stdin");
+  }
   if (fwrite("use mysql;\n",11,1, in) != 1)
   {
     verbose("ERROR: Cannot write to mysqld's stdin");


More information about the commits mailing list