[MediaWiki-commits] [Gerrit] operations/puppet[production]: mariadb: Update check private data script to handle BINARY f...

2016-12-05 Thread Jcrespo (Code Review)
Jcrespo has submitted this change and it was merged.

Change subject: mariadb: Update check private data script to handle BINARY 
fields
..


mariadb: Update check private data script to handle BINARY fields

We need to trim \0 (unicode/asci code 0), as BINARY fields store
empty string values as \0\0\0... n times, being n the width of the
binary field.

Bug: T152194
Change-Id: I744ba0fd8c1448760b9a71f7b1dc4af75aba22b1
---
M modules/role/files/mariadb/check_private_data.py
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Jcrespo: Looks good to me, approved
  Marostegui: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/modules/role/files/mariadb/check_private_data.py 
b/modules/role/files/mariadb/check_private_data.py
index 341505b..769be5a 100644
--- a/modules/role/files/mariadb/check_private_data.py
+++ b/modules/role/files/mariadb/check_private_data.py
@@ -120,8 +120,8 @@
 query = ("SELECT count(*)"
  " FROM `{}`.`{}`"
  " WHERE IF(`{}` IS NULL, 0,"
- "  `{}` NOT IN ('0', ''))").format(database, table,
-column, column)
+ "  TRIM(LEADING '\0' FROM `{}`) NOT IN ('0', ''))")
+query = query.format(database, table, column, column)
 cursor.execute(query)
 result = cursor.fetchall()
 if int(result[0][0]) > 0:

-- 
To view, visit https://gerrit.wikimedia.org/r/325176
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I744ba0fd8c1448760b9a71f7b1dc4af75aba22b1
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Jcrespo 
Gerrit-Reviewer: Jcrespo 
Gerrit-Reviewer: Marostegui 
Gerrit-Reviewer: Volans 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: mariadb: Update check private data script to handle BINARY f...

2016-12-04 Thread Jcrespo (Code Review)
Jcrespo has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/325176

Change subject: mariadb: Update check private data script to handle BINARY 
fields
..

mariadb: Update check private data script to handle BINARY fields

We need to trim \0 (unicode/asci code 0), as BINARY fields store
empty string values as \0\0\0... n times, being n the width of the
binary field.

Bug: T152194
Change-Id: I744ba0fd8c1448760b9a71f7b1dc4af75aba22b1
---
M modules/role/files/mariadb/check_private_data.py
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/76/325176/1

diff --git a/modules/role/files/mariadb/check_private_data.py 
b/modules/role/files/mariadb/check_private_data.py
index 341505b..769be5a 100644
--- a/modules/role/files/mariadb/check_private_data.py
+++ b/modules/role/files/mariadb/check_private_data.py
@@ -120,8 +120,8 @@
 query = ("SELECT count(*)"
  " FROM `{}`.`{}`"
  " WHERE IF(`{}` IS NULL, 0,"
- "  `{}` NOT IN ('0', ''))").format(database, table,
-column, column)
+ "  TRIM(LEADING '\0' FROM `{}`) NOT IN ('0', ''))")
+query = query.format(database, table, column, column)
 cursor.execute(query)
 result = cursor.fetchall()
 if int(result[0][0]) > 0:

-- 
To view, visit https://gerrit.wikimedia.org/r/325176
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I744ba0fd8c1448760b9a71f7b1dc4af75aba22b1
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Jcrespo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits