# backup_password.txt will contain password and os dependent line ending. # --decrypt-password=SECRET will not be used since input file is not # encrypted, but will cause warning. # Command will create a file encrypted with password from stdin without # line ending. ndbxfrm: [Warning] Using a password on the command line interface can be insecure. # Encrypt also a backup data file - to be able to do restore later # With same password given in different way, also compress just for # some variation, will show up in ndbxfrm --info later. ndbxfrm: [Warning] Using a password on the command line interface can be insecure. # Encrypt also a backup log file - to be able to do restore later # Check that new files are encrypted, and old files are not. # One can note that of the new files only data file is compressed. # Later restore will handle both compressed and uncompressed files. File=NDB_SAVED_BACKUPS/undo_backup/BACKUP-1-PART-1-OF-4/BACKUP-1.1.ctl, compression=yes, encryption=no File=NDB_SAVED_BACKUPS/undo_backup/BACKUP-1-PART-1-OF-4/BACKUP-1-0.1.Data, compression=yes, encryption=no File=NDB_SAVED_BACKUPS/undo_backup/BACKUP-1-PART-1-OF-4/BACKUP-1.1.log, compression=no, encryption=no File=MYSQL_TMP_DIR/BACKUP-1.1.ctl, compression=no, encryption=yes File=MYSQL_TMP_DIR/BACKUP-1-0.1.Data, compression=yes, encryption=yes File=MYSQL_TMP_DIR/BACKUP-1.1.log, compression=no, encryption=yes # Verify that ndb_print_backup_file can decrypt file using the TOPSECRET # password, given on command line to ensure no line ending. This also # verifies that reading password from stdin do not include the line # endings in password. ndb_print_backup_file: [Warning] Using a password on the command line interface can be insecure. # Do restore using the new encrypted files. # extra_encrypted_backup.cnf specifies backup-password for ndb_restore, # need to skip that for --backup-password not conflict with # --backup-password-from-stdin. # Trigger sync of created logfile group, tablespace, and, tables to be # recognized by MySQL server. SET GLOBAL ndb_metadata_sync=ON; # Pass two passwords via stdin. # Passing file with one password. Error: encrypt password has no end. # Pass two passwords via stdin. # Passing file with two passwords. # Pass one passwords via stdin. # Passing file with one password without any new line character. select "TOPSECRET-NO-NL" into dumpfile "NDB_PASSWORD_DIR/backup_password_no_nl.txt"; Error: decrypt password has no end. # Pass a too long passwords via stdin. select repeat("TOPSECRET", 60) into outfile "NDB_PASSWORD_DIR/backup_password_long.txt"; Error: Can not read file MYSQL_TMP_DIR/BACKUP-1.1.ctl, bad password or key? # Pass a too long passwords via stdin. select repeat("TOPSECRET", 120) into outfile "NDB_PASSWORD_DIR/backup_password_long2.txt"; Error: decrypt password too long. # Pass a passwords with control character (ctrl-V) via stdin. select char(22) into outfile "NDB_PASSWORD_DIR/backup_password_ctrl.txt"; ndbxfrm: [Warning] Using a password on the command line interface can be insecure. Error: encrypt password has some bad character. # Pass wrong passwords ndbxfrm: [Warning] Using a password on the command line interface can be insecure. Error: Can not read file MYSQL_TMP_DIR/BACKUP-1.1.ctl, bad password or key? # Wait for schema synchronization to finish. # Drop tables, tablespace and logfile group created by restore. DROP TABLE test . t_gis; DROP TABLE test . t_num; DROP TABLE test . t_string_1; DROP TABLE test . t_string_2; DROP TABLE test . t_string_3; DROP TABLE test . t_string_4; DROP TABLE test . t_string_5; DROP TABLE test . t_datetime; ALTER TABLESPACE ts1 DROP DATAFILE 'datafile.dat'; DROP TABLESPACE ts1; DROP LOGFILE GROUP lg1 ENGINE NDBCLUSTER; # Test ended, cleanup files.