Skip to content

Conversation

@jfindley
Copy link
Contributor

Fixes slave status parsing. As it supports variable column widths, this should work on all 5.x versions of mysql/mariadb. No promises about 4.x.

Also cleaned up log files - removing an extraneous space between description and error.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interface{} means any type (like Object in Java), so I think you should be able to use slaveData directly in the rows.Scan.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know what interface{} means ;)
I guess this response means I should have added a comment here. The reason I do this is because rows.Scan() needs a pointer to an object rather than the object itself. &slaveData would give a pointer to the slice of byteslices, when what we need is for each element of slaveData to be a pointer. Creating a slice of interfaces, with each element being a pointer to the underlying sql.NullByte is a simple and fairly standard way of doing this.

Does that clarify it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, would make([]*sql.RawBytes, len(slaveCols) do the same job then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly not - []*sql.RawBytes doesn't satisfy []interface{}.

@discordianfish
Copy link
Member

LGTM
@juliusv / @brian-brazil Can we merge this? It sits around for some time already.

@brian-brazil
Copy link
Contributor

👍 Can you squash the commits?

Includes all numeric and Yes/No items.
@jfindley
Copy link
Contributor Author

Done. Thanks.

brian-brazil added a commit that referenced this pull request Jun 17, 2015
Fix slave status parsing
@brian-brazil brian-brazil merged commit 87ebed8 into prometheus:master Jun 17, 2015
ezraroi pushed a commit to ezraroi/mysqld_exporter that referenced this pull request Apr 17, 2018
# This is the 1st commit message:

Move session params to DSN (prometheus#259)

* Move session params to DSN

In order to avoid lost session params if the `db` object reconnects in
the background, move session params to the DSN string configuration.

* Move log_slow_filter flag to exporter

* Update flag name to be in `exporter` namespace.
* Update README.

* Tweak exporter.log_slow_filter flag documentation.

# This is the commit message prometheus#2:

Fix lock_wait_timeout after prometheus#259 (prometheus#263)


# This is the commit message prometheus#3:

Broken landing page, doesn't include metric path. (prometheus#264)

* Broken landing page, doesn't include metric path.

* Fix landing page.

# This is the commit message prometheus#4:

first commit

Signed-off-by: Roi Ezra <ezraroi@gmail.com>

# This is the commit message prometheus#5:

fixed code review

Signed-off-by: Roi Ezra <ezraroi@gmail.com>

# This is the commit message prometheus#6:

fixed code review

Signed-off-by: Roi Ezra <ezraroi@gmail.com>
arvenil pushed a commit to arvenil/mysqld_exporter that referenced this pull request Aug 30, 2018
Basic MyRocks support (PMM-1290)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants