Commit 1aa56d1c authored by heikki@donna.mysql.fi's avatar heikki@donna.mysql.fi
Browse files

dict0crea.c:

  Add some error messages to help in tracking Harald Fuchs' foreign key failure
parent f84ca37e
Loading
Loading
Loading
Loading
+13 −8
Original line number Diff line number Diff line
@@ -1235,16 +1235,21 @@ dict_create_add_foreigns_to_dictionary(

	if (error != DB_SUCCESS) {
	        fprintf(stderr,
			"InnoDB: foreign constraint creation failed;\n"
			"InnoDB: Foreign key constraint creation failed:\n"
			"InnoDB: internal error number %lu\n", error);

		ut_a(error == DB_OUT_OF_FILE_SPACE);

		fprintf(stderr, "InnoDB: tablespace is full\n");

		trx_general_rollback_for_mysql(trx, FALSE, NULL);
		if (error == DB_DUPLICATE_KEY) {
			fprintf(stderr,
	"InnoDB: Duplicate key error in system table %s index %s\n",
			((dict_index_t*)trx->error_info)->table_name,
			((dict_index_t*)trx->error_info)->name);

		error = DB_MUST_GET_MORE_FILE_SPACE;
			fprintf(stderr,
	"InnoDB: Maybe the internal data dictionary of InnoDB is\n"
	"InnoDB: out-of-sync from the .frm files of your tables.\n"
	"InnoDB: See section 15.1 Troubleshooting data dictionary operations\n"
	"InnoDB: at http://www.innodb.com/ibman.html\n");
		}

		return(error);
	}