summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2004-05-15 17:07:44 +0500
committerunknown <hf@deer.(none)>2004-05-15 17:07:44 +0500
commit05cd698f542f295b4fcd28d4704bce0f37e534ca (patch)
tree925a39dedaa9aafde9d5be890ca8a898aeb7f4bc /sql
parentae95f38200b226191a290cf840e0d06b17304f82 (diff)
downloadmariadb-git-05cd698f542f295b4fcd28d4704bce0f37e534ca.tar.gz
Fixes for #3371, #3372, #3374, #3375, #3376
libmysql/libmysql.c: code to fix #3772 counting of field->max_length moved to mysql_store_stmt_result so it will work in libmysqld also libmysqld/lib_sql.cc: to fix #3771 and #3775 stmt->affected_rows specifying added code getting default values changed so it will add terminating /0 to values sql/sql_parse.cc: to fix #3773 silly mistake here :\ sql/sql_prepare.cc: to fix #3774 and #3776 special function for datetime values in embedded server added unsigned flag now specified for values in embedded server tests/client_test.c: this test fails if privilege-checking pars are disabled (it's the default for libmysqld)
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_parse.cc2
-rw-r--r--sql/sql_prepare.cc58
2 files changed, 59 insertions, 1 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index e949d40625d..9a750b2df99 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1493,7 +1493,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->query_rest.length(length);
}
else
- thd->query_rest.copy(length);
+ thd->query_rest.copy(packet, length, thd->query_rest.charset());
break;
#endif /*EMBEDDED_LIBRARY*/
}
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 61e5b778b64..68da21018a0 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -309,6 +309,7 @@ void set_param_double(Item_param *param, uchar **pos, ulong len)
*pos+= 8;
}
+#ifndef EMBEDDED_LIBRARY
void set_param_time(Item_param *param, uchar **pos, ulong len)
{
ulong length;
@@ -386,6 +387,62 @@ void set_param_date(Item_param *param, uchar **pos, ulong len)
*pos+= length;
}
+#else/*!EMBEDDED_LIBRARY*/
+void set_param_time(Item_param *param, uchar **pos, ulong len)
+{
+ TIME tm;
+ MYSQL_TIME *to= (MYSQL_TIME*)*pos;
+
+ tm.second_part= to->second_part;
+
+ tm.day= to->day;
+ tm.hour= to->hour;
+ tm.minute= to->minute;
+ tm.second= to->second;
+
+ tm.year= tm.month= 0;
+ tm.neg= to->neg;
+
+ param->set_time(&tm, TIMESTAMP_TIME);
+}
+
+void set_param_datetime(Item_param *param, uchar **pos, ulong len)
+{
+ TIME tm;
+ MYSQL_TIME *to= (MYSQL_TIME*)*pos;
+
+ tm.second_part= to->second_part;
+
+ tm.day= to->day;
+ tm.hour= to->hour;
+ tm.minute= to->minute;
+ tm.second= to->second;
+ tm.year= to->year;
+ tm.month= to->month;
+ tm.neg= 0;
+
+ param->set_time(&tm, TIMESTAMP_DATETIME);
+}
+
+void set_param_date(Item_param *param, uchar **pos, ulong len)
+{
+ TIME tm;
+ MYSQL_TIME *to= (MYSQL_TIME*)*pos;
+
+ tm.second_part= to->second_part;
+
+ tm.day= to->day;
+ tm.year= to->year;
+ tm.month= to->month;
+ tm.neg= 0;
+ tm.hour= tm.minute= tm.second= 0;
+ tm.second_part= 0;
+ tm.neg= 0;
+
+ param->set_time(&tm, TIMESTAMP_DATE);
+}
+#endif /*!EMBEDDED_LIBRARY*/
+
void set_param_str(Item_param *param, uchar **pos, ulong len)
{
ulong length= get_param_length(pos, len);
@@ -568,6 +625,7 @@ static bool emb_insert_params(Prepared_statement *stmt)
{
Item_param *param= *it;
setup_one_conversion_function(param, client_param->buffer_type);
+ param->unsigned_flag= client_param->is_unsigned;
if (!param->long_data_supplied)
{
if (*client_param->is_null)