I had a similar occurrencee several years ago, when a different kind of pill passed all the way through my digestive tract, and came out intact. I saved it (yuck!) and gave it to the representative of that company for them to analyze, but I never heard back from them.
If you are getting generic (not brand name) pills from your pharmacy, that could be the problem. Some generic medications are made by less-than-reputable companies,, who care about profit more than the patient; they couldn't care less about the latter.
If it should happen again, take the undigested pills to the pharmacy, and show them the pills, and tell them the story. If they're a reputable place (most are), they'll be glad to know the facts, and will be glad to provide replacements, as well as take that particular brand off the shelf.
Considering the seriousness of diabetes, I'd make sure I checked my blood sugar especially closely now, and if it happens again. I'd also tell my doctor, and take him your recent blood sugar results, so he may adjust or change your medication until the pharmacy gets things straightened out.