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
f4da62e1
Commit
f4da62e1
authored
Jan 03, 2002
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
merged
sql/item_create.cc: Auto merged sql/item_func.h: Auto merged sql/lex.h: Auto merged
parents
f06d80f6
c7f9472b
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
39 additions
and
1 deletion
+39
-1
Docs/manual.texi
Docs/manual.texi
+11
-0
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+3
-0
mysql-test/r/handler.result
mysql-test/r/handler.result
+1
-0
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+1
-0
mysql-test/t/handler.test
mysql-test/t/handler.test
+2
-0
scripts/mysqlhotcopy.sh
scripts/mysqlhotcopy.sh
+1
-1
sql/item_create.cc
sql/item_create.cc
+5
-0
sql/item_create.h
sql/item_create.h
+1
-0
sql/item_func.h
sql/item_func.h
+8
-0
sql/lex.h
sql/lex.h
+1
-0
sql/sql_handler.cc
sql/sql_handler.cc
+5
-0
No files found.
Docs/manual.texi
View file @
f4da62e1
...
...
@@ -30091,6 +30091,15 @@ mysql> select OCTET_LENGTH('text');
Note that for @code{CHAR_LENGTH()}, multi-byte characters are only counted
once.
@findex BIT_LENGTH()
@item BIT_LENGTH(str)
Returns the length of the string @code{str} in bits:
@example
mysql> select BIT_LENGTH('text');
-> 32
@end example
@findex LOCATE()
@findex POSITION()
@item LOCATE(substr,str)
...
...
@@ -47996,6 +48005,8 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
@itemize @bullet
@item
ODBC compatibility: added @code{BIT_LENGTH()} function.
@item
Added @code{CAST()} and @code{CONVERT()} functions.
@item
Changed order of how keys are created in tables.
mysql-test/r/func_str.result
View file @
f4da62e1
...
...
@@ -8,6 +8,9 @@ hellomonty
select length('\n\t\r\b\0\_\%\\');
length('\n\t\r\b\0\_\%\\')
10
select bit_length('\n\t\r\b\0\_\%\\');
bit_length('\n\t\r\b\0\_\%\\')
80
select concat('monty',' was here ','again'),length('hello'),char(ascii('h'));
concat('monty',' was here ','again') length('hello') char(ascii('h'))
monty was here again 5 h
...
...
mysql-test/r/handler.result
View file @
f4da62e1
...
...
@@ -129,6 +129,7 @@ a b
handler t2 read next;
a b
18 eee
alter table t1 type=MyISAM;
handler t2 read next;
a b
19 fff
...
...
mysql-test/t/func_str.test
View file @
f4da62e1
...
...
@@ -9,6 +9,7 @@ drop table if exists t1;
select
'hello'
,
"'hello'"
,
'""hello""'
,
'''h''e''l''l''o'''
,
"hel""lo"
,
'hel\'lo'
;
select
'hello'
'monty'
;
select
length
(
'\n\t\r\b\0\_\%\\'
);
select
bit_length
(
'\n\t\r\b\0\_\%\\'
);
select
concat
(
'monty'
,
' was here '
,
'again'
),
length
(
'hello'
),
char
(
ascii
(
'h'
));
select
locate
(
'he'
,
'hello'
),
locate
(
'he'
,
'hello'
,
2
),
locate
(
'lo'
,
'hello'
,
2
)
;
select
instr
(
'hello'
,
'HE'
),
instr
(
'hello'
,
binary
'HE'
),
instr
(
binary
'hello'
,
'HE'
);
...
...
mysql-test/t/handler.test
View file @
f4da62e1
...
...
@@ -58,8 +58,10 @@ handler t2 read a=(19) where b="yyy";
handler
t2
read
first
;
handler
t2
read
next
;
alter
table
t1
type
=
MyISAM
;
handler
t2
read
next
;
!
$
1064
handler
t2
read
last
;
handler
t2
close
;
drop
table
if
exists
t1
;
scripts/mysqlhotcopy.sh
View file @
f4da62e1
...
...
@@ -307,7 +307,7 @@ foreach my $rdb ( @db_desc ) {
$rdb
->
{
files
}
=
[
@db_files
]
;
$rdb
->
{
index
}
=
[
@index_files
]
;
my @hc_tables
=
map
{
"
$db
.
$_
"
}
@dbh_tables
;
my @hc_tables
=
map
{
"
`
$db
.
$_
`
"
}
@dbh_tables
;
$rdb
->
{
tables
}
=
[
@hc_tables
]
;
$rdb
->
{
raid_dirs
}
=
[
get_raid_dirs
(
$rdb
->
{
files
}
)
]
;
...
...
sql/item_create.cc
View file @
f4da62e1
...
...
@@ -200,6 +200,11 @@ Item *create_func_length(Item* a)
return
new
Item_func_length
(
a
);
}
Item
*
create_func_bit_length
(
Item
*
a
)
{
return
new
Item_func_bit_length
(
a
);
}
Item
*
create_func_char_length
(
Item
*
a
)
{
return
new
Item_func_char_length
(
a
);
...
...
sql/item_create.h
View file @
f4da62e1
...
...
@@ -22,6 +22,7 @@ Item *create_func_ascii(Item* a);
Item
*
create_func_asin
(
Item
*
a
);
Item
*
create_func_bin
(
Item
*
a
);
Item
*
create_func_bit_count
(
Item
*
a
);
Item
*
create_func_bit_length
(
Item
*
a
);
Item
*
create_func_ceiling
(
Item
*
a
);
Item
*
create_func_char_length
(
Item
*
a
);
Item
*
create_func_connection_id
(
void
);
...
...
sql/item_func.h
View file @
f4da62e1
...
...
@@ -522,6 +522,14 @@ class Item_func_length :public Item_int_func
void
fix_length_and_dec
()
{
max_length
=
10
;
}
};
class
Item_func_bit_length
:
public
Item_func_length
{
public:
Item_func_bit_length
(
Item
*
a
)
:
Item_func_length
(
a
)
{}
longlong
val_int
()
{
return
Item_func_length
::
val_int
()
*
8
;
}
const
char
*
func_name
()
const
{
return
"bit_length"
;
}
};
class
Item_func_char_length
:
public
Item_int_func
{
String
value
;
...
...
sql/lex.h
View file @
f4da62e1
...
...
@@ -396,6 +396,7 @@ static SYMBOL sql_functions[] = {
{
"BIT_AND"
,
SYM
(
BIT_AND
),
0
,
0
},
{
"CAST"
,
SYM
(
CAST_SYM
),
0
,
0
},
{
"CEILING"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_ceiling
)},
{
"BIT_LENGTH"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_bit_length
)},
{
"CHAR_LENGTH"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_char_length
)},
{
"CHARACTER_LENGTH"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_char_length
)},
{
"COALESCE"
,
SYM
(
COALESCE
),
0
,
0
},
...
...
sql/sql_handler.cc
View file @
f4da62e1
...
...
@@ -130,7 +130,11 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
select_limit
+=
offset_limit
;
send_fields
(
thd
,
list
,
1
);
HANDLER_TABLES_HACK
(
thd
);
MYSQL_LOCK
*
lock
=
mysql_lock_tables
(
thd
,
&
tables
->
table
,
1
);
HANDLER_TABLES_HACK
(
thd
);
if
(
!
lock
)
goto
err0
;
// mysql_lock_tables() printed error message already
for
(
uint
num_rows
=
0
;
num_rows
<
select_limit
;
)
{
...
...
@@ -238,6 +242,7 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
return
0
;
err:
mysql_unlock_tables
(
thd
,
lock
);
err0:
return
-
1
;
}
...
...
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