mirror of
https://github.com/boostorg/mysql.git
synced 2026-02-14 12:52:17 +00:00
Updated README (merge)
This commit is contained in:
9
TODO.txt
9
TODO.txt
@@ -1,6 +1,3 @@
|
||||
Prepared statements
|
||||
Build in Windows
|
||||
Build in CI
|
||||
Multiresultset
|
||||
Text protocol
|
||||
Binary protocol (stored procedures)
|
||||
@@ -9,6 +6,7 @@ Handshake
|
||||
SSL
|
||||
compression
|
||||
Usability
|
||||
Connection quit
|
||||
Incomplete query reads: how does this affect further queries?
|
||||
Metadata in rows: being able to index by name
|
||||
Iterators for sync resultset iteration
|
||||
@@ -18,7 +16,6 @@ Usability
|
||||
Bit
|
||||
Geometry
|
||||
UNIX socket connection
|
||||
make_values
|
||||
connection::connect that handles TCP/Unix and MySQL connect
|
||||
connection::run_sql that hides the resultset concept
|
||||
Consider if header-only is a good idea
|
||||
@@ -46,4 +43,6 @@ Technical debt
|
||||
Test prepared statement binding to procedure out params
|
||||
More thorough testing for several NULLs in integration testing
|
||||
Query and statement tests for DELETEs
|
||||
prepared_statement::execute(): static_assert(), handle value&, const value&, anything convertible
|
||||
prepared_statement::execute(): static_assert(), handle value&, const value&, anything convertible
|
||||
Test for too many connections: do we have a buffer overrun there? (error msg shows incomplete)
|
||||
Add a connection quit in integ tests: they may fail under Windows otherwise
|
||||
@@ -188,14 +188,15 @@ inline void mysql::detail::serialize(
|
||||
{
|
||||
serialize_fields(
|
||||
ctx,
|
||||
int1(brokendt.tod.hours().count()),
|
||||
int1(brokendt.tod.minutes().count()),
|
||||
int1(brokendt.tod.seconds().count())
|
||||
int1(static_cast<std::uint8_t>(brokendt.tod.hours().count())),
|
||||
int1(static_cast<std::uint8_t>(brokendt.tod.minutes().count())),
|
||||
int1(static_cast<std::uint8_t>(brokendt.tod.seconds().count()))
|
||||
);
|
||||
}
|
||||
if (length >= 11)
|
||||
{
|
||||
serialize(int4(brokendt.tod.subseconds().count()), ctx);
|
||||
auto micros = static_cast<std::uint32_t>(brokendt.tod.subseconds().count());
|
||||
serialize(int4(micros), ctx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -229,9 +230,10 @@ inline mysql::Error mysql::detail::deserialize(
|
||||
if (err != Error::ok) return err;
|
||||
}
|
||||
|
||||
// Compose the final datetime
|
||||
output = date_part + std::chrono::hours(hours.value) + std::chrono::minutes(minutes.value) +
|
||||
std::chrono::seconds(seconds.value) + std::chrono::microseconds(micros.value);
|
||||
// Compose the final datetime. Doing time of day and date separately to avoid overflow
|
||||
auto time_of_day_part = std::chrono::hours(hours.value) + std::chrono::minutes(minutes.value) +
|
||||
std::chrono::seconds(seconds.value) + std::chrono::microseconds(micros.value);
|
||||
output = date_part + time_of_day_part;
|
||||
return Error::ok;
|
||||
}
|
||||
|
||||
@@ -258,15 +260,16 @@ inline void mysql::detail::serialize(
|
||||
serialize_fields(
|
||||
ctx,
|
||||
is_negative,
|
||||
int4(std::abs(broken.days.count())),
|
||||
int1(std::abs(broken.hours.count())),
|
||||
int1(std::abs(broken.minutes.count())),
|
||||
int1(std::abs(broken.seconds.count()))
|
||||
int4(static_cast<std::uint32_t>(std::abs(broken.days.count()))),
|
||||
int1(static_cast<std::uint8_t>(std::abs(broken.hours.count()))),
|
||||
int1(static_cast<std::uint8_t>(std::abs(broken.minutes.count()))),
|
||||
int1(static_cast<std::uint8_t>(std::abs(broken.seconds.count())))
|
||||
);
|
||||
}
|
||||
if (length >= 12)
|
||||
{
|
||||
serialize(int4(std::abs(broken.microseconds.count())), ctx);
|
||||
auto micros = static_cast<std::uint32_t>(std::abs(broken.microseconds.count()));
|
||||
serialize(int4(micros), ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -296,13 +296,13 @@ int round_micros(int input, int decimals)
|
||||
{
|
||||
assert(decimals >= 0 && decimals <= 6);
|
||||
if (decimals == 0) return 0;
|
||||
int modulus = std::pow(10, 6 - decimals);
|
||||
auto modulus = static_cast<int>(std::pow(10, 6 - decimals));
|
||||
return (input / modulus) * modulus;
|
||||
}
|
||||
|
||||
std::chrono::microseconds round_micros(std::chrono::microseconds input, int decimals)
|
||||
{
|
||||
return std::chrono::microseconds(round_micros(input.count(), decimals));
|
||||
return std::chrono::microseconds(round_micros(static_cast<int>(input.count()), decimals));
|
||||
}
|
||||
|
||||
std::pair<std::string, mysql::datetime> datetime_from_id(std::bitset<4> id, int decimals)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
-- Connection system variables
|
||||
SET NAMES utf8;
|
||||
SET global max_connections = 1000;
|
||||
|
||||
-- Database
|
||||
DROP DATABASE IF EXISTS awesome;
|
||||
|
||||
@@ -39,7 +39,7 @@ void meta_validator::validate(
|
||||
EXPECT_EQ(value.original_table(), org_table_);
|
||||
EXPECT_EQ(value.field_name(), field_);
|
||||
EXPECT_EQ(value.original_field_name(), org_field_);
|
||||
EXPECT_GT(value.column_length(), 0);
|
||||
EXPECT_GT(value.column_length(), 0u);
|
||||
EXPECT_EQ(value.type(), type_);
|
||||
EXPECT_EQ(value.decimals(), decimals_);
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ TEST_P(PrepareStatementTest, OkNoParams)
|
||||
auto stmt = GetParam()->prepare_statement(conn, "SELECT * FROM empty_table");
|
||||
stmt.validate_no_error();
|
||||
ASSERT_TRUE(stmt.value.valid());
|
||||
EXPECT_GT(stmt.value.id(), 0);
|
||||
EXPECT_GT(stmt.value.id(), 0u);
|
||||
EXPECT_EQ(stmt.value.num_params(), 0);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ TEST_P(PrepareStatementTest, OkWithParams)
|
||||
auto stmt = GetParam()->prepare_statement(conn, "SELECT * FROM empty_table WHERE id IN (?, ?)");
|
||||
stmt.validate_no_error();
|
||||
ASSERT_TRUE(stmt.value.valid());
|
||||
EXPECT_GT(stmt.value.id(), 0);
|
||||
EXPECT_GT(stmt.value.id(), 0u);
|
||||
EXPECT_EQ(stmt.value.num_params(), 2);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user