summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc.rej
blob: 6e2bd03867de6adfe7412b083c71ceeacac44239 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
***************
*** 67,109 ****
  static void decrease_user_connections(USER_CONN *uc);
  #endif /* NO_EMBEDDED_ACCESS_CHECKS */
  static bool check_multi_update_lock(THD *thd);
- static void remove_escape(char *name);
  static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables);
  
  const char *any_db="*any*";	// Special symbol for check_access
  
! LEX_STRING command_name[]={
!   (char *)STRING_WITH_LEN("Sleep"),
!   (char *)STRING_WITH_LEN("Quit"),
!   (char *)STRING_WITH_LEN("Init DB"),
!   (char *)STRING_WITH_LEN("Query"),
!   (char *)STRING_WITH_LEN("Field List"),
!   (char *)STRING_WITH_LEN("Create DB"),
!   (char *)STRING_WITH_LEN("Drop DB"),
!   (char *)STRING_WITH_LEN("Refresh"),
!   (char *)STRING_WITH_LEN("Shutdown"),
!   (char *)STRING_WITH_LEN("Statistics"),
!   (char *)STRING_WITH_LEN("Processlist"),
!   (char *)STRING_WITH_LEN("Connect"),
!   (char *)STRING_WITH_LEN("Kill"),
!   (char *)STRING_WITH_LEN("Debug"),
!   (char *)STRING_WITH_LEN("Ping"),
!   (char *)STRING_WITH_LEN("Time"),
!   (char *)STRING_WITH_LEN("Delayed insert"),
!   (char *)STRING_WITH_LEN("Change user"),
!   (char *)STRING_WITH_LEN("Binlog Dump"),
!   (char *)STRING_WITH_LEN("Table Dump"),
!   (char *)STRING_WITH_LEN("Connect Out"),
!   (char *)STRING_WITH_LEN("Register Slave"),
!   (char *)STRING_WITH_LEN("Prepare"),
!   (char *)STRING_WITH_LEN("Execute"),
!   (char *)STRING_WITH_LEN("Long Data"),
!   (char *)STRING_WITH_LEN("Close stmt"),
!   (char *)STRING_WITH_LEN("Reset stmt"),
!   (char *)STRING_WITH_LEN("Set option"),
!   (char *)STRING_WITH_LEN("Fetch"),
!   (char *)STRING_WITH_LEN("Daemon"),
!   (char *)STRING_WITH_LEN("Error")  // Last command number
  };
  
  const char *xa_state_names[]={
--- 67,108 ----
  static void decrease_user_connections(USER_CONN *uc);
  #endif /* NO_EMBEDDED_ACCESS_CHECKS */
  static bool check_multi_update_lock(THD *thd);
  static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables);
  
  const char *any_db="*any*";	// Special symbol for check_access
  
! const LEX_STRING command_name[]={
!   C_STRING_WITH_LEN("Sleep"),
!   C_STRING_WITH_LEN("Quit"),
!   C_STRING_WITH_LEN("Init DB"),
!   C_STRING_WITH_LEN("Query"),
!   C_STRING_WITH_LEN("Field List"),
!   C_STRING_WITH_LEN("Create DB"),
!   C_STRING_WITH_LEN("Drop DB"),
!   C_STRING_WITH_LEN("Refresh"),
!   C_STRING_WITH_LEN("Shutdown"),
!   C_STRING_WITH_LEN("Statistics"),
!   C_STRING_WITH_LEN("Processlist"),
!   C_STRING_WITH_LEN("Connect"),
!   C_STRING_WITH_LEN("Kill"),
!   C_STRING_WITH_LEN("Debug"),
!   C_STRING_WITH_LEN("Ping"),
!   C_STRING_WITH_LEN("Time"),
!   C_STRING_WITH_LEN("Delayed insert"),
!   C_STRING_WITH_LEN("Change user"),
!   C_STRING_WITH_LEN("Binlog Dump"),
!   C_STRING_WITH_LEN("Table Dump"),
!   C_STRING_WITH_LEN("Connect Out"),
!   C_STRING_WITH_LEN("Register Slave"),
!   C_STRING_WITH_LEN("Prepare"),
!   C_STRING_WITH_LEN("Execute"),
!   C_STRING_WITH_LEN("Long Data"),
!   C_STRING_WITH_LEN("Close stmt"),
!   C_STRING_WITH_LEN("Reset stmt"),
!   C_STRING_WITH_LEN("Set option"),
!   C_STRING_WITH_LEN("Fetch"),
!   C_STRING_WITH_LEN("Daemon"),
!   C_STRING_WITH_LEN("Error")  // Last command number
  };
  
  const char *xa_state_names[]={
***************
*** 1738,1744 ****
        password.  New clients send the size (1 byte) + string (not null
        terminated, so also '\0' for empty string).
      */
!     char db_buff[NAME_LEN+1];                 // buffer to store db in utf8
      char *db= passwd;
      uint passwd_len= thd->client_capabilities & CLIENT_SECURE_CONNECTION ?
        *passwd++ : strlen(passwd);
--- 1736,1742 ----
        password.  New clients send the size (1 byte) + string (not null
        terminated, so also '\0' for empty string).
      */
!     char db_buff[NAME_LEN+1];               // buffer to store db in utf8
      char *db= passwd;
      uint passwd_len= thd->client_capabilities & CLIENT_SECURE_CONNECTION ?
        *passwd++ : strlen(passwd);
***************
*** 2315,2321 ****
          DBUG_RETURN(1);
        }
        db= lex->select_lex.db;
-       remove_escape(db);				// Fix escaped '_'
        if (check_db_name(db))
        {
          my_error(ER_WRONG_DB_NAME, MYF(0), db);
--- 2312,2317 ----
          DBUG_RETURN(1);
        }
        db= lex->select_lex.db;
        if (check_db_name(db))
        {
          my_error(ER_WRONG_DB_NAME, MYF(0), db);
***************
*** 6310,6345 ****
  }
  
  
- /* Fix escaping of _, % and \ in database and table names (for ODBC) */
- 
- static void remove_escape(char *name)
- {
-   if (!*name)					// For empty DB names
-     return;
-   char *to;
- #ifdef USE_MB
-   char *strend=name+(uint) strlen(name);
- #endif
-   for (to=name; *name ; name++)
-   {
- #ifdef USE_MB
-     int l;
-     if (use_mb(system_charset_info) &&
-         (l = my_ismbchar(system_charset_info, name, strend)))
-     {
- 	while (l--)
- 	    *to++ = *name++;
- 	name--;
- 	continue;
-     }
- #endif
-     if (*name == '\\' && name[1])
-       name++;					// Skip '\\'
-     *to++= *name;
-   }
-   *to=0;
- }
- 
  /****************************************************************************
  ** save order by and tables in own lists
  ****************************************************************************/
--- 6296,6301 ----
  }
  
  
  /****************************************************************************
  ** save order by and tables in own lists
  ****************************************************************************/