Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
4667a768
Commit
4667a768
authored
Feb 08, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0
parents
52520de0
811e5434
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
22 deletions
+68
-22
mysql-test/r/sql_mode.result
mysql-test/r/sql_mode.result
+14
-0
mysql-test/t/sql_mode.test
mysql-test/t/sql_mode.test
+10
-0
scripts/mysqld_safe.sh
scripts/mysqld_safe.sh
+26
-0
sql/mysqld.cc
sql/mysqld.cc
+16
-21
sql/sql_lex.cc
sql/sql_lex.cc
+2
-1
No files found.
mysql-test/r/sql_mode.result
View file @
4667a768
...
...
@@ -386,4 +386,18 @@ p mask example
20 \\\\% \\\\%
20 \\\\% \\\\_
DROP TABLE t1;
SET @@SQL_MODE='NO_BACKSLASH_ESCAPES';
SELECT 'a\\b', 'a\\\"b', 'a''\\b', 'a''\\\"b';
a\\b a\\\"b a'\\b a'\\\"b
a\\b a\\\"b a'\\b a'\\\"b
SELECT "a\\b", "a\\\'b", "a""\\b", "a""\\\'b";
a\\b a\\\'b a"\\b a"\\\'b
a\\b a\\\'b a"\\b a"\\\'b
SET @@SQL_MODE='';
SELECT 'a\\b', 'a\\\"b', 'a''\\b', 'a''\\\"b';
a\b a\"b a'\b a'\"b
a\b a\"b a'\b a'\"b
SELECT "a\\b", "a\\\'b", "a""\\b", "a""\\\'b";
a\b a\'b a"\b a"\'b
a\b a\'b a"\b a"\'b
SET @@SQL_MODE=@OLD_SQL_MODE;
mysql-test/t/sql_mode.test
View file @
4667a768
...
...
@@ -174,4 +174,14 @@ order by masks.p, example;
DROP
TABLE
t1
;
# Bug #6368: Make sure backslashes mixed with doubled quotes are handled
# correctly in NO_BACKSLASH_ESCAPES mode
SET
@@
SQL_MODE
=
'NO_BACKSLASH_ESCAPES'
;
SELECT
'a\\b'
,
'a\\\"b'
,
'a''\\b'
,
'a''\\\"b'
;
SELECT
"a
\\
b"
,
"a
\\
\'b"
,
"a""
\\
b"
,
"a""
\\
\'b"
;
SET
@@
SQL_MODE
=
''
;
SELECT
'a\\b'
,
'a\\\"b'
,
'a''\\b'
,
'a''\\\"b'
;
SELECT
"a
\\
b"
,
"a
\\
\'b"
,
"a""
\\
b"
,
"a""
\\
\'b"
;
SET
@@
SQL_MODE
=@
OLD_SQL_MODE
;
scripts/mysqld_safe.sh
View file @
4667a768
...
...
@@ -23,6 +23,29 @@ case "$1" in
;;
esac
usage
()
{
cat
<<
EOF
Usage:
$0
[OPTIONS]
--no-defaults Don't read the system defaults file
--defaults-file=FILE Use the specified defaults file
--defaults-extra-file=FILE Also use defaults from the specified file
--ledir=DIRECTORY Look for mysqld in the specified directory
--log-error=FILE Log errors to the specified log file
--open-files-limit=LIMIT Limit the number of open files
--core-file-size=LIMIT Limit core files to the specified size
--timezone=TZ Set the system timezone
--mysqld=FILE Use the specified file as mysqld
--mysqld-version=VERSION Use "mysqld-VERSION" as mysqld
--nice=NICE Set the scheduling priority of mysqld
--skip-kill-mysqld Don't try to kill stray mysqld processes
All other options are passed to the mysqld program.
EOF
exit
1
}
parse_arguments
()
{
# We only need to pass arguments through to the server if we don't
# handle them here. So, we collect unrecognized options (passed on
...
...
@@ -67,6 +90,9 @@ parse_arguments() {
fi
;;
--nice
=
*
)
niceness
=
`
echo
"
$arg
"
|
sed
-e
"s;--nice=;;"
`
;;
--help
)
usage
;;
*
)
if
test
-n
"
$pick_args
"
then
...
...
sql/mysqld.cc
View file @
4667a768
...
...
@@ -3376,39 +3376,34 @@ int main(int argc, char **argv)
return
0
;
}
}
else
if
(
argc
>=
4
)
else
if
(
argc
==
4
||
argc
==
5
)
{
const
char
*
defaults_file
=
"--defaults-file"
;
const
char
*
service
=
"--local-service"
;
char
extra_opt
[
FN_REFLEN
]
=
""
;
/*
This may seem strange, because we handle --local-service while
preserving 4.1's behavior of allowing any one other argument that is
passed to the service on startup. (The assumption is that this is
--defaults-file=file, but that was not enforced in 4.1, so we don't
enforce it here.)
*/
char
*
extra_opt
=
NULL
;
char
*
account_name
=
NULL
;
char
*
option
;
int
index
;
for
(
index
=
3
;
index
<
argc
;
index
++
)
{
option
=
argv
[
index
];
/*
Install an optional service with optional config file
mysqld --install-manual mysqldopt --defaults-file=c:\miguel\my.ini
*/
if
(
strncmp
(
option
,
defaults_file
,
strlen
(
defaults_file
))
==
0
)
if
(
strncmp
(
argv
[
index
],
"--local-service"
,
15
)
==
0
)
{
strmov
(
extra_opt
,
option
);
account_name
=
(
char
*
)
malloc
(
27
);
strmov
(
account_name
,
"NT AUTHORITY
\\
LocalService
\0
"
);
}
else
/*
Install an optional service as local service
mysqld --install-manual mysqldopt --local-service
*/
if
(
strncmp
(
option
,
service
,
strlen
(
service
))
==
0
)
{
account_name
=
(
char
*
)
malloc
(
27
);
strmov
(
account_name
,
"NT AUTHORITY
\\
LocalService
\0
"
);
extra_opt
=
argv
[
index
];
}
}
if
(
!
default_service_handling
(
argv
,
argv
[
2
],
argv
[
2
],
file_path
,
extra_opt
,
account_name
))
return
0
;
if
(
argc
!=
5
||
account_name
)
if
(
!
default_service_handling
(
argv
,
argv
[
2
],
argv
[
2
],
file_path
,
extra_opt
,
account_name
))
return
0
;
}
else
if
(
argc
==
1
&&
Service
.
IsService
(
MYSQL_SERVICENAME
))
{
...
...
sql/sql_lex.cc
View file @
4667a768
...
...
@@ -337,7 +337,8 @@ static char *get_text(LEX *lex)
continue
;
}
#endif
if
(
*
str
==
'\\'
&&
str
+
1
!=
end
)
if
(
!
(
lex
->
thd
->
variables
.
sql_mode
&
MODE_NO_BACKSLASH_ESCAPES
)
&&
*
str
==
'\\'
&&
str
+
1
!=
end
)
{
switch
(
*++
str
)
{
case
'n'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment