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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
5abd7226
Commit
5abd7226
authored
Sep 11, 2003
by
guilhem@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge gbichot@213.136.52.20:/home/bk/mysql-4.1
into mysql.com:/home/mysql_src/mysql-4.1
parents
332ac066
9de77cc9
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
53 additions
and
13 deletions
+53
-13
include/mysql.h
include/mysql.h
+7
-4
libmysql/client_settings.h
libmysql/client_settings.h
+2
-0
libmysql/libmysql.c
libmysql/libmysql.c
+1
-1
libmysqld/lib_sql.cc
libmysqld/lib_sql.cc
+2
-1
libmysqld/libmysqld.c
libmysqld/libmysqld.c
+35
-1
sql-common/client.c
sql-common/client.c
+3
-1
sql/client_settings.h
sql/client_settings.h
+2
-0
sql/mysqld.cc
sql/mysqld.cc
+1
-5
No files found.
include/mysql.h
View file @
5abd7226
...
...
@@ -414,8 +414,6 @@ const char * STDCALL mysql_get_host_info(MYSQL *mysql);
unsigned
int
STDCALL
mysql_get_proto_info
(
MYSQL
*
mysql
);
MYSQL_RES
*
STDCALL
mysql_list_dbs
(
MYSQL
*
mysql
,
const
char
*
wild
);
MYSQL_RES
*
STDCALL
mysql_list_tables
(
MYSQL
*
mysql
,
const
char
*
wild
);
MYSQL_RES
*
STDCALL
mysql_list_fields
(
MYSQL
*
mysql
,
const
char
*
table
,
const
char
*
wild
);
MYSQL_RES
*
STDCALL
mysql_list_processes
(
MYSQL
*
mysql
);
int
STDCALL
mysql_options
(
MYSQL
*
mysql
,
enum
mysql_option
option
,
const
char
*
arg
);
...
...
@@ -540,6 +538,7 @@ typedef struct st_mysql_stmt
#define mysql_read_query_result(mysql) (*(mysql)->methods->read_query_result)(mysql)
#define mysql_store_result(mysql) (*(mysql)->methods->store_result)(mysql)
#define mysql_use_result(mysql) (*(mysql)->methods->use_result)(mysql)
#define mysql_list_fields(mysql, table, wild) (*(mysql)->methods->list_fields)(mysql, table, wild)
typedef
struct
st_mysql_methods
{
...
...
@@ -549,10 +548,14 @@ typedef struct st_mysql_methods
const
char
*
header
,
unsigned
long
header_length
,
const
char
*
arg
,
unsigned
long
arg_length
,
my_bool
skip_check
);
unsigned
long
arg_length
,
my_bool
skip_check
);
MYSQL_RES
*
(
STDCALL
*
store_result
)(
MYSQL
*
mysql
);
MYSQL_RES
*
(
STDCALL
*
use_result
)(
MYSQL
*
mysql
);
void
(
STDCALL
*
fetch_lengths
)(
unsigned
long
*
to
,
MYSQL_ROW
column
,
uint
field_count
);
void
(
STDCALL
*
fetch_lengths
)(
unsigned
long
*
to
,
MYSQL_ROW
column
,
uint
field_count
);
MYSQL_RES
*
(
STDCALL
*
list_fields
)(
MYSQL
*
mysql
,
const
char
*
table
,
const
char
*
wild
);
}
MYSQL_METHODS
;
MYSQL_STMT
*
STDCALL
mysql_prepare
(
MYSQL
*
mysql
,
const
char
*
query
,
...
...
libmysql/client_settings.h
View file @
5abd7226
...
...
@@ -41,3 +41,5 @@ my_bool send_file_to_server(MYSQL *mysql, const char *filename);
#define reset_sigpipe(mysql)
#endif
MYSQL_RES
*
STDCALL
cli_list_fields
(
MYSQL
*
mysql
,
const
char
*
table
,
const
char
*
wild
);
libmysql/libmysql.c
View file @
5abd7226
...
...
@@ -974,7 +974,7 @@ mysql_list_tables(MYSQL *mysql, const char *wild)
**************************************************************************/
MYSQL_RES
*
STDCALL
mysql
_list_fields
(
MYSQL
*
mysql
,
const
char
*
table
,
const
char
*
wild
)
cli
_list_fields
(
MYSQL
*
mysql
,
const
char
*
table
,
const
char
*
wild
)
{
MYSQL_RES
*
result
;
MYSQL_DATA
*
query
;
...
...
libmysqld/lib_sql.cc
View file @
5abd7226
...
...
@@ -487,11 +487,12 @@ bool Protocol_simple::store_null()
bool
Protocol
::
net_store_data
(
const
char
*
from
,
uint
length
)
{
char
*
field_buf
;
if
(
!
(
field_buf
=
alloc_root
(
alloc
,
length
+
sizeof
(
uint
))))
if
(
!
(
field_buf
=
alloc_root
(
alloc
,
length
+
sizeof
(
uint
)
+
1
)))
return
true
;
*
(
uint
*
)
field_buf
=
length
;
*
next_field
=
field_buf
+
sizeof
(
uint
);
memcpy
(
*
next_field
,
from
,
length
);
(
*
next_field
)[
length
]
=
0
;
if
(
next_mysql_field
->
max_length
<
length
)
next_mysql_field
->
max_length
=
length
;
++
next_field
;
...
...
libmysqld/libmysqld.c
View file @
5abd7226
...
...
@@ -179,6 +179,39 @@ static void STDCALL emb_fetch_lengths(ulong *to, MYSQL_ROW column, uint field_co
*
to
=
*
column
?
*
(
uint
*
)((
*
column
)
-
sizeof
(
uint
))
:
0
;
}
/**************************************************************************
List all fields in a table
If wild is given then only the fields matching wild is returned
Instead of this use query:
show fields in 'table' like "wild"
**************************************************************************/
static
MYSQL_RES
*
STDCALL
emb_list_fields
(
MYSQL
*
mysql
,
const
char
*
table
,
const
char
*
wild
)
{
MYSQL_RES
*
result
;
MYSQL_DATA
*
query
;
char
buff
[
257
],
*
end
;
DBUG_ENTER
(
"mysql_list_fields"
);
DBUG_PRINT
(
"enter"
,(
"table: '%s' wild: '%s'"
,
table
,
wild
?
wild
:
""
));
LINT_INIT
(
query
);
end
=
strmake
(
strmake
(
buff
,
table
,
128
)
+
1
,
wild
?
wild
:
""
,
128
);
if
(
simple_command
(
mysql
,
COM_FIELD_LIST
,
buff
,(
ulong
)
(
end
-
buff
),
1
))
DBUG_RETURN
(
NULL
);
result
=
mysql
->
result
;
if
(
!
result
)
return
0
;
result
->
methods
=
mysql
->
methods
;
result
->
eof
=
1
;
DBUG_RETURN
(
result
);
}
/*
** Note that the mysql argument must be initialized with mysql_init()
...
...
@@ -195,7 +228,8 @@ static MYSQL_METHODS embedded_methods=
emb_advanced_command
,
emb_mysql_store_result
,
emb_mysql_use_result
,
emb_fetch_lengths
emb_fetch_lengths
,
emb_list_fields
};
MYSQL
*
STDCALL
...
...
sql-common/client.c
View file @
5abd7226
...
...
@@ -1406,7 +1406,8 @@ static MYSQL_METHODS client_methods=
cli_advanced_command
,
cli_mysql_store_result
,
cli_mysql_use_result
,
cli_fetch_lengths
cli_fetch_lengths
,
cli_list_fields
};
MYSQL
*
STDCALL
...
...
@@ -1432,6 +1433,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
#ifdef HAVE_SYS_UN_H
struct
sockaddr_un
UNIXaddr
;
#endif
init_sigpipe_variables
DBUG_ENTER
(
"mysql_real_connect"
);
LINT_INIT
(
host_info
);
...
...
sql/client_settings.h
View file @
5abd7226
...
...
@@ -32,3 +32,5 @@
#undef HAVE_SMEM
#undef _CUSTOMCONFIG_
#define cli_list_fields NULL
sql/mysqld.cc
View file @
5abd7226
...
...
@@ -5163,11 +5163,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
my_use_symdir
=
0
;
break
;
case
(
int
)
OPT_BIND_ADDRESS
:
if
(
argument
&&
my_isdigit
(
mysqld_charset
,
argument
[
0
]))
{
my_bind_addr
=
(
ulong
)
inet_addr
(
argument
);
}
else
if
(
!
argument
||
(
my_bind_addr
=
(
ulong
)
inet_addr
(
argument
))
==
INADDR_NONE
)
{
struct
hostent
*
ent
;
if
(
argument
||
argument
[
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