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
dcb52935
Commit
dcb52935
authored
Dec 12, 2002
by
hf@deer.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some fixes
parent
5e8b27c0
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
35 additions
and
112 deletions
+35
-112
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
libmysqld/lib_sql.cc
libmysqld/lib_sql.cc
+8
-84
libmysqld/lib_vio.c
libmysqld/lib_vio.c
+1
-1
libmysqld/libmysqld.c
libmysqld/libmysqld.c
+3
-14
sql/field.cc
sql/field.cc
+2
-3
sql/item.cc
sql/item.cc
+9
-1
sql/item_strfunc.cc
sql/item_strfunc.cc
+2
-2
sql/mysqld.cc
sql/mysqld.cc
+6
-5
sql/sql_show.cc
sql/sql_show.cc
+2
-1
sql/sql_table.cc
sql/sql_table.cc
+1
-1
No files found.
BitKeeper/etc/logging_ok
View file @
dcb52935
...
...
@@ -23,6 +23,7 @@ heikki@rescue.
heikki@work.mysql.com
hf@bison.(none)
hf@bisonxp.(none)
hf@deer.mysql.r18.ru
hf@genie.(none)
jani@dsl-jkl1657.dial.inet.fi
jani@hynda.(none)
...
...
libmysqld/lib_sql.cc
View file @
dcb52935
...
...
@@ -380,13 +380,13 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups)
error_handler_hook
=
my_message_sql
;
opt_noacl
=
1
;
// No permissions
if
(
acl_init
(
opt_noacl
))
if
(
acl_init
(
(
THD
*
)
0
,
opt_noacl
))
{
mysql_server_end
();
return
1
;
}
if
(
!
opt_noacl
)
(
void
)
grant_init
();
(
void
)
grant_init
(
(
THD
*
)
0
);
init_max_user_conn
();
init_update_queries
();
...
...
@@ -664,13 +664,13 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups)
exit
(
1
);
}
opt_noacl
=
1
;
// No permissions
if
(
acl_init
(
(
THD
*
)
0
,
opt_noacl
))
if
(
acl_init
(
opt_noacl
))
{
mysql_server_end
();
return
1
;
}
if
(
!
opt_noacl
)
(
void
)
grant_init
(
(
THD
*
)
0
);
(
void
)
grant_init
();
init_max_user_conn
();
init_update_queries
();
...
...
@@ -1148,9 +1148,10 @@ bool send_fields(THD *thd, List<Item> &list, uint flag)
MYSQL
*
mysql
=
thd
->
mysql
;
if
(
!
(
mysql
->
result
=
(
MYSQL_RES
*
)
my_malloc
(
sizeof
(
MYSQL_RES
)
+
sizeof
(
ulong
)
*
field_count
,
sizeof
(
ulong
)
*
(
field_count
+
1
)
,
MYF
(
MY_WME
|
MY_ZEROFILL
))))
goto
err
;
mysql
->
result
->
lengths
=
(
ulong
*
)(
mysql
->
result
+
1
);
mysql
->
field_count
=
field_count
;
alloc
=
&
mysql
->
field_alloc
;
...
...
@@ -1241,83 +1242,6 @@ net_field_length(uchar **packet)
return
(
ulong
)
uint4korr
(
pos
+
1
);
}
#ifdef __DUMMY
bool
select_send___send_data
(
List
<
Item
>
&
items
)
{
List_iterator_fast
<
Item
>
li
(
items
);
Item
*
item
;
String
*
packet
=
&
thd
->
packet
;
MYSQL
*
mysql
=
thd
->
mysql
;
MYSQL_DATA
*
result
=
mysql
->
result
->
data
;
MYSQL_ROWS
**
prev_ptr
=
&
mysql
->
result
->
data
->
data
;
MYSQL_ROWS
*
cur
;
MEM_ROOT
*
alloc
=
&
mysql
->
result
->
data
->
alloc
;
char
*
to
;
int
n_fields
=
items
.
elements
;
uchar
*
cp
;
MYSQL_FIELD
*
mysql_fields
=
mysql
->
result
->
fields
;
MYSQL_ROW
cur_field
,
end_field
;
ulong
len
;
DBUG_ENTER
(
"send_data"
);
if
(
unit
->
offset_limit_cnt
)
{
// using limit offset,count
unit
->
offset_limit_cnt
--
;
DBUG_RETURN
(
0
);
}
thd
->
packet
.
length
(
0
);
while
((
item
=
li
++
))
{
if
(
item
->
send
(
thd
,
packet
))
{
packet
->
free
();
my_error
(
ER_OUT_OF_RESOURCES
,
MYF
(
0
));
DBUG_RETURN
(
1
);
}
}
result
->
rows
++
;
if
(
!
(
cur
=
(
MYSQL_ROWS
*
)
alloc_root
(
alloc
,
sizeof
(
MYSQL_ROWS
)))
||
!
(
cur
->
data
=
(
MYSQL_ROW
)
alloc_root
(
alloc
,
(
n_fields
+
1
)
*
sizeof
(
char
*
)
+
packet
->
length
())))
{
my_error
(
ER_OUT_OF_RESOURCES
,
MYF
(
0
));
DBUG_RETURN
(
1
);
}
*
result
->
prev_ptr
=
cur
;
result
->
prev_ptr
=
&
cur
->
next
;
to
=
(
char
*
)
(
cur
->
data
+
n_fields
+
1
);
cp
=
(
uchar
*
)
packet
->
ptr
();
end_field
=
cur
->
data
+
n_fields
;
for
(
cur_field
=
cur
->
data
;
cur_field
<
end_field
;
++
cur_field
,
++
mysql_fields
)
{
if
((
len
=
(
ulong
)
net_field_length
(
&
cp
))
==
NULL_LENGTH
)
{
*
cur_field
=
0
;
}
else
{
*
cur_field
=
to
;
memcpy
(
to
,(
char
*
)
cp
,
len
);
to
[
len
]
=
0
;
to
+=
len
+
1
;
cp
+=
len
;
if
(
mysql_fields
->
max_length
<
len
)
mysql_fields
->
max_length
=
len
;
}
}
*
cur_field
=
to
;
DBUG_RETURN
(
0
);
}
#endif
bool
select_send
::
send_data
(
List
<
Item
>
&
items
)
{
List_iterator_fast
<
Item
>
li
(
items
);
...
...
@@ -1474,12 +1398,12 @@ int embedded_send_row(THD *thd, int n_fields, char *data, int data_len)
DBUG_ENTER
(
"embedded_send_row"
);
result
->
rows
++
;
if
(
!
(
cur
=
(
MYSQL_ROWS
*
)
alloc_root
(
alloc
,
sizeof
(
MYSQL_ROWS
)
+
(
n_fields
+
1
)
*
sizeof
(
char
*
)
+
data_len
)))
if
(
!
(
cur
=
(
MYSQL_ROWS
*
)
alloc_root
(
alloc
,
sizeof
(
MYSQL_ROWS
)
+
(
n_fields
+
1
)
*
sizeof
(
MYSQL_ROW
)
+
data_len
)))
{
my_error
(
ER_OUT_OF_RESOURCES
,
MYF
(
0
));
DBUG_RETURN
(
1
);
}
cur
->
data
=
(
MYSQL_ROW
)(
(
char
*
)
cur
)
+
sizeof
(
MYSQL_ROWS
);
cur
->
data
=
(
MYSQL_ROW
)(
cur
+
1
);
*
result
->
prev_ptr
=
cur
;
result
->
prev_ptr
=
&
cur
->
next
;
...
...
libmysqld/lib_vio.c
View file @
dcb52935
...
...
@@ -219,7 +219,7 @@ int create_vio(NET *net, int separate_thread)
Vio
*
v
=
net
->
vio
;
if
(
!
v
)
{
v
=
vio_new
(
0
,
separate_thread
?
VIO_
SHARED_MEMORY
:
VIO
_BUFFER
,
0
);
v
=
vio_new
(
0
,
separate_thread
?
VIO_
TYPE_SHARED_MEMORY
:
VIO_TYPE
_BUFFER
,
0
);
net
->
vio
=
v
;
}
return
!
v
;
...
...
libmysqld/libmysqld.c
View file @
dcb52935
...
...
@@ -1336,28 +1336,17 @@ mysql_fetch_row(MYSQL_RES *res)
ulong
*
STDCALL
mysql_fetch_lengths
(
MYSQL_RES
*
res
)
{
ulong
*
lengths
,
*
prev_length
;
byte
*
start
;
ulong
*
lengths
;
MYSQL_ROW
column
,
end
;
if
(
!
(
column
=
res
->
current_row
))
return
0
;
/* Something is wrong */
if
(
res
->
data
)
{
start
=
0
;
prev_length
=
0
;
/* Keep gcc happy */
lengths
=
res
->
lengths
;
for
(
end
=
column
+
res
->
field_count
+
1
;
column
!=
end
;
column
++
,
lengths
++
)
for
(
end
=
column
+
res
->
field_count
;
column
!=
end
;
column
++
,
lengths
++
)
{
if
(
!*
column
)
{
*
lengths
=
0
;
/* Null */
continue
;
}
if
(
start
)
/* Found end of prev string */
*
prev_length
=
(
uint
)
(
*
column
-
start
-
1
);
start
=
*
column
;
prev_length
=
lengths
;
*
lengths
=
*
column
?
strlen
(
*
column
)
:
0
;
}
}
return
res
->
lengths
;
...
...
sql/field.cc
View file @
dcb52935
...
...
@@ -5216,12 +5216,11 @@ Field *make_field(char *ptr, uint32 field_length,
if
(
f_is_geom
(
pack_flag
))
return
new
Field_geom
(
ptr
,
null_pos
,
null_bit
,
unireg_check
,
field_name
,
table
,
pack_length
,
f_is_binary
(
pack_flag
)
!=
0
);
pack_length
);
if
(
f_is_blob
(
pack_flag
))
return
new
Field_blob
(
ptr
,
null_pos
,
null_bit
,
unireg_check
,
field_name
,
table
,
pack_length
,
f_is_binary
(
pack_flag
)
!=
0
,
default_charset_info
);
pack_length
,
field_charset
);
if
(
interval
)
{
if
(
f_is_enum
(
pack_flag
))
...
...
sql/item.cc
View file @
dcb52935
...
...
@@ -930,6 +930,12 @@ bool Item::embedded_send(const CONVERT *convert, CHARSET_INFO *charset, MEM_ROOT
String
s
(
buff
,
sizeof
(
buff
),
charset
),
*
value
;
if
(
!
(
value
=
val_str
(
&
s
))
||
!
(
*
result
=
alloc_root
(
alloc
,
value
->
length
()
+
1
)))
{
*
result
=
NULL
;
*
length
=
0
;
return
false
;
}
if
(
!
(
*
result
=
alloc_root
(
alloc
,
value
->
length
()
+
1
)))
return
true
;
*
length
=
value
->
length
();
if
(
convert
)
...
...
@@ -944,6 +950,7 @@ bool Item_null::embedded_send(const CONVERT *convert, CHARSET_INFO *charset, MEM
char
**
result
,
ulong
*
length
)
{
*
result
=
NULL
;
*
length
=
0
;
return
false
;
}
...
...
@@ -952,7 +959,8 @@ bool Item_field::embedded_send(const CONVERT *convert, CHARSET_INFO *charset, ME
{
if
(
result_field
->
is_null
())
{
result
=
NULL
;
*
result
=
NULL
;
*
length
=
0
;
return
false
;
}
...
...
sql/item_strfunc.cc
View file @
dcb52935
...
...
@@ -1380,7 +1380,7 @@ String *Item_func_user::val_str(String *str)
uint32
res_length
=
(
strlen
(
thd
->
user
)
+
strlen
(
host
)
+
10
)
*
cs
->
mbmaxlen
;
#ifdef EMBEDDED_LIBRARY
if
(
str
->
copy
(
"localuser@localhost"
,
(
uint
)
strlen
(
"localuser@localhost"
)))
if
(
str
->
copy
(
"localuser@localhost"
,
(
uint
)
strlen
(
"localuser@localhost"
)
,
cs
))
return
&
empty_string
;
#else
if
(
str
->
alloc
(
res_length
))
...
...
@@ -1390,9 +1390,9 @@ String *Item_func_user::val_str(String *str)
}
res_length
=
cs
->
snprintf
(
cs
,
(
char
*
)
str
->
ptr
(),
res_length
,
"%s@%s"
,
thd
->
user
,
host
);
str
->
length
(
res_length
);
#endif
str
->
set_charset
(
cs
);
return
str
;
#endif
}
void
Item_func_soundex
::
fix_length_and_dec
()
...
...
sql/mysqld.cc
View file @
dcb52935
...
...
@@ -1857,6 +1857,9 @@ static int init_common_variables(const char *conf_file_name, int argc, char **ar
if
(
gethostname
(
glob_hostname
,
sizeof
(
glob_hostname
)
-
4
)
<
0
)
strmov
(
glob_hostname
,
"mysql"
);
strmake
(
pidfile_name
,
glob_hostname
,
sizeof
(
pidfile_name
)
-
5
);
strmov
(
fn_ext
(
pidfile_name
),
".pid"
);
// Add proper extension
#ifndef DBUG_OFF
strxmov
(
strend
(
server_version
),
MYSQL_SERVER_SUFFIX
,
"-debug"
,
NullS
);
#else
...
...
@@ -2138,6 +2141,7 @@ int main(int argc, char **argv)
#endif
MY_INIT
(
argv
[
0
]);
// init my_sys library & pthreads
if
((
init_error
=
init_common_variables
(
MYSQL_CONFIG_NAME
,
argc
,
argv
,
load_default_groups
)))
if
(
init_error
==
2
)
...
...
@@ -2145,9 +2149,6 @@ int main(int argc, char **argv)
else
exit
(
1
);
strmake
(
pidfile_name
,
glob_hostname
,
sizeof
(
pidfile_name
)
-
5
);
strmov
(
fn_ext
(
pidfile_name
),
".pid"
);
// Add proper extension
init_signals
();
if
(
init_thread_environement
())
exit
(
1
);
...
...
@@ -2221,7 +2222,7 @@ The server will not act as a slave.");
*/
error_handler_hook
=
my_message_sql
;
start_signal_handler
();
// Creates pidfile
if
(
acl_init
(
opt_noacl
))
if
(
acl_init
(
(
THD
*
)
0
,
opt_noacl
))
{
abort_loop
=
1
;
select_thread_in_use
=
0
;
...
...
@@ -2233,7 +2234,7 @@ The server will not act as a slave.");
exit
(
1
);
}
if
(
!
opt_noacl
)
(
void
)
grant_init
();
(
void
)
grant_init
(
(
THD
*
)
0
);
#ifdef HAVE_DLOPEN
if
(
!
opt_noacl
)
...
...
sql/sql_show.cc
View file @
dcb52935
...
...
@@ -683,13 +683,14 @@ mysqld_show_fields(THD *thd, TABLE_LIST *table_list,const char *wild,
field_list
.
push_back
(
new
Item_empty_string
(
"Comment"
,
255
));
}
// Send first number of fields and records
#ifndef EMBEDDED_LIBRARY
{
char
*
pos
;
pos
=
net_store_length
(
tmp
,
(
uint
)
field_list
.
elements
);
pos
=
net_store_length
(
pos
,(
ulonglong
)
file
->
records
);
(
void
)
my_net_write
(
&
thd
->
net
,
tmp
,(
uint
)
(
pos
-
tmp
));
}
#endif
if
(
send_fields
(
thd
,
field_list
,
0
))
DBUG_RETURN
(
1
);
restore_record
(
table
,
2
);
// Get empty record
...
...
sql/sql_table.cc
View file @
dcb52935
...
...
@@ -420,7 +420,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
sql_field
->
pack_flag
=
FIELDFLAG_GEOM
|
pack_length_to_packflag
(
sql_field
->
pack_length
-
portable_sizeof_char_ptr
);
if
(
sql_field
->
flags
&
BINARY_FLAG
)
if
(
sql_field
->
charset
->
state
&
MY_CS_BINSORT
)
sql_field
->
pack_flag
|=
FIELDFLAG_BINARY
;
sql_field
->
length
=
8
;
// Unireg field length
sql_field
->
unireg_check
=
Field
::
BLOB_FIELD
;
...
...
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