Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream merge #1

Merged
merged 5 commits into from
Jul 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 0 additions & 64 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ categories = ["api-bindings", "network-programming", "database-implementations"]
license = "MIT/Apache-2.0"

[badges]
travis-ci = { repository = "jonhoo/msql-srv" }
azure-devops = { project = "jonhoo/jonhoo", pipeline = "msql-srv", build = "27" }
codecov = { repository = "jonhoo/msql-srv", branch = "master", service = "github" }
maintenance = { status = "experimental" }

Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

[![Crates.io](https://img.shields.io/crates/v/msql_srv.svg)](https://crates.io/crates/msql_srv)
[![Documentation](https://docs.rs/msql-srv/badge.svg)](https://docs.rs/msql-srv/)
[![Build Status](https://travis-ci.com/jonhoo/msql-srv.svg?branch=master)](https://travis-ci.com/jonhoo/msql-srv)
[![Build Status](https://dev.azure.com/jonhoo/jonhoo/_apis/build/status/msql-srv?branchName=master)](https://dev.azure.com/jonhoo/jonhoo/_build/latest?definitionId=27&branchName=master)
[![Codecov](https://codecov.io/github/jonhoo/msql-srv/coverage.svg?branch=master)](https://codecov.io/gh/jonhoo/msql-srv)
![Maintenance](https://img.shields.io/badge/maintenance-experimental-blue.svg)

Bindings for emulating a MySQL/MariaDB server.

Expand All @@ -22,6 +23,7 @@ all commands with a "no results" reply:
```rust
extern crate mysql;
use msql_srv::*;
use mysql::prelude::*;

struct Backend;
impl<W: io::Write> MysqlShim<W> for Backend {
Expand Down Expand Up @@ -77,7 +79,7 @@ fn main() {

let mut db = mysql::Conn::new(&format!("mysql://127.0.0.1:{}", port)).unwrap();
assert_eq!(db.ping(), true);
assert_eq!(db.query("SELECT a, b FROM foo").unwrap().count(), 1);
assert_eq!(db.query_iter("SELECT a, b FROM foo").unwrap().count(), 1);
drop(db);
jh.join().unwrap();
}
Expand Down
8 changes: 0 additions & 8 deletions README.tpl

This file was deleted.

15 changes: 15 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
jobs:
- template: default.yml@templates
parameters:
minrust: 1.39.0 # bytes
# re-enable coverage when we're on a newer version of time:
# https://github.com/time-rs/time/pull/265
# codecov_token: $(CODECOV_TOKEN_SECRET)

resources:
repositories:
- repository: templates
type: github
name: crate-ci/azure-pipelines
ref: refs/heads/v0.4
endpoint: jonhoo
4 changes: 1 addition & 3 deletions src/packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,10 @@ impl<'a> Packet<'a> {
self.1.extend(bytes);
}
} else {
use std::mem;

assert!(self.1.is_empty());
let mut v = self.0.to_vec();
v.extend(bytes);
mem::replace(&mut self.1, v);
self.1 = v;
self.0 = &[];
}
}
Expand Down