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
9e0ed0fa
Commit
9e0ed0fa
authored
Jun 25, 2019
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-19860 - do not produce huge strings wtih comp_sql anymore.
Limit lines to ~16K
parent
1a518aa1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
cmake/create_initial_db.cmake
cmake/create_initial_db.cmake
+1
-1
scripts/comp_sql.c
scripts/comp_sql.c
+10
-1
No files found.
cmake/create_initial_db.cmake
View file @
9e0ed0fa
...
...
@@ -52,7 +52,7 @@ SET(BOOTSTRAP_COMMAND
--datadir=.
--default-storage-engine=MyISAM
--max_allowed_packet=8M
--net_buffer_length=
16
K
--net_buffer_length=
32
K
)
GET_FILENAME_COMPONENT
(
CWD . ABSOLUTE
)
...
...
scripts/comp_sql.c
View file @
9e0ed0fa
...
...
@@ -74,6 +74,8 @@ char *fgets_fn(char *buffer, size_t size, fgets_input_t input, int *error)
return
line
;
}
#define MAX_COLUMN 16000
static
void
print_query
(
FILE
*
out
,
const
char
*
query
)
{
const
char
*
ptr
=
query
;
...
...
@@ -82,6 +84,12 @@ static void print_query(FILE *out, const char *query)
fprintf
(
out
,
"
\"
"
);
while
(
*
ptr
)
{
if
(
column
>=
MAX_COLUMN
)
{
/* Wrap to the next line, tabulated. */
fprintf
(
out
,
"
\"\n
\"
"
);
column
=
2
;
}
switch
(
*
ptr
)
{
case
'\n'
:
...
...
@@ -97,10 +105,11 @@ static void print_query(FILE *out, const char *query)
break
;
case
'\"'
:
fprintf
(
out
,
"
\\\"
"
);
column
+
+
;
column
+
=
2
;
break
;
case
'\\'
:
fprintf
(
out
,
"
\\\\
"
);
column
+=
2
;
break
;
default:
putc
(
*
ptr
,
out
);
...
...
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