diff --git a/Docs/INSTALL-BINARY b/Docs/INSTALL-BINARY index c33d23674d6..499a8adf411 100644 --- a/Docs/INSTALL-BINARY +++ b/Docs/INSTALL-BINARY @@ -1,25 +1,20 @@ +MariaDB and MySQL have identical install methods. In this document we +describe how to install MariaDB; However all documentation at www.mysql.com +also applies. -2.9. Installing MySQL from tar.gz Packages on Other Unix-Like Systems - This section covers the installation of MySQL binary distributions +2.9. Installing MariaDB from tar.gz Packages on Other Unix-Like Systems + + This section covers the installation of MariaDB binary distributions that are provided for various platforms in the form of compressed - tar files (files with a .tar.gz extension). See Section 2.1.2.4, - "MySQL Binaries Compiled by Sun Microsystems, Inc.," for a - detailed list. + tar files (files with a .tar.gz extension). - To obtain MySQL, see Section 2.1.3, "How to Get MySQL." - - MySQL tar file binary distributions have names of the form - mysql-VERSION-OS.tar.gz, where VERSION is a number (for example, + MariaDB tar file binary distributions have names of the form + mariadb-VERSION-OS.tar.gz, where VERSION is a number (for example, 5.1.39), and OS indicates the type of operating system for which the distribution is intended (for example, pc-linux-i686). - In addition to these generic packages, we also offer binaries in - platform-specific package formats for selected platforms. See - Section 2.2, "Standard MySQL Installation Using a Binary - Distribution," for more information on how to install these. - - You need the following tools to install a MySQL tar file binary + You need the following tools to install a MariaDB tar file binary distribution: * GNU gunzip to uncompress the distribution. @@ -33,11 +28,14 @@ program. On other systems with a deficient tar, you should install GNU tar first. - If you run into problems and need to file a bug report, please use - the instructions in Section 1.6, "How to Report Bugs or Problems." + If you run into problems and need to file a bug report, + please report them to: http://bugs.launchpad.net/maria + + See the instructions in Section 1.6, "How to Report Bugs or Problems." The basic commands that you must execute to install and use a - MySQL binary distribution are: + MariaDB binary distribution are: + shell> groupadd mysql shell> useradd -g mysql mysql shell> cd /usr/local @@ -53,7 +51,7 @@ shell> bin/mysqld_safe --user=mysql & Note - This procedure does not set up any passwords for MySQL accounts. + This procedure does not set up any passwords for MariaDB accounts. After following the procedure, proceed to Section 2.11, "Post-Installation Setup and Testing." @@ -80,8 +78,8 @@ shell> useradd -g mysql mysql shell> cd /usr/local 3. Obtain a distribution file using the instructions in Section - 2.1.3, "How to Get MySQL." For a given release, binary - distributions for all platforms are built from the same MySQL + 2.1.3, "How to Get MariaDB." For a given release, binary + distributions for all platforms are built from the same MariaDB source distribution. 4. Unpack the distribution, which creates the installation @@ -106,7 +104,7 @@ shell> cd mysql + The bin directory contains client programs and the server. You should add the full path name of this directory to your PATH environment variable so that your - shell finds the MySQL programs properly. See Section + shell finds the MariaDB programs properly. See Section 2.14, "Environment Variables." + The scripts directory contains the mysql_install_db @@ -126,8 +124,8 @@ shell> chgrp -R mysql . the mysql user. The second changes the group attribute to the mysql group. - 7. If you have not installed MySQL before, you must create the - MySQL data directory and initialize the grant tables: + 7. If you have not installed MariaDB before, you must create the + MariaDB data directory and initialize the grant tables: shell> scripts/mysql_install_db --user=mysql If you run the command as root, include the --user option as shown. If you run the command while logged in as that user, @@ -137,25 +135,26 @@ shell> scripts/mysql_install_db --user=mysql After creating or updating the grant tables, you need to restart the server manually. - 8. Most of the MySQL installation can be owned by root if you + 8. Most of the MariaDB installation can be owned by root if you like. The exception is that the data directory must be owned by mysql. To accomplish this, run the following commands as root in the installation directory: + shell> chown -R root . shell> chown -R mysql data - 9. If you want MySQL to start automatically when you boot your + 9. If you want MariaDB to start automatically when you boot your machine, you can copy support-files/mysql.server to the location where your system has its startup files. More information can be found in the support-files/mysql.server script itself and in Section 2.11.2.2, "Starting and Stopping - MySQL Automatically." + MariaDB Automatically." 10. You can set up new accounts using the bin/mysql_setpermission script if you install the DBI and DBD::mysql Perl modules. See Section 4.6.14, "mysql_setpermission --- Interactively Set Permissions in Grant Tables." For Perl module installation instructions, see Section 2.15, "Perl Installation Notes." - 11. If you would like to use mysqlaccess and have the MySQL + 11. If you would like to use mysqlaccess and have the MariaDB distribution in some nonstandard location, you must change the location where mysqlaccess expects to find the mysql client. Edit the bin/mysqlaccess script at approximately line 18. @@ -166,7 +165,7 @@ $MYSQL = '/usr/local/bin/mysql'; # path to mysql executable error will occur when you run mysqlaccess. After everything has been unpacked and installed, you should test - your distribution. To start the MySQL server, use the following + your distribution. To start the MariaDB server, use the following command: shell> bin/mysqld_safe --user=mysql & @@ -185,7 +184,7 @@ shell> bin/mysqld_safe --user=mysql & Note - The accounts that are listed in the MySQL grant tables initially + The accounts that are listed in the MariaDB grant tables initially have no passwords. After starting the server, you should set up passwords for them using the instructions in Section 2.11, "Post-Installation Setup and Testing." diff --git a/Docs/myisam.txt b/Docs/myisam.txt index e0b56e79548..ceb4ae7dc0b 100644 --- a/Docs/myisam.txt +++ b/Docs/myisam.txt @@ -868,7 +868,7 @@ Space compression makes the index file smaller if the string column has a lot of Prefix compression helps if there are many strings with an identical prefix. In memory table characteristics -HEAP tables only exists in memory so they are lost if `mysqld' is taken down or crashes. But since they are *very* fast they are usefull as anyway. +HEAP tables only exists in memory so they are lost if `mysqld' is taken down or crashes. But since they are *very* fast they are useful as anyway. The *MySQL* internal HEAP tables uses 100% dynamic hashing without overflow areas and don't have problems with delete. diff --git a/Docs/mysql.info b/Docs/mysql.info index b2c411e51ab..3b9d298a684 100644 --- a/Docs/mysql.info +++ b/Docs/mysql.info @@ -1,3 +1,10 @@ +MariaDB is in most aspects identical to MySQL. + +Differences between MySQL and MariaDB can be found at: +http://askmonty.org/wiki/index.php/MariaDB_versus_MySQL + +The MariaDB references manual can be found at: +http://askmonty.org/wiki/index.php/Manual The MySQL Reference Manual is available in various formats on http://dev.mysql.com/doc; if you're interested in the DocBook XML diff --git a/README b/README index fb6d8a8abcf..7ad036784dd 100644 --- a/README +++ b/README @@ -1,5 +1,4 @@ This is a release of MariaDB, a branch of MySQL. -MySQL is brought to you by the MySQL team at Sun Microsystems, Inc. MariaDB is a drop-in replacement of MySQL, with more features, less bugs and better performance. diff --git a/client/mysql.cc b/client/mysql.cc index f95b0912a56..358c27677e2 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -3812,8 +3812,9 @@ static int com_edit(String *buffer,char *line __attribute__((unused))) { char filename[FN_REFLEN],buff[160]; - int fd,tmp; + int fd,tmp,error; const char *editor; + MY_STAT stat_arg; if ((fd=create_temp_file(filename,NullS,"sql", O_CREAT | O_WRONLY, MYF(MY_WME))) < 0) @@ -3829,9 +3830,13 @@ com_edit(String *buffer,char *line __attribute__((unused))) !(editor = (char *)getenv("VISUAL"))) editor = "vi"; strxmov(buff,editor," ",filename,NullS); - (void) system(buff); + if ((error= system(buff))) + { + char errmsg[100]; + sprintf(errmsg, "Command '%.40s' failed", buff); + put_info(errmsg, INFO_ERROR, 0, NullS); + } - MY_STAT stat_arg; if (!my_stat(filename,&stat_arg,MYF(MY_WME))) goto err; if ((fd = my_open(filename,O_RDONLY, MYF(MY_WME))) < 0) diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 645fb037647..f44edf89081 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -559,12 +559,11 @@ static int upgrade_already_done(void) if (!(in= my_fopen(upgrade_info_file, O_RDONLY, MYF(0)))) return 0; /* Could not open file => not sure */ - /* - Read from file, don't care if it fails since it - will be detected by the strncmp - */ bzero(buf, sizeof(buf)); - fgets(buf, sizeof(buf), in); + if (!fgets(buf, sizeof(buf), in)) + { + /* Ignore, will be detected by strncmp() below */ + } my_fclose(in, MYF(0)); diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 3b156dcee93..be83c75b2de 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -1136,8 +1136,8 @@ static int drop_db(MYSQL *mysql, const char *db) puts("Any data stored in the database will be destroyed.\n"); printf("Do you really want to drop the '%s' database [y/N] ",db); fflush(stdout); - VOID(fgets(buf,sizeof(buf)-1,stdin)); - if ((*buf != 'y') && (*buf != 'Y')) + if (fgets(buf,sizeof(buf)-1,stdin) == 0 || + (*buf != 'y') && (*buf != 'Y')) { puts("\nOK, aborting database drop!"); return -1; diff --git a/client/mysqlslap.c b/client/mysqlslap.c index a154b680324..2dba157dd78 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -472,7 +472,7 @@ void concurrency_loop(MYSQL *mysql, uint current, option_string *eptr) run_query(mysql, "SET AUTOCOMMIT=0", strlen("SET AUTOCOMMIT=0")); if (pre_system) - system(pre_system); + if (system(pre_system)) { /* Ignore for now */ } /* Pre statements are always run after all other logic so they can @@ -487,7 +487,7 @@ void concurrency_loop(MYSQL *mysql, uint current, option_string *eptr) run_statements(mysql, post_statements); if (post_system) - system(post_system); + if (system(post_system)) { /* Ignore for now */ } /* We are finished with this run */ if (auto_generate_sql_autoincrement || auto_generate_sql_guid_primary) diff --git a/configure.in b/configure.in index 69cf7dd3e41..34b655773f4 100644 --- a/configure.in +++ b/configure.in @@ -15,7 +15,7 @@ AC_CANONICAL_SYSTEM # MySQL version number. # # Note: the following line must be parseable by win/configure.js:GetVersion() -AM_INIT_AUTOMAKE(mysql, 5.2.0-alpha) +AM_INIT_AUTOMAKE(mysql, 5.2.0-MariaDB-alpha) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10 @@ -2858,7 +2858,7 @@ do done AC_SUBST(sql_union_dirs) -# Some usefull subst +# Some useful subst AC_SUBST(CC) AC_SUBST(GXX) @@ -2908,13 +2908,11 @@ AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' C AC_OUTPUT echo -echo "MySQL has a Web site at http://www.mysql.com/ which carries details on the" -echo "latest release, upcoming features, and other information to make your" -echo "work or play with MySQL more productive. There you can also find" -echo "information about mailing lists for MySQL discussion." +echo "You can find information about MariaDB at" +echo http://askmonty.org/wiki/index.php/MariaDB echo echo "Remember to check the platform specific part of the reference manual for" -echo "hints about installing MySQL on your platform. Also have a look at the" +echo "hints about installing MariaDB on your platform. Also have a look at the" echo "files in the Docs directory." echo @@ -2933,5 +2931,5 @@ echo "---" # The following text is checked in ./Do-compile to verify that configure # ended sucessfully - don't remove it. -echo "Thank you for choosing MySQL!" +echo "Thank you for choosing MariaDB!" echo diff --git a/extra/yassl/src/crypto_wrapper.cpp b/extra/yassl/src/crypto_wrapper.cpp index 28d7f1b5693..09afc835fce 100644 --- a/extra/yassl/src/crypto_wrapper.cpp +++ b/extra/yassl/src/crypto_wrapper.cpp @@ -953,7 +953,11 @@ x509* PemToDer(FILE* file, CertType type, EncryptedInfo* info) info->set = true; } } - fgets(line,sizeof(line), file); // get blank line + // get blank line + if (fgets(line,sizeof(line), file) == 0) + { + /* Impossible case */ + } begin = ftell(file); } diff --git a/extra/yassl/taocrypt/src/aes.cpp b/extra/yassl/taocrypt/src/aes.cpp index b2b42d3dcf0..42cb0622e56 100644 --- a/extra/yassl/taocrypt/src/aes.cpp +++ b/extra/yassl/taocrypt/src/aes.cpp @@ -52,6 +52,7 @@ void AES::Process(byte* out, const byte* in, word32 sz) in += BLOCK_SIZE; } else if (mode_ == CBC) + { if (dir_ == ENCRYPTION) while (blocks--) { r_[0] ^= *(word32*)in; @@ -78,6 +79,7 @@ void AES::Process(byte* out, const byte* in, word32 sz) out += BLOCK_SIZE; in += BLOCK_SIZE; } + } } #endif // DO_AES_ASM diff --git a/extra/yassl/taocrypt/src/blowfish.cpp b/extra/yassl/taocrypt/src/blowfish.cpp index 66ff4d829d7..2a5ae7ffadf 100644 --- a/extra/yassl/taocrypt/src/blowfish.cpp +++ b/extra/yassl/taocrypt/src/blowfish.cpp @@ -54,6 +54,7 @@ void Blowfish::Process(byte* out, const byte* in, word32 sz) in += BLOCK_SIZE; } else if (mode_ == CBC) + { if (dir_ == ENCRYPTION) while (blocks--) { r_[0] ^= *(word32*)in; @@ -78,6 +79,7 @@ void Blowfish::Process(byte* out, const byte* in, word32 sz) out += BLOCK_SIZE; in += BLOCK_SIZE; } + } } #endif // DO_BLOWFISH_ASM diff --git a/extra/yassl/taocrypt/src/misc.cpp b/extra/yassl/taocrypt/src/misc.cpp index 402645c93fd..edbc678da3a 100644 --- a/extra/yassl/taocrypt/src/misc.cpp +++ b/extra/yassl/taocrypt/src/misc.cpp @@ -166,6 +166,7 @@ word Crop(word value, unsigned int size) #ifdef TAOCRYPT_X86ASM_AVAILABLE +#ifdef NOT_USED #ifndef _MSC_VER static jmp_buf s_env; static void SigIllHandler(int) @@ -173,6 +174,7 @@ word Crop(word value, unsigned int size) longjmp(s_env, 1); } #endif +#endif bool HaveCpuId() diff --git a/include/mysys_err.h b/include/mysys_err.h index 7167395f71f..754ae5d12ec 100644 --- a/include/mysys_err.h +++ b/include/mysys_err.h @@ -63,7 +63,8 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */ #define EE_FILENOTFOUND 29 #define EE_FILE_NOT_CLOSED 30 #define EE_CANT_CHMOD 31 -#define EE_ERROR_LAST 31 /* Copy last error nr */ +#define EE_CANT_COPY_OWNERSHIP 32 +#define EE_ERROR_LAST 32 /* Copy last error nr */ /* Add error numbers before EE_ERROR_LAST and change it accordingly. */ /* exit codes for all MySQL programs */ diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 526dcf51e70..b2d222a6d66 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1432,7 +1432,8 @@ mysql_get_server_info(MYSQL *mysql) my_bool STDCALL mariadb_connection(MYSQL *mysql) { - return strinstr(mysql->server_version, "MariaDB") != 0; + return (strinstr(mysql->server_version, "MariaDB") != 0 || + strinstr(mysql->server_version, "-maria-") != 0); } const char * STDCALL diff --git a/mysql-test/mysql-stress-test.pl b/mysql-test/mysql-stress-test.pl index 3061506da51..ff2566b1476 100755 --- a/mysql-test/mysql-stress-test.pl +++ b/mysql-test/mysql-stress-test.pl @@ -1100,7 +1100,7 @@ mysql-stress-test.pl --stress-basedir= --stress-suite-basedir= --serve they specified in the list file. --sleep-time=