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
425d971b
Commit
425d971b
authored
Dec 24, 2002
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge work:/home/bk/mysql-4.1
into dsl-kpogw4gb5.dial.inet.fi:/home/my/bk/mysql-4.1
parents
224bf8d9
82ff0d6e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
12 deletions
+32
-12
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
client/mysql.cc
client/mysql.cc
+31
-12
No files found.
BitKeeper/etc/logging_ok
View file @
425d971b
...
@@ -24,6 +24,7 @@ heikki@work.mysql.com
...
@@ -24,6 +24,7 @@ heikki@work.mysql.com
hf@deer.mysql.r18.ru
hf@deer.mysql.r18.ru
hf@genie.(none)
hf@genie.(none)
jani@dsl-jkl1657.dial.inet.fi
jani@dsl-jkl1657.dial.inet.fi
jani@dsl-kpogw4gb5.dial.inet.fi
jani@hynda.(none)
jani@hynda.(none)
jani@hynda.mysql.fi
jani@hynda.mysql.fi
jani@janikt.pp.saunalahti.fi
jani@janikt.pp.saunalahti.fi
...
...
client/mysql.cc
View file @
425d971b
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
#include <signal.h>
#include <signal.h>
#include <violite.h>
#include <violite.h>
const
char
*
VER
=
"13.
1
"
;
const
char
*
VER
=
"13.
2
"
;
/* Don't try to make a nice table if the data is too big */
/* Don't try to make a nice table if the data is too big */
#define MAX_COLUMN_LENGTH 1024
#define MAX_COLUMN_LENGTH 1024
...
@@ -280,7 +280,8 @@ static void initialize_readline (char *name);
...
@@ -280,7 +280,8 @@ static void initialize_readline (char *name);
#endif
#endif
static
COMMANDS
*
find_command
(
char
*
name
,
char
cmd_name
);
static
COMMANDS
*
find_command
(
char
*
name
,
char
cmd_name
);
static
bool
add_line
(
String
&
buffer
,
char
*
line
,
char
*
in_string
);
static
bool
add_line
(
String
&
buffer
,
char
*
line
,
char
*
in_string
,
bool
*
ml_comment
);
static
void
remove_cntrl
(
String
&
buffer
);
static
void
remove_cntrl
(
String
&
buffer
);
static
void
print_table_data
(
MYSQL_RES
*
result
);
static
void
print_table_data
(
MYSQL_RES
*
result
);
static
void
print_table_data_html
(
MYSQL_RES
*
result
);
static
void
print_table_data_html
(
MYSQL_RES
*
result
);
...
@@ -805,9 +806,10 @@ static int read_lines(bool execute_commands)
...
@@ -805,9 +806,10 @@ static int read_lines(bool execute_commands)
char
*
line
;
char
*
line
;
char
in_string
=
0
;
char
in_string
=
0
;
ulong
line_number
=
0
;
ulong
line_number
=
0
;
bool
ml_comment
=
0
;
COMMANDS
*
com
;
COMMANDS
*
com
;
status
.
exit_status
=
1
;
status
.
exit_status
=
1
;
for
(;;)
for
(;;)
{
{
if
(
status
.
batch
||
!
execute_commands
)
if
(
status
.
batch
||
!
execute_commands
)
...
@@ -873,7 +875,7 @@ static int read_lines(bool execute_commands)
...
@@ -873,7 +875,7 @@ static int read_lines(bool execute_commands)
#endif
#endif
continue
;
continue
;
}
}
if
(
add_line
(
glob_buffer
,
line
,
&
in_string
))
if
(
add_line
(
glob_buffer
,
line
,
&
in_string
,
&
ml_comment
))
break
;
break
;
}
}
/* if in batch mode, send last query even if it doesn't end with \g or go */
/* if in batch mode, send last query even if it doesn't end with \g or go */
...
@@ -934,7 +936,8 @@ static COMMANDS *find_command (char *name,char cmd_char)
...
@@ -934,7 +936,8 @@ static COMMANDS *find_command (char *name,char cmd_char)
}
}
static
bool
add_line
(
String
&
buffer
,
char
*
line
,
char
*
in_string
)
static
bool
add_line
(
String
&
buffer
,
char
*
line
,
char
*
in_string
,
bool
*
ml_comment
)
{
{
uchar
inchar
;
uchar
inchar
;
char
buff
[
80
],
*
pos
,
*
out
;
char
buff
[
80
],
*
pos
,
*
out
;
...
@@ -965,7 +968,7 @@ static bool add_line(String &buffer,char *line,char *in_string)
...
@@ -965,7 +968,7 @@ static bool add_line(String &buffer,char *line,char *in_string)
continue
;
continue
;
}
}
#endif
#endif
if
(
inchar
==
'\\'
)
if
(
!*
ml_comment
&&
inchar
==
'\\'
)
{
// mSQL or postgreSQL style command ?
{
// mSQL or postgreSQL style command ?
if
(
!
(
inchar
=
(
uchar
)
*++
pos
))
if
(
!
(
inchar
=
(
uchar
)
*++
pos
))
break
;
// readline adds one '\'
break
;
// readline adds one '\'
...
@@ -999,7 +1002,7 @@ static bool add_line(String &buffer,char *line,char *in_string)
...
@@ -999,7 +1002,7 @@ static bool add_line(String &buffer,char *line,char *in_string)
continue
;
continue
;
}
}
}
}
else
if
(
inchar
==
';'
&&
!*
in_string
)
else
if
(
!*
ml_comment
&&
inchar
==
';'
&&
!*
in_string
)
{
// ';' is end of command
{
// ';' is end of command
if
(
out
!=
line
)
if
(
out
!=
line
)
buffer
.
append
(
line
,(
uint
)
(
out
-
line
));
// Add this line
buffer
.
append
(
line
,(
uint
)
(
out
-
line
));
// Add this line
...
@@ -1019,17 +1022,33 @@ static bool add_line(String &buffer,char *line,char *in_string)
...
@@ -1019,17 +1022,33 @@ static bool add_line(String &buffer,char *line,char *in_string)
buffer
.
length
(
0
);
buffer
.
length
(
0
);
out
=
line
;
out
=
line
;
}
}
else
if
(
!*
in_string
&&
(
inchar
==
'#'
||
else
if
(
!*
ml_comment
&&
(
!*
in_string
&&
(
inchar
==
'#'
||
inchar
==
'-'
&&
pos
[
1
]
==
'-'
&&
inchar
==
'-'
&&
pos
[
1
]
==
'-'
&&
my_isspace
(
system_charset_info
,
pos
[
2
]
)))
my_isspace
(
system_charset_info
,
pos
[
2
])
)))
break
;
// comment to end of line
break
;
// comment to end of line
else
if
(
!*
in_string
&&
inchar
==
'/'
&&
*
(
pos
+
1
)
==
'*'
)
{
pos
++
;
*
ml_comment
=
1
;
if
(
out
!=
line
)
{
buffer
.
append
(
line
,(
uint
)
(
out
-
line
));
out
=
line
;
}
}
else
if
(
*
ml_comment
&&
!*
in_string
&&
inchar
==
'*'
&&
*
(
pos
+
1
)
==
'/'
)
{
pos
++
;
*
ml_comment
=
0
;
}
else
else
{
// Add found char to buffer
{
// Add found char to buffer
if
(
inchar
==
*
in_string
)
if
(
inchar
==
*
in_string
)
*
in_string
=
0
;
*
in_string
=
0
;
else
if
(
!*
in_string
&&
(
inchar
==
'\''
||
inchar
==
'"'
))
else
if
(
!*
in_string
&&
(
inchar
==
'\''
||
inchar
==
'"'
))
*
in_string
=
(
char
)
inchar
;
*
in_string
=
(
char
)
inchar
;
*
out
++
=
(
char
)
inchar
;
if
(
!
(
*
ml_comment
))
*
out
++
=
(
char
)
inchar
;
}
}
}
}
if
(
out
!=
line
||
!
buffer
.
is_empty
())
if
(
out
!=
line
||
!
buffer
.
is_empty
())
...
@@ -1038,7 +1057,7 @@ static bool add_line(String &buffer,char *line,char *in_string)
...
@@ -1038,7 +1057,7 @@ static bool add_line(String &buffer,char *line,char *in_string)
uint
length
=
(
uint
)
(
out
-
line
);
uint
length
=
(
uint
)
(
out
-
line
);
if
(
buffer
.
length
()
+
length
>=
buffer
.
alloced_length
())
if
(
buffer
.
length
()
+
length
>=
buffer
.
alloced_length
())
buffer
.
realloc
(
buffer
.
length
()
+
length
+
IO_SIZE
);
buffer
.
realloc
(
buffer
.
length
()
+
length
+
IO_SIZE
);
if
(
buffer
.
append
(
line
,
length
))
if
(
!
(
*
ml_comment
)
&&
buffer
.
append
(
line
,
length
))
return
1
;
return
1
;
}
}
return
0
;
return
0
;
...
...
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