summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbar@bar.mysql.r18.ru <>2003-06-10 17:53:06 +0500
committerbar@bar.mysql.r18.ru <>2003-06-10 17:53:06 +0500
commit22a7449c7cabd8fb9f0fbe64719221750dd0ab0c (patch)
tree9d298ac86c52a45cc4f0bc22ec0234c97d62ca46
parent5b9db529667d46e6f832e130df35430cdf60660f (diff)
downloadmariadb-git-22a7449c7cabd8fb9f0fbe64719221750dd0ab0c.tar.gz
LOAD_FILE() is now COERCIBLE
LOAD_FILE() tests
-rw-r--r--mysql-test/r/type_blob.result11
-rw-r--r--mysql-test/t/type_blob.test7
-rw-r--r--sql/item_strfunc.h4
3 files changed, 20 insertions, 2 deletions
diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result
index c16c83e3c53..a537aeeca07 100644
--- a/mysql-test/r/type_blob.result
+++ b/mysql-test/r/type_blob.result
@@ -486,8 +486,19 @@ fish 10
drop table t1;
create table t1 (id integer auto_increment unique,imagem LONGBLOB not null);
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;
select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1;
if(imagem is null, "ERROR", "OK") length(imagem)
OK 581
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;
diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test
index 9c00abe980b..ebe342a4ef5 100644
--- a/mysql-test/t/type_blob.test
+++ b/mysql-test/t/type_blob.test
@@ -294,6 +294,13 @@ drop table t1;
create table t1 (id integer auto_increment unique,imagem LONGBLOB not null);
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;
select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1;
drop table t1;
+create table t1 select load_file('../../std_data/words.dat');
+show full fields from t1;
+drop table t1;
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 31d6c1fe89d..26c69668b0a 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -536,8 +536,8 @@ public:
const char *func_name() const { return "load_file"; }
void fix_length_and_dec()
{
- set_charset(&my_charset_bin);
- maybe_null=1;
+ set_charset(&my_charset_bin, COER_COERCIBLE);
+ maybe_null=1;
max_length=MAX_BLOB_WIDTH;
}
};