MySQL Forums
Forum List  »  Connector/C++

Re: Connector c++ 8 converting field Value for DATE to time_t
Posted by: Claude Mally
Date: August 22, 2021 01:25PM

Here are my raw bytes values

name type=STRING aka 11 : Puffball raw=5000750066006600620061006C006C00
owner type=STRING aka 11 : Diane raw=4400690061006E006500
species type=STRING aka 11 : hamster raw=680061006D007300740065007200
sex type=STRING aka 11 : f raw=6600
birth type=DATE aka 14 : <4 raw bytes> raw=CF0F031E
death type=DATE aka null


the birth date has the following bytes { 0xCF 0x0F 0x03 0x1E }

Here is my table using mysql console:

mysql> select * from pet;
+----------+-------+---------+------+------------+-------+
| name | owner | species | sex | birth | death |
+----------+-------+---------+------+------------+-------+
| Puffball | Diane | hamster | f | 1999-03-30 | NULL |
+----------+-------+---------+------+------------+-------+

mysql> describe pet;
+---------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+-------+
| name | varchar(20) | YES | | NULL | |
| owner | varchar(20) | YES | | NULL | |
| species | varchar(20) | YES | | NULL | |
| sex | char(1) | YES | | NULL | |
| birth | date | YES | | NULL | |
| death | date | YES | | NULL | |
+---------+-------------+------+-----+---------+-------+
6 rows in set (0.00 sec)

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Connector c++ 8 converting field Value for DATE to time_t
281
August 22, 2021 01:25PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.