summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-06-21 10:21:20 +0300
committerunknown <monty@mysql.com>2004-06-21 10:21:20 +0300
commitb5dfd05662464d2c19da349942914cce897cdbaf (patch)
treea55d40c04126c696aec19a9bdd340a11258e07e6 /sql
parent2b9a8afa50c3575f924587588ce13852933d4d15 (diff)
downloadmariadb-git-b5dfd05662464d2c19da349942914cce897cdbaf.tar.gz
After merge fixes
Return NULL if a time argument is given to date_add(). (Warning will be shown after Dimitri's timezone patch is pushed) client/mysqltest.c: Added MAX_VAR_NAME which was lost in merge Added more debugging Fixed bug in 'eval' innobase/data/data0type.c: After merge fix innobase/fil/fil0fil.c: After merge fix innobase/log/log0recv.c: After merge fix myisam/mi_unique.c: Better checksum handling mysql-test/r/func_time.result: Return NULL if a time argument is given to date_add() mysql-test/r/rpl_free_items.result: After merge fix mysql-test/r/rpl_get_lock.result: Test was depending on when server was restarted. mysql-test/r/type_date.result: After merge fix mysql-test/r/type_decimal.result: After merge fix mysql-test/t/func_time.test: Removed comment that is not needed anymore (After Dimitri's timezone patch is pushed, we should get a warning for the date_add(time...) entry) mysql-test/t/rpl_get_lock.test: Test was depending on when server was restarted. mysql-test/t/type_date.test: Addded missing explanation for bug netware/mysqld_safe.c: Removed end \r Run program through indent-ex to get MySQL indentation sql-common/client.c: After merge fix sql/field.cc: Fixed that get_date(time) gives a warning sql/field.h: After merge fix sql/net_serv.cc: More debugging (if DEBUG_DATA_PACKETS is set) sql/sql_class.cc: Removed compiler warning sql/table.cc: Better comment
Diffstat (limited to 'sql')
-rw-r--r--sql/field.cc17
-rw-r--r--sql/field.h2
-rw-r--r--sql/net_serv.cc12
-rw-r--r--sql/sql_class.cc3
-rw-r--r--sql/table.cc2
5 files changed, 29 insertions, 7 deletions
diff --git a/sql/field.cc b/sql/field.cc
index 2077a6e5455..bc76d05a05b 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -3395,10 +3395,21 @@ String *Field_time::val_str(String *val_buffer,
}
-bool Field_time::get_date(TIME *ltime,
- bool fuzzydate __attribute__((unused)))
+/*
+ Normally we would not consider 'time' as a vaild date, but we allow
+ get_date() here to be able to do things like
+ DATE_FORMAT(time, "%l.%i %p")
+*/
+
+bool Field_time::get_date(TIME *ltime, uint fuzzydate)
{
- long tmp=(long) sint3korr(ptr);
+ long tmp;
+ if (!fuzzydate)
+ {
+ set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE);
+ return 1;
+ }
+ tmp=(long) sint3korr(ptr);
ltime->neg=0;
if (tmp < 0)
{
diff --git a/sql/field.h b/sql/field.h
index f4c8c5a9955..c17b11f99e6 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -800,7 +800,7 @@ public:
double val_real(void);
longlong val_int(void);
String *val_str(String*,String *);
- bool get_date(TIME *ltime,bool fuzzydate);
+ bool get_date(TIME *ltime, uint fuzzydate);
bool send_binary(Protocol *protocol);
bool get_time(TIME *ltime);
int cmp(const char *,const char*);
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index a0f7a779894..c2da47b480e 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -284,7 +284,9 @@ my_net_write(NET *net,const char *packet,ulong len)
buff[3]= (uchar) net->pkt_nr++;
if (net_write_buff(net,(char*) buff,NET_HEADER_SIZE))
return 1;
+#ifndef DEBUG_DATA_PACKETS
DBUG_DUMP("packet_header",(char*) buff,NET_HEADER_SIZE);
+#endif
return test(net_write_buff(net,packet,len));
}
@@ -394,6 +396,9 @@ net_write_buff(NET *net,const char *packet,ulong len)
else
left_length= (ulong) (net->buff_end - net->write_pos);
+#ifdef DEBUG_DATA_PACKETS
+ DBUG_DUMP("data", packet, len);
+#endif
if (len > left_length)
{
if (net->write_pos != net->buff)
@@ -776,6 +781,8 @@ my_real_read(NET *net, ulong *complen)
if (i == 0)
{ /* First parts is packet length */
ulong helping;
+ DBUG_DUMP("packet_header",(char*) net->buff+net->where_b,
+ NET_HEADER_SIZE);
if (net->buff[net->where_b + 3] != (uchar) net->pkt_nr)
{
if (net->buff[net->where_b] != (uchar) 255)
@@ -784,7 +791,6 @@ my_real_read(NET *net, ulong *complen)
("Packets out of order (Found: %d, expected %u)",
(int) net->buff[net->where_b + 3],
net->pkt_nr));
- DBUG_DUMP("packet_header",(char*) net->buff+net->where_b, 4);
#ifdef EXTRA_DEBUG
fprintf(stderr,"Packets out of order (Found: %d, expected %d)\n",
(int) net->buff[net->where_b + 3],
@@ -841,6 +847,10 @@ end:
vio_blocking(net->vio, net_blocking, &old_mode);
}
net->reading_or_writing=0;
+#ifdef DEBUG_DATA_PACKETS
+ if (len != packet_error)
+ DBUG_DUMP("data",(char*) net->buff+net->where_b, len);
+#endif
return(len);
}
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 704662fa4bf..7d0e0c3f78f 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -162,7 +162,8 @@ THD::THD():user_time(0), current_statement(0), is_fatal_error(0),
{
host= user= priv_user= db= ip=0;
host_or_ip= "connecting host";
- locked=killed=some_tables_deleted=no_errors=password= 0;
+ locked=some_tables_deleted=no_errors=password= 0;
+ killed=0;
query_start_used= 0;
count_cuted_fields= CHECK_FIELD_IGNORE;
db_length= col_access= 0;
diff --git a/sql/table.cc b/sql/table.cc
index 73f036aed87..e053eba7b6c 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1134,7 +1134,7 @@ File create_frm(register my_string name, uint reclength, uchar *fileinfo,
char fill[IO_SIZE];
#if SIZEOF_OFF_T > 4
- /* Fix this in MySQL 4.0; The current limit is 4G rows (QQ) */
+ /* Fix this when we have new .frm files; Current limit is 4G rows (QQ) */
if (create_info->max_rows > ~(ulong) 0)
create_info->max_rows= ~(ulong) 0;
if (create_info->min_rows > ~(ulong) 0)