Loading BitKeeper/etc/logging_ok +1 −0 Original line number Diff line number Diff line Loading @@ -65,3 +65,4 @@ worm@altair.is.lan zak@balfor.local zak@linux.local tfr@indrek.tfr.cafe.ee peter@linux.local client/client_priv.h +1 −1 Original line number Diff line number Diff line Loading @@ -37,4 +37,4 @@ enum options { OPT_CHARSETS_DIR=256, OPT_DEFAULT_CHARSET, OPT_SELECT_LIMIT, OPT_MAX_JOIN_SIZE, OPT_SSL_SSL, OPT_SSL_KEY, OPT_SSL_CERT, OPT_SSL_CA, OPT_SSL_CAPATH, OPT_SSL_CIPHER, OPT_SHUTDOWN_TIMEOUT, OPT_LOCAL_INFILE, OPT_PROMPT, OPT_IGN_LINES }; OPT_PROMPT, OPT_IGN_LINES,OPT_TRANSACTION }; client/mysqldump.c +40 −3 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ ** Tnu Samuel <tonu@please.do.not.remove.this.spam.ee> ** XML by Gary Huntress <ghuntress@mediaone.net> 10/10/01, cleaned up ** and adapted to mysqldump 05/11/01 by Jani Tolonen ** Added --single-transaction option 06/06/2002 by Peter Zaitsev */ #define DUMP_VERSION "9.06" Loading Loading @@ -76,7 +77,7 @@ static my_bool verbose=0,tFlag=0,cFlag=0,dFlag=0,quick=0, extended_insert = 0, opt_delayed=0,create_options=0,opt_quoted=0,opt_databases=0, opt_alldbs=0,opt_create_db=0,opt_first_slave=0, opt_autocommit=0,opt_master_data,opt_disable_keys=0,opt_xml=0, tty_password=0; tty_password=0,opt_single_transaction=0; static MYSQL mysql_connection,*sock=0; static char insert_pat[12 * 1024],*opt_password=0,*current_user=0, *current_host=0,*path=0,*fields_terminated=0, Loading Loading @@ -171,6 +172,10 @@ static struct my_option my_long_options[] = "Wrap tables with autocommit/commit statements.", (gptr*) &opt_autocommit, (gptr*) &opt_autocommit, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"single-transaction", OPT_TRANSACTION, "Dump all tables in single transaction to get consistent snapshot. Mutually exclusive with --lock-tables.", (gptr*) &opt_single_transaction, (gptr*) &opt_single_transaction, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"no-create-db", 'n', "'CREATE DATABASE /*!32312 IF NOT EXISTS*/ db_name;' will not be put in the output. The above line will be added otherwise, if --databases or --all-databases option was given.}", (gptr*) &opt_create_db, (gptr*) &opt_create_db, 0, GET_BOOL, NO_ARG, 0, 0, Loading Loading @@ -340,8 +345,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), usage(); exit(0); case (int) OPT_OPTIMIZE: extended_insert=opt_drop=opt_lock=lock_tables=quick=create_options= opt_disable_keys=1; extended_insert=opt_drop=opt_lock=quick=create_options=opt_disable_keys= lock_tables=1; if (opt_single_transaction) lock_tables=0; break; case (int) OPT_TABLES: opt_databases=0; Loading Loading @@ -372,6 +378,12 @@ static int get_options(int *argc, char ***argv) return(1); } if (opt_single_transaction && lock_tables) { fprintf(stderr, "%s: You can't use --lock-tables and --single-transaction at the same time.\n", my_progname); return(1); } if (enclosed && opt_enclosed) { fprintf(stderr, "%s: You can't use ..enclosed.. and ..optionally-enclosed.. at the same time.\n", my_progname); Loading Loading @@ -1372,6 +1384,18 @@ int main(int argc, char **argv) return(first_error); } } /* There is no sense to start transaction if all tables are locked */ else if (opt_single_transaction) { if (mysql_query(sock, "BEGIN")) { my_printf_error(0, "Error: Couldn't execute 'BEGIN': %s", MYF(0), mysql_error(sock)); my_end(0); return(first_error); } } if (opt_alldbs) dump_all_databases(); /* Only one database and selected table(s) */ Loading Loading @@ -1416,6 +1440,19 @@ int main(int argc, char **argv) MYF(0), mysql_error(sock)); } } /* In case we were locking all tables, we did not start transaction so there is no need to commit it. */ else if (opt_single_transaction) /* Just to make it beautiful enough */ { /* This should just free locks as we did not change anything */ if (mysql_query(sock, "COMMIT")) { my_printf_error(0, "Error: Couldn't execute 'COMMIT': %s", MYF(0), mysql_error(sock)); } } dbDisconnect(current_host); fputs("\n", md_result_file); if (md_result_file != stdout) Loading include/my_aes.h 0 → 100644 +83 −0 Original line number Diff line number Diff line /* Copyright (C) 2002 MySQL AB & MySQL Finland AB & TCX DataKonsult AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* Header file for my_aes.c */ /* Wrapper to give simple interface for MySQL to AES standard encryption */ #ifndef __MY_AES_H #define __MY_AES_H #include "my_global.h" #include <stdio.h> #include "rijndael.h" #define AES_KEY_LENGTH 128 /* Must be 128 192 or 256 */ #ifdef __cplusplus extern "C" { #endif /* my_aes_crypt - Crypt buffer with AES encryption algorithm. source - Pinter to data for encryption source_length - size of encruption data dest - buffer to place encrypted data (must be large enough) key - Key to be used for encryption kel_length - Lenght of the key. Will handle keys of any length returns - size of encrypted data, or negative in case of error. */ int my_aes_encrypt(const char* source, int source_length, const char* dest, const char* key, int key_length); /* my_aes_decrypt - DeCrypt buffer with AES encryption algorithm. source - Pinter to data for decryption source_length - size of encrypted data dest - buffer to place decrypted data (must be large enough) key - Key to be used for decryption kel_length - Lenght of the key. Will handle keys of any length returns - size of original data, or negative in case of error. */ int my_aes_decrypt(const char* source, int source_length, const char* dest, const char* key, int key_length); /* my_aes_get_size - get size of buffer which will be large enough for encrypted data source_length - length of data to be encrypted returns - size of buffer required to store encrypted data */ int my_aes_get_size(int source_length); #ifdef __cplusplus } #endif #endif include/rijndael.h 0 → 100644 +48 −0 Original line number Diff line number Diff line /* Copyright (C) 2002 MySQL AB & MySQL Finland AB & TCX DataKonsult AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* rijndael-alg-fst.h @version 3.0 (December 2000) Optimised ANSI C code for the Rijndael cipher (now AES) @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be> @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be> @author Paulo Barreto <paulo.barreto@terra.com.br> This code is hereby placed in the public domain. Modified by Peter Zaitsev to fit MySQL coding style. */ #ifndef __RIJNDAEL_ALG_FST_H #define __RIJNDAEL_ALG_FST_H #define MAXKC (256/32) #define MAXKB (256/8) #define MAXNR 14 int rijndaelKeySetupEnc(uint32 rk[/*4*(Nr + 1)*/], const uint8 cipherKey[], int keyBits); int rijndaelKeySetupDec(uint32 rk[/*4*(Nr + 1)*/], const uint8 cipherKey[], int keyBits); void rijndaelEncrypt(const uint32 rk[/*4*(Nr + 1)*/], int Nr, const uint8 pt[16], uint8 ct[16]); void rijndaelDecrypt(const uint32 rk[/*4*(Nr + 1)*/], int Nr, const uint8 ct[16], uint8 pt[16]); #endif /* __RIJNDAEL_ALG_FST_H */ Loading
BitKeeper/etc/logging_ok +1 −0 Original line number Diff line number Diff line Loading @@ -65,3 +65,4 @@ worm@altair.is.lan zak@balfor.local zak@linux.local tfr@indrek.tfr.cafe.ee peter@linux.local
client/client_priv.h +1 −1 Original line number Diff line number Diff line Loading @@ -37,4 +37,4 @@ enum options { OPT_CHARSETS_DIR=256, OPT_DEFAULT_CHARSET, OPT_SELECT_LIMIT, OPT_MAX_JOIN_SIZE, OPT_SSL_SSL, OPT_SSL_KEY, OPT_SSL_CERT, OPT_SSL_CA, OPT_SSL_CAPATH, OPT_SSL_CIPHER, OPT_SHUTDOWN_TIMEOUT, OPT_LOCAL_INFILE, OPT_PROMPT, OPT_IGN_LINES }; OPT_PROMPT, OPT_IGN_LINES,OPT_TRANSACTION };
client/mysqldump.c +40 −3 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ ** Tnu Samuel <tonu@please.do.not.remove.this.spam.ee> ** XML by Gary Huntress <ghuntress@mediaone.net> 10/10/01, cleaned up ** and adapted to mysqldump 05/11/01 by Jani Tolonen ** Added --single-transaction option 06/06/2002 by Peter Zaitsev */ #define DUMP_VERSION "9.06" Loading Loading @@ -76,7 +77,7 @@ static my_bool verbose=0,tFlag=0,cFlag=0,dFlag=0,quick=0, extended_insert = 0, opt_delayed=0,create_options=0,opt_quoted=0,opt_databases=0, opt_alldbs=0,opt_create_db=0,opt_first_slave=0, opt_autocommit=0,opt_master_data,opt_disable_keys=0,opt_xml=0, tty_password=0; tty_password=0,opt_single_transaction=0; static MYSQL mysql_connection,*sock=0; static char insert_pat[12 * 1024],*opt_password=0,*current_user=0, *current_host=0,*path=0,*fields_terminated=0, Loading Loading @@ -171,6 +172,10 @@ static struct my_option my_long_options[] = "Wrap tables with autocommit/commit statements.", (gptr*) &opt_autocommit, (gptr*) &opt_autocommit, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"single-transaction", OPT_TRANSACTION, "Dump all tables in single transaction to get consistent snapshot. Mutually exclusive with --lock-tables.", (gptr*) &opt_single_transaction, (gptr*) &opt_single_transaction, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"no-create-db", 'n', "'CREATE DATABASE /*!32312 IF NOT EXISTS*/ db_name;' will not be put in the output. The above line will be added otherwise, if --databases or --all-databases option was given.}", (gptr*) &opt_create_db, (gptr*) &opt_create_db, 0, GET_BOOL, NO_ARG, 0, 0, Loading Loading @@ -340,8 +345,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), usage(); exit(0); case (int) OPT_OPTIMIZE: extended_insert=opt_drop=opt_lock=lock_tables=quick=create_options= opt_disable_keys=1; extended_insert=opt_drop=opt_lock=quick=create_options=opt_disable_keys= lock_tables=1; if (opt_single_transaction) lock_tables=0; break; case (int) OPT_TABLES: opt_databases=0; Loading Loading @@ -372,6 +378,12 @@ static int get_options(int *argc, char ***argv) return(1); } if (opt_single_transaction && lock_tables) { fprintf(stderr, "%s: You can't use --lock-tables and --single-transaction at the same time.\n", my_progname); return(1); } if (enclosed && opt_enclosed) { fprintf(stderr, "%s: You can't use ..enclosed.. and ..optionally-enclosed.. at the same time.\n", my_progname); Loading Loading @@ -1372,6 +1384,18 @@ int main(int argc, char **argv) return(first_error); } } /* There is no sense to start transaction if all tables are locked */ else if (opt_single_transaction) { if (mysql_query(sock, "BEGIN")) { my_printf_error(0, "Error: Couldn't execute 'BEGIN': %s", MYF(0), mysql_error(sock)); my_end(0); return(first_error); } } if (opt_alldbs) dump_all_databases(); /* Only one database and selected table(s) */ Loading Loading @@ -1416,6 +1440,19 @@ int main(int argc, char **argv) MYF(0), mysql_error(sock)); } } /* In case we were locking all tables, we did not start transaction so there is no need to commit it. */ else if (opt_single_transaction) /* Just to make it beautiful enough */ { /* This should just free locks as we did not change anything */ if (mysql_query(sock, "COMMIT")) { my_printf_error(0, "Error: Couldn't execute 'COMMIT': %s", MYF(0), mysql_error(sock)); } } dbDisconnect(current_host); fputs("\n", md_result_file); if (md_result_file != stdout) Loading
include/my_aes.h 0 → 100644 +83 −0 Original line number Diff line number Diff line /* Copyright (C) 2002 MySQL AB & MySQL Finland AB & TCX DataKonsult AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* Header file for my_aes.c */ /* Wrapper to give simple interface for MySQL to AES standard encryption */ #ifndef __MY_AES_H #define __MY_AES_H #include "my_global.h" #include <stdio.h> #include "rijndael.h" #define AES_KEY_LENGTH 128 /* Must be 128 192 or 256 */ #ifdef __cplusplus extern "C" { #endif /* my_aes_crypt - Crypt buffer with AES encryption algorithm. source - Pinter to data for encryption source_length - size of encruption data dest - buffer to place encrypted data (must be large enough) key - Key to be used for encryption kel_length - Lenght of the key. Will handle keys of any length returns - size of encrypted data, or negative in case of error. */ int my_aes_encrypt(const char* source, int source_length, const char* dest, const char* key, int key_length); /* my_aes_decrypt - DeCrypt buffer with AES encryption algorithm. source - Pinter to data for decryption source_length - size of encrypted data dest - buffer to place decrypted data (must be large enough) key - Key to be used for decryption kel_length - Lenght of the key. Will handle keys of any length returns - size of original data, or negative in case of error. */ int my_aes_decrypt(const char* source, int source_length, const char* dest, const char* key, int key_length); /* my_aes_get_size - get size of buffer which will be large enough for encrypted data source_length - length of data to be encrypted returns - size of buffer required to store encrypted data */ int my_aes_get_size(int source_length); #ifdef __cplusplus } #endif #endif
include/rijndael.h 0 → 100644 +48 −0 Original line number Diff line number Diff line /* Copyright (C) 2002 MySQL AB & MySQL Finland AB & TCX DataKonsult AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* rijndael-alg-fst.h @version 3.0 (December 2000) Optimised ANSI C code for the Rijndael cipher (now AES) @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be> @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be> @author Paulo Barreto <paulo.barreto@terra.com.br> This code is hereby placed in the public domain. Modified by Peter Zaitsev to fit MySQL coding style. */ #ifndef __RIJNDAEL_ALG_FST_H #define __RIJNDAEL_ALG_FST_H #define MAXKC (256/32) #define MAXKB (256/8) #define MAXNR 14 int rijndaelKeySetupEnc(uint32 rk[/*4*(Nr + 1)*/], const uint8 cipherKey[], int keyBits); int rijndaelKeySetupDec(uint32 rk[/*4*(Nr + 1)*/], const uint8 cipherKey[], int keyBits); void rijndaelEncrypt(const uint32 rk[/*4*(Nr + 1)*/], int Nr, const uint8 pt[16], uint8 ct[16]); void rijndaelDecrypt(const uint32 rk[/*4*(Nr + 1)*/], int Nr, const uint8 ct[16], uint8 pt[16]); #endif /* __RIJNDAEL_ALG_FST_H */