mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
LOAD_FILE() is now COERCIBLE
LOAD_FILE() tests
This commit is contained in:
@ -486,8 +486,19 @@ fish 10
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (id integer auto_increment unique,imagem LONGBLOB not null);
|
create table t1 (id integer auto_increment unique,imagem LONGBLOB not null);
|
||||||
insert into t1 (id) values (1);
|
insert into t1 (id) values (1);
|
||||||
|
select
|
||||||
|
charset(load_file('../../std_data/words.dat')),
|
||||||
|
collation(load_file('../../std_data/words.dat')),
|
||||||
|
coercibility(load_file('../../std_data/words.dat'));
|
||||||
|
charset(load_file('../../std_data/words.dat')) collation(load_file('../../std_data/words.dat')) coercibility(load_file('../../std_data/words.dat'))
|
||||||
|
binary binary 3
|
||||||
update t1 set imagem=load_file('../../std_data/words.dat') where id=1;
|
update t1 set imagem=load_file('../../std_data/words.dat') where id=1;
|
||||||
select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1;
|
select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1;
|
||||||
if(imagem is null, "ERROR", "OK") length(imagem)
|
if(imagem is null, "ERROR", "OK") length(imagem)
|
||||||
OK 581
|
OK 581
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1 select load_file('../../std_data/words.dat');
|
||||||
|
show full fields from t1;
|
||||||
|
Field Type Collation Null Key Default Extra Privileges Comment
|
||||||
|
load_file('../../std_data/words.dat') mediumblob NULL YES NULL select,insert,update,references
|
||||||
|
drop table t1;
|
||||||
|
@ -294,6 +294,13 @@ drop table t1;
|
|||||||
|
|
||||||
create table t1 (id integer auto_increment unique,imagem LONGBLOB not null);
|
create table t1 (id integer auto_increment unique,imagem LONGBLOB not null);
|
||||||
insert into t1 (id) values (1);
|
insert into t1 (id) values (1);
|
||||||
|
select
|
||||||
|
charset(load_file('../../std_data/words.dat')),
|
||||||
|
collation(load_file('../../std_data/words.dat')),
|
||||||
|
coercibility(load_file('../../std_data/words.dat'));
|
||||||
update t1 set imagem=load_file('../../std_data/words.dat') where id=1;
|
update t1 set imagem=load_file('../../std_data/words.dat') where id=1;
|
||||||
select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1;
|
select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1 select load_file('../../std_data/words.dat');
|
||||||
|
show full fields from t1;
|
||||||
|
drop table t1;
|
||||||
|
@ -536,7 +536,7 @@ public:
|
|||||||
const char *func_name() const { return "load_file"; }
|
const char *func_name() const { return "load_file"; }
|
||||||
void fix_length_and_dec()
|
void fix_length_and_dec()
|
||||||
{
|
{
|
||||||
set_charset(&my_charset_bin);
|
set_charset(&my_charset_bin, COER_COERCIBLE);
|
||||||
maybe_null=1;
|
maybe_null=1;
|
||||||
max_length=MAX_BLOB_WIDTH;
|
max_length=MAX_BLOB_WIDTH;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user