]> git.pld-linux.org Git - packages/mysql.git/blob - mysql-mysql_remove_eol_carret.patch
2928be07f47e4b3b205b7d3cb665fc5b225303b4
[packages/mysql.git] / mysql-mysql_remove_eol_carret.patch
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 --- a/client/client_priv.h
9 +++ b/client/client_priv.h
10 @@ -98,5 +98,6 @@
11  #endif
12    OPT_FIRST_SLAVE,
13    OPT_ALL,
14 +  OPT_NO_REMOVE_EOL_CARRET,
15    OPT_MAX_CLIENT_OPTION
16  };
17 --- a/client/mysql.cc
18 +++ b/client/mysql.cc
19 @@ -143,6 +143,8 @@
20  enum enum_info_type { INFO_INFO,INFO_ERROR,INFO_RESULT};
21  typedef enum enum_info_type INFO_TYPE;
22  
23 +my_bool opt_no_remove_eol_carret=0;
24 +
25  static MYSQL mysql;                    /* The connection */
26  static my_bool ignore_errors=0,wait_flag=0,quick=0,
27                 connected=0,opt_raw_data=0,unbuffered=0,output_tables=0,
28 @@ -1439,6 +1441,10 @@
29     NO_ARG, 1, 0, 0, 0, 0, 0},  
30    {"skip-line-numbers", 'L', "Don't write line number for errors.", 0, 0, 0, GET_NO_ARG,
31     NO_ARG, 0, 0, 0, 0, 0, 0},
32 +  {"no-remove-eol-carret", OPT_NO_REMOVE_EOL_CARRET, "Do not remove \\r before \\n in batch mode", 
33 +  (uchar**)&opt_no_remove_eol_carret , (uchar**)&opt_no_remove_eol_carret, 0, 
34 +   GET_BOOL,
35 +   NO_ARG, 0, 0, 0, 0, 0, 0},
36    {"unbuffered", 'n', "Flush buffer after each query.", &unbuffered,
37     &unbuffered, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
38    {"column-names", OPT_COLUMN_NAMES, "Write column names in results.",
39 --- a/client/readline.cc
40 +++ b/client/readline.cc
41 @@ -23,6 +23,8 @@
42  #include <my_dir.h>
43  #include "my_readline.h"
44  
45 +extern my_bool opt_no_remove_eol_carret;
46 +
47  static bool init_line_buffer(LINE_BUFFER *buffer,File file,ulong size,
48                             ulong max_size);
49  static bool init_line_buffer_from_string(LINE_BUFFER *buffer,char * str);
50 @@ -57,12 +59,12 @@
51  char *batch_readline(LINE_BUFFER *line_buff)
52  {
53    char *pos;
54 -  ulong out_length;
55 +  ulong UNINIT_VAR(out_length);
56  
57    if (!(pos=intern_read_line(line_buff, &out_length)))
58      return 0;
59    if (out_length && pos[out_length-1] == '\n')
60 -    if (--out_length && pos[out_length-1] == '\r')  /* Remove '\n' */
61 +    if (--out_length && !opt_no_remove_eol_carret && pos[out_length-1] == '\r')  /* Remove '\n' */
62        out_length--;                                 /* Remove '\r' */
63    line_buff->read_length=out_length;
64    pos[out_length]=0;
65 --- /dev/null
66 +++ b/patch_info/mysql_remove_eol_carret.patch
67 @@ -0,0 +1,7 @@
68 +File=mysql_remove_eol_carret.patch
69 +Name=
70 +Version=1.1
71 +Author=Percona <info@percona.com>
72 +License=GPL
73 +Comment=Do not remove carret before eol if --no-remove-eol-carret is enabled in MySQL client.
74 +Changelog
This page took 0.024882 seconds and 2 git commands to generate.