]>
Commit | Line | Data |
---|---|---|
1 | # name : mysql_remove_eol_carret.patch | |
2 | # introduced : 11 or before | |
3 | # maintainer : Oleg | |
4 | # | |
5 | #!!! notice !!! | |
6 | # Any small change to this file in the main branch | |
7 | # should be done or reviewed by the maintainer! | |
8 | diff -ruN a/client/client_priv.h b/client/client_priv.h | |
9 | --- a/client/client_priv.h 2011-04-09 18:48:54.000000000 +0400 | |
10 | +++ b/client/client_priv.h 2011-04-09 18:49:03.000000000 +0400 | |
11 | @@ -87,6 +87,7 @@ | |
12 | OPT_SYSLOG, | |
13 | #endif | |
14 | OPT_PLUGIN_DIR, | |
15 | + OPT_NO_REMOVE_EOL_CARRET, | |
16 | OPT_DEFAULT_AUTH, | |
17 | OPT_DEFAULT_PLUGIN, | |
18 | OPT_MAX_CLIENT_OPTION | |
19 | diff -ruN a/client/mysql.cc b/client/mysql.cc | |
20 | --- a/client/mysql.cc 2011-04-09 18:48:54.000000000 +0400 | |
21 | +++ b/client/mysql.cc 2011-04-09 18:49:03.000000000 +0400 | |
22 | @@ -133,6 +133,8 @@ | |
23 | enum enum_info_type { INFO_INFO,INFO_ERROR,INFO_RESULT}; | |
24 | typedef enum enum_info_type INFO_TYPE; | |
25 | ||
26 | +my_bool opt_no_remove_eol_carret=0; | |
27 | + | |
28 | static MYSQL mysql; /* The connection */ | |
29 | static my_bool ignore_errors=0,wait_flag=0,quick=0, | |
30 | connected=0,opt_raw_data=0,unbuffered=0,output_tables=0, | |
31 | @@ -1452,6 +1454,10 @@ | |
32 | NO_ARG, 1, 0, 0, 0, 0, 0}, | |
33 | {"skip-line-numbers", 'L', "Don't write line number for errors.", 0, 0, 0, GET_NO_ARG, | |
34 | NO_ARG, 0, 0, 0, 0, 0, 0}, | |
35 | + {"no-remove-eol-carret", OPT_NO_REMOVE_EOL_CARRET, "Do not remove \\r before \\n in batch mode", | |
36 | + (uchar**)&opt_no_remove_eol_carret , (uchar**)&opt_no_remove_eol_carret, 0, | |
37 | + GET_BOOL, | |
38 | + NO_ARG, 0, 0, 0, 0, 0, 0}, | |
39 | {"unbuffered", 'n', "Flush buffer after each query.", &unbuffered, | |
40 | &unbuffered, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, | |
41 | {"column-names", OPT_COLUMN_NAMES, "Write column names in results.", | |
42 | diff -ruN a/client/readline.cc b/client/readline.cc | |
43 | --- a/client/readline.cc 2011-04-09 18:48:03.000000000 +0400 | |
44 | +++ b/client/readline.cc 2011-04-09 18:49:03.000000000 +0400 | |
45 | @@ -21,6 +21,8 @@ | |
46 | #include <my_dir.h> | |
47 | #include "my_readline.h" | |
48 | ||
49 | +extern my_bool opt_no_remove_eol_carret; | |
50 | + | |
51 | static bool init_line_buffer(LINE_BUFFER *buffer,File file,ulong size, | |
52 | ulong max_size); | |
53 | static bool init_line_buffer_from_string(LINE_BUFFER *buffer,char * str); | |
54 | @@ -60,7 +62,7 @@ | |
55 | if (!(pos=intern_read_line(line_buff, &out_length))) | |
56 | return 0; | |
57 | if (out_length && pos[out_length-1] == '\n') | |
58 | - if (--out_length && pos[out_length-1] == '\r') /* Remove '\n' */ | |
59 | + if (--out_length && !opt_no_remove_eol_carret && pos[out_length-1] == '\r') /* Remove '\n' */ | |
60 | out_length--; /* Remove '\r' */ | |
61 | line_buff->read_length=out_length; | |
62 | pos[out_length]=0; | |
63 | diff -ruN /dev/null b/patch_info/mysql_remove_eol_carret.patch | |
64 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
65 | +++ b/patch_info/mysql_remove_eol_carret.patch 2011-04-09 18:49:03.000000000 +0400 | |
66 | @@ -0,0 +1,7 @@ | |
67 | +File=mysql_remove_eol_carret.patch | |
68 | +Name= | |
69 | +Version=1.1 | |
70 | +Author=Percona <info@percona.com> | |
71 | +License=GPL | |
72 | +Comment=Do not remove carret before eol if --no-remove-eol-carret is enabled in MySQL client. | |
73 | +Changelog |