How
patches work
A "patch" is a file that
describes the differences between two versions of a file. The program diff
compares the original file and the new file line-by-line and prints the
differences to standard out in a specific format. The program patch
can
read the output of diff
and apply those
changes to another copy of the original file. (Note that the word
"patch" refers both to the output of the diff
command and to the command that applies the patch.) For example:
[root@test mysql]# cat /opt/mysql/oldtest.c
Show innodb engine status ;
[root@test mysql]# cat /opt/mysql/newtest.c
Show engine innodb status ;
[root@test opt]# diff -uNr oldtest.c newtest.c
--- test 1970-01-01
00:00:00.000000000 +0000
+++ newtest.c 2010-10-20
10:25:25.000000000 +0000
@@ -0,0 +1 @@
+show engine innodb status;
Applying
patches
diff -uNr test
newtest.c > inno[root@test opt]# patch -p1 < innodb.patch
missing header for
unified diff at line 3 of patch
can't find file to
patch at input line 3
Perhaps you used
the wrong -p or --strip option?
The text leading up
to this was:
--------------------------
|--- test 1970-01-01 00:00:00.000000000 +0000
|+++ newtest.c 2010-10-20 10:25:25.000000000 +0000
--------------------------
File to patch:
/opt/test.c
patching file
/opt/test.cdb.patch
Applying
MySQL patches
Download relevant MySQL patch file.
[root@test mysql]# patch -p0 <
sql_log_slow.patch
can't find file to
patch at input line 4
Perhaps you used
the wrong -p or --strip option?
The text leading up
to this was:
--------------------------
|diff -aur
mysql-5.0.41-orig/client/mysqldump.c mysql-5.0.41/client/mysqldump.c
|---
mysql-5.0.41-orig/client/mysqldump.c
2007-08-20 12:16:29.000000000 -0700
|+++
mysql-5.0.41/client/mysqldump.c
2007-08-20 12:18:52.000000000 -0700
--------------------------
File to patch:
Skip this patch?
[y] n
File to patch:
Skip this patch?
[y]
Skipping patch.
1 out of 1 hunk
ignored
can't find file to
patch at input line 15
Perhaps you used
the wrong -p or --strip option?
The text leading up
to this was:
--------------------------
|diff -aur
mysql-5.0.41-orig/mysql-test/r/mysqldump.result
mysql-5.0.41/mysql-test/r/mysqldump.result
|---
mysql-5.0.41-orig/mysql-test/r/mysqldump.result 2007-08-20 12:16:29.000000000 -0700
|+++
mysql-5.0.41/mysql-test/r/mysqldump.result 2007-08-20 12:17:53.000000000 -0700
--------------------------
File to patch:
/opt/mysql/mysql-test/r/mysqldump.result
patching file
/opt/mysql/mysql-test/r/mysqldump.result
Reversed (or previously
applied) patch detected! Assume -R? [n]
R
Apply anyway? [n] y
Hunk #1 succeeded
at 485 with fuzz 1 (offset 408 lines).
Hunk #2 succeeded
at 2198 with fuzz 1 (offset 2093 lines).
Hunk #3 succeeded
at 514 with fuzz 1 (offset 330 lines).
No comments:
Post a Comment